<?php
 
session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
include("DMMYSQLG.php");
?>
<html>
<head>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="cache-control" content="no-cache"> 
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT"> 

<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
</head>

<body>
<?php
 
$ayuda = 'DN2100A_PR.php';
include("DYAYUDA.php");
?>
<div align="center">
  <form name="form1" method="post" action="">
  </form>
</div>
<div align="center">
  <form name="frm1" method="post" action="" >
    <p>
    <th colspan="2"> <?php

	  
	  $sql=mysqli_query($con ,"SELECT * FROM dntrab_a WHERE no_trab='".$_SESSION['no_nom']."'");
	  $row=mysqli_fetch_array($sql);
	  
	  echo ' ( ' . $row["no_nom"] . ' | ' . $row["nom"] . ' ' . $row["ape_pat"] . ' ' . $row["ape_mat"] . ' )';
	  ?>
    </p>
    <table width="499"  align="center">
      <tr>
        <th colspan="5"><div align="left">
            <input type="button" name="Submit6" value="Agregar" onClick="openpage('DN21000_AG6.php','_self')"/>
            <input type="Submit" name="bot3" value="Consultar"  onClick="openpage('DN21000_CO6.php','_self')"/>
            <input type="button" name="bot2" value="Modificar" onClick="openpage('DN21000_MO6.php','_self')"/>
            <input type="button" name="bot1" value="Eliminar" onClick="openpage('DN21000_EL6.php','_self')"/>
            <input type="button" name="bot4" value="Imprimir " onClick="openpage('DN21000_IM6.php','_self')"/>
            <input type="button" name="Submit" value="Regresar" onClick="openpage('DN21000_ME.php','_self')"/>
        </div></th>
      </tr>
      <tr>
        <th width="34"><div align="center">Sel</div></th>
        <th width="159"><div align="center">Nombre</div></th>
        <th width="144">Fotografia</th>
        <th width="134"><div align="center">Procesado</div></th>
      </tr>
 <?php

	echo '<input name="txt_t1" type="hidden" value="'.$_POST['t1'].'">';
	if($_POST['r1']=="id_doc")	{
		echo '<input name="tip_bus" type="hidden" value="id_doc">';
	  	$sql = mysqli_query($con ,"SELECT * FROM dnnomdoc LEFT JOIN dntrab_g ON(dnnomdoc.id_doc=dntrab_g.id_doc) WHERE  id_emp = '".$_SESSION['no_nom']."'");

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

	}
	include("DN21000_CL6.php");
 
 $objvr = new clase();
 $objvr->id_emp = $_SESSION['no_nom'];
 $sql=$objvr->verifica();
 while($reg = mysqli_fetch_array($sql))
	{
  
	  	echo "<tr>";
	

		 '&nbsp</div></td>';
		$fotografia = 'foto/doc_trab/'.trim($reg['doc']);
		if (trim($reg['doc'])!="") {
			echo '<td><div align="center"><input name="bot" type="radio" value="'. $reg["no_reg"].'"></div></td>';
			echo '<td><div align="center">' . $reg["des_doc"] . '&nbsp</div></td>';			
			echo '<td class="inputcodigo"><div align="center"><img src="'.$fotografia.'" width="32" height="40">&nbsp</div></td>';
			echo '<td class="inputcodigo"><div align="center">PROCESADO&nbsp</div></td>';
		}else{
			echo '<td><div align="center"><input name="bot" disabled type="radio" value="'. $reg["no_reg"].'"></div></td>';
			echo '<td><div align="center">' . $reg["des_doc"] . '&nbsp</div></td>';			
			echo '<td class="inputcodigo"><div align="center"><img src="foto/Sin_Doc.jpg" width="40" height="40">&nbsp</div></td>';
			echo '<td class="inputcodigo"><div align="center">NO PROCESADO&nbsp</div></td>';
		}		
		echo "</tr>";
	}
 
 
	/*while($reg = mysqli_fetch_array($sql))
	{
  
	  	echo "<tr>";
	
		echo '<td><div align="center"><input name="bot" type="radio" value="'. $reg["id_doc"].'"></div></td>';
		echo '<td><div align="center">' . $reg["des_doc"] . '&nbsp</div></td>';
		 '&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>