<?php
 
session_start();
include("DMMYSQLG.php");
//include("DSA1000.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 = 'DX10000_PR.php';
include("DYAYUDA.php");
?>
<div align="center">
  <form name="form1"  method="post" action="">
    <table width="458"  align="center">
      <tr>
			<th>CATALOGO DE OPERADORES </th>
      </tr>
      <tr>
        <th>NOMBRE DE EMPRESA . 
		    <span class="Estilo1">
		    <select name="fcodmeca" id="fcodmeca" onChange="javascript: document.getElementById('form1').submit()" tabindex="6">
              <option value="">-----------------SELECCIONE-----------------</option>
              <?php
 
$sql1 = mysqli_query($con ,"SELECT * FROM dxempres");
while($reg1=mysqli_fetch_array($sql1)){
	if($_POST['fcodmeca']==$reg1['cla_emp'] ){
		echo '<option value="' . $reg1['cla_emp'] . '" selected>' . $reg1['siglas'] . '</option>';
	}else{
		echo '<option value="' . $reg1['cla_emp'] . '">' . $reg1['siglas'] . '</option>';
	}
}
?>
            </select>
	      </span>		  </th>
      </tr>
      <tr>
        <td><div align="center">
          <input type="submit" name="Submit32" value="Buscar" />
        </div></td>
      </tr>
    </table>
  </form>
</div>
<div align="center">
  <form name="frm1" id="frm1" method="post" action="">
	<input type="hidden" name="select" value=" <?php
echo $_POST['select']?>">
    <?php
 
	@$sql = mysqli_query($con ,"SELECT * FROM dxopemaex where emp_sel = '".$_POST['fcodmeca']."' order by nombre");
	include("DE10000.php");
	?>
    <table width="875" border='1'>
      <tr>
        <th colspan="7"> 
          <div align="center">
            <input type="button" name="Submit6" value="Agregar" onClick="openpage('DX10000_AG.php','_self')"/>
            <input type="Submit" name="bot3" value="Consultar"  onClick="openpage('DX10000_CO.php','_self')"/>
            <input type="button" name="bot2" value="Modificar" onClick="openpage('DX10000_MO.php','_self')"/>
            <input type="button" name="bot1" value="Eliminar" onClick="openpage('DX10000_EL.php','_self')"/>
            <input type="button" name="bot4" value="Imprimir " onClick="openpage('DX10000_IM.php','_self')"/>
            </div></th></tr>
      <tr>
        <th width="25"><div align="center">SEL.</div></th>
        <th width="87"><div align="center">CLAVE. </div></th>
		<th width="182"><div align="center">NOMBRE.</div></th>
		<th width="71"><div align="center">MAESTRO.</div></th>
        <th width="116"><div align="center">SEL/ EMPRESA.</div></th>
		<th width="272"><div align="center">EMPRESA.</div></th>
        <th width="76"><div align="center">RESTRICIIONES.</div></th>
      </tr>
      <?php

	while($reg = mysqli_fetch_array($sql))
	{
	  	echo "<tr>";
		echo '<td> <div align="center"><input name="bot" type="radio" value="'. $reg["oper"].'">&nbsp;</div></td>';
		echo "<td> <div align='left'>" . $reg["nombre"] . "&nbsp;</div></td>";
		echo "<td> <div align='left'>" . $reg["nomb"] . ' ' . $reg["apa"] . ' ' . $reg["ama"] ."</div></td>";
		if($reg["maestro"]==0){
			$ma="MAESTRO";
		}else{
			$ma="USUARIO";
		}
		echo "<td> <div align='left'>" . $ma . "&nbsp;</div></td>";
		if($reg["sel_emp"]==0){
			$se="NO";
		}else{
			$se="SI";
		}
		echo "<td> <div align='center'>" . $se . "&nbsp;</div></td>";
		include("DMMYSQLG.php");
		$jedjh = $reg["emp_sel"];
		include("DMMYSQLG.php");
		include("DMMYSQLG.php");
		$kajhk = mysqli_query($con ,"SELECT * FROM geoyos_jc.dxempres WHERE cla_emp = '$jedjh'");
		$qjksa = mysqli_fetch_array($kajhk);
		echo "<td> <div align='center'>" . $qjksa["siglas"] . "&nbsp;</div></td>";
		
		if($reg["acc_res"]==0){
			$ar="NO";
		}else{
			$ar="SI";
		}
		echo "<td> <div align='center'>" . $ar . "&nbsp;</div></td>";
		echo "</tr>";
	}
	mysqli_close($con);
	?>
    </table>
  </form>
</div>
</body>
</html>

