<?php
 
session_start();
include("DMMYSQLG.php");
include("DMMYSQLG.php");

?>
<html>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="javascript">
function cpyValText(arrData){
	var id;
	if(arguments[1]!='undefined'){
	for(id in arrData)
		window.opener.document.getElementById(id).value=arrData['id'];		
	}
	else{
		for(id in arrData)
			document.getElementById(id).value=arrData['id'];
	}
}
</script>
<body>
<div align="center">
  <form name="frm1" id="frm1" method="post" action="">
    <table width="458"  align="center">
      <tr> 
        <th width="594" colspan="2">MODIFICAR TARIFA </th>
      </tr>
    </table>
  </form>
</div>
<form id="pp" name="pp" action="">
<table width="487" align = center>
<tr>
	  <th width="49"><div align="center">SEL</div></th>
   	  <th width="100"><div align="center">CODIGO </div></th>
  	  <th width="138"><div align="center">DESCRIPCION</div></th>
	  <th width="102"><div align="center">TEMPORADA</div></th>
	  <th width="74"><div align="center">COSTO</div></th>
      
    </tr>
<?php
 
$sql = mysqli_query($con ,"SELECT * FROM ftarifas");
while(@$reg = mysqli_fetch_array($sql))
	{
	  	echo "<tr>";
?>
		<td> <div align="center"><input type="button" name="button" value="OK" onClick="
			cpyValText({
				
				<?php
echo $_REQUEST['val'];?>:'<?php
 echo $reg['gdescrip'] ?>',
				<?php
echo $_REQUEST['des'];?>:'<?php
 echo $reg['cclave'] ?>',
				<?php
echo $_REQUEST['roc'];?>:'<?php
 echo $reg['gtotal'] ?>'
			});
			window.close();
			"></div></td>
		<?php


		echo "<td> <div align='center'>" . $reg["gclave"] . "</div></td>";
		echo "<td> <div align='center'>" . $reg["gdescrip"] . "</div></td>";
		echo "<td> <div align='center'>" . $reg["cclave"] . "</div></td>";
		echo "<td> <div align='center'>$" . number_format($reg["gtotal"],2,'.',',') . "&nbsp;</div></td>";
		echo "</tr>";
	}
?>
</table>
</form>
</body>
</html>