<?php
 
session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
include("DMMYSQLG.php");
?>
<html>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<body>
<?php
 
$ayuda = 'DX6200A_PR.php';
include("DYAYUDA.php");
?>
<div align="center">
  <form name="form1" method="post" action="">
    <table width="460"  align="center">
      <tr>
        <th colspan="2"> TIPO DE CAMBIO </th>
      </tr>
      <tr>
        <th width="297"> <input name="r1" type="radio" tabindex="1" value="clave" checked>
          Clave </th>
        <th width="297"><input name="r1" type="radio" value="nombre" tabindex="2">
        Moneda </th>
      </tr>
      <tr>
        <td colspan="2"><input name="tbus" type="text" onBlur="may(this)" size="75"/></td>
      </tr>
      <tr>
        <td colspan="2"><div align="center">
          <input type="submit" name="Submit" value="Buscar" />
        </div></td>
      </tr>
    </table>
  </form>
</div>
<div align="center">
  <form name="frm1" method="post" action="" >
    <?php
 
	@$sql = mysqli_query($con ,"SELECT * FROM dxtcamon order by llave");
	include("DE10000.php");
	?>
    <table border='1'>
      <tr>
        <th colspan="7"> <div align="left">
          <input type="button" name="Submit6" value="Agregar" onClick="openpage('DX62000_AG.php','_self')"/>
          <input type="Submit" name="bot3" value="Consultar"  onClick="openpage('DX62000_CO.php','_self')"/>
          <input type="button" name="bot2" value="Modificar" onClick="openpage('DX62000_MO.php','_self')"/>
          <input type="button" name="bot1" value="Eliminar" onClick=
"openpage('DX62000_EL.php','_self')"/>
          <input type="button" name="bot4" value="Imprimir " onClick="openpage('DX62000_IM.php','_self')"/>
          <input type="button" name="Submit" value="Mostrar todo" onClick="openpage('DX62000_PR.php','_self')"/>
        </div></th>
      </tr>
      <tr>
        <th colspan="7">Concepto - Tipo de Cambio </th>
      </tr>
      <tr>
        <th><div align="center">Sel</div></th>
        <th><div align="center">Clave</div></th>
        <th><div align="center">Pa&iacute;s</div></th>
        <th><div align="center">Moneda</div></th>
	    <th><div align="center">Fecha</div></th>
        <th><div align="center">Tipo de Cambio</div></th>
        <th><div align="center">Paridad (VS) Dolar</div></th>
      </tr>
      <?php

	echo '<input name="txt_bus" type="hidden" value="'.$_POST['tbus'].'">';
	if($_POST['r1']=="clave")
	{
		include("DMMYSQLG.php");
		echo '<input name="tip_bus" type="hidden" value="clave">';
	  	@$sql = mysqli_query($con ,"SELECT * FROM dxtcamon WHERE llave = '".$_POST['tbus']."'");
		
	}elseif($_POST['r1']=="nombre")
	{
		include("DMMYSQLG.php");	
		echo '<input name="tip_bus" type="hidden" value="nombre">';
		@$b=mysqli_query($con ,"select * from dxpaimon where des_moneda like '%".$_POST['tbus']."%'");
		@$rs = mysqli_fetch_array($b);
		
		$mon=$rs["cve_mon"];
		
		include("DMMYSQLG.php");
		@$sql = mysqli_query($con ,"SELECT * FROM dxtcamon WHERE cve_mon = '$mon'");
	}
	while($reg = mysqli_fetch_array($sql))
	{
	  	echo "<tr>";
		echo '<td> <div align="center"><input name="bot" type="radio" value="'. $reg["llave"].'"></div></td>';
		echo "<td> <div align='center'>" . $reg["llave"] . "</div></td>";
		include("DMMYSQLG.php");
		@$bus=mysqli_query($con ,"select * from dxpaises where cve_pais = '".$reg['cve_pais']."'");
		@$re = mysqli_fetch_array($bus);
		echo '<td><div align="left">' . $re['des_pais'] . '&nbsp;</div></td>';
		@$bu=mysqli_query($con ,"select * from dxpaimon where cve_mon = '".$reg['cve_mon']."'");
		@$r = mysqli_fetch_array($bu);
		echo "<td> <div align='left'>" . $r['des_moneda'] . "</div></td>";
		$fec1 = $reg["fecha"];
		include("DF20000.php");
		echo "<td> <div align='right'>" . $f_f . "</div></td>";
		echo "<td> <div align='right'>" . number_format($reg["tip_cam"], 2, '.', ',') . "</div></td>";
		echo "<td> <div align='right'>" . number_format($reg["par_dll"], 2, '.', ',') . "</div></td>";
		echo "</tr>";
	}
	mysqli_close($con);
	?>
    </table>
  </form>
</div>
</body>
</html>
