<?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 = 'DN2100A_PR.php';
include("DYAYUDA.php");
?>
<div align="center">
  <form name="form1" method="post" action="">
    <table width="460"  align="center">
      <tr>
			<th colspan="2">Catalogo Empleados(Datos Generales)</th>
      </tr>
      <tr>
        <th width="297"> <input name="r1" type="radio" tabindex="1" value="clave" checked>
        No.  Nomina </th>
        <th width="297"><input name="r1" type="radio" value="nombre" tabindex="2">
        Nombre</th>
      </tr>
      <tr>
        <td colspan="2"><input name="t1" type="text" id="t1"  onBlur="may(this)" size="75"/></td>
      </tr>
      <tr>
        <td colspan="2"><div align="center">
          <input type="submit" name="Submit32" value="Buscar" />
        </div></td>
      </tr>
    </table>
  </form>
</div>
<div align="center">
  <form name="frm1" method="post" action="" >
    <p>
    <?php
 
	$sql = mysqli_query($con ,"SELECT * FROM dntrab_a ORDER BY no_nom");
	?>
    </p>
    <table  align="center">
      <tr>
        <th colspan="4"><div align="left">
          <input type="button" name="Submit6" value="Agregar" onClick="openpage('DN21000_AG.php','_self')"/>
          <input type="Submit" name="bot3" value="Consultar"  onClick="openpage('DN21000_CO.php','_self')"/>
          <input type="button" name="bot2" value="Modificar" onClick="openpage('DN21000_MO.php','_self')"/>
          <input type="button" name="bot1" value="Eliminar" onClick="openpage('DN21000_EL.php','_self')"/>
          <input type="button" name="bot4" value="Imprimir " onClick="openpage('DN21000_IM.php','_self')"/>
          <input type="button" name="Submit" value="Mostrar todo" onClick="openpage('DN21000_PR.php','_self')"/>
		</div></th>
      </tr>
      <tr>
        <th colspan="2">
          <div align="center">
            <input type="button" name="Submit2" value="Datos Generales" onClick="openpage('DN21000_SE.php','_self')">
          </div></th>
        <th colspan="2">Concepto - Datos Generales </th>
      </tr>
      <tr>
        <th><div align="center">Sel</div></th>
        <th><div align="center">No.  Nomina </div></th>
		<th><div align="center">Nombre</div></th>
		<th><div align="center">Fotografia</div></th>
      </tr>
	<?php

	echo '<input name="txt_t1" type="hidden" value="'.$_POST['t1'].'">';
	if($_POST['r1']=="clave")	{
		echo '<input name="tip_bus" type="hidden" value="clave">';
	  	$sql = mysqli_query($con ,"SELECT * FROM dntrab_a WHERE no_nom = '".$_POST['t1']."'");

	}elseif($_POST['r1']=="nombre"){
		echo '<input name="tip_bus" type="hidden" value="fecha">';
		$sql = mysqli_query($con ,"SELECT * FROM dntrab_a WHERE nom like '%".$_POST['t1']."%' ORDER BY no_nom");

	}
	include("DE10000.php");
	while($reg = mysqli_fetch_array($sql))
	{
	  	echo "<tr>";
		echo '<td><div align="center"><input name="bot" type="radio" value="'. $reg["no_trab"].'">&nbsp</div></td>';
		echo '<td><div align="center">' . $reg["no_nom"] . '&nbsp</div></td>';
		echo '<td><div align="left">' . $reg["nom"] . ' ' . $reg["ape_pat"] . ' ' . $reg["ape_mat"] . '&nbsp</div></td>';
		$fotografia = 'foto/NO_'. $reg["no_nom"] .'.JPG';
		if (file_exists($fotografia)) {
			echo '<td class="inputcodigo"><div align="center"><img src="foto/NO_'.$reg["no_nom"].'.JPG" width="32" height="40">&nbsp</div></td>';
		}else{
			echo '<td class="inputcodigo"><div align="center"><img src="foto/Sin_Foto.jpg" width="40" height="40">&nbsp</div></td>';
		}
		echo "</tr>";
	}
	mysqli_close($con);
	?>
    </table>
  </form>
</div>
</body>
</html>