<?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 = 'DI1130A_PR.php';
include("DYAYUDA.php");
?>
<div align="center">
  <form name="form1" method="post" action="">
    <table width="458"  align="center">
      <tr>
			<th colspan="2">LINEAS</th>
      </tr>
      <tr>
        <th width="297"> <input name="r1" type="radio" value="clave" tabindex="1">
        Clave</th>
        <th width="297"><input name="r1" type="radio" value="descripcion" tabindex="2">
        Descripcion</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 dglineas");
	?>
    </p>
    <table width="706"   align="center">
      <tr>
        <th colspan="8"><div align="left">
          <input type="button" name="Submit6" value="Agregar" onClick="openpage('DI11300_AG.php','_self')"/>
          <input type="Submit" name="bot3" value="Consultar"  onClick="openpage('DI11300_MO.php','_self')"/>
          <input type="button" name="bot2" value="Modificar" onClick="openpage('DI11300_MO.php','_self')"/>
          <input type="button" name="bot1" value="Eliminar" onClick=
"openpage('DI11300_EL.php','_self')"/>
          <input type="button" name="bot4" value="Imprimir " onClick="openpage('DI11300_IM.php','_self')"/>
          <input type="button" name="Submit" value="Mostrar todo" onClick="openpage('DI11300_PR.php','_self')"/>
        </div></th>
      </tr>
      <tr>
        <th colspan="8">Concepto - Lineas </th>
      </tr>
      <tr>
        <th ><div align="center">Selc</div></th>
        <th ><div align="center">Clave</div></th>
		<th ><div align="center">Descripcion</div></th>
        <th ><div align="center">Cuenta Costo</div></th>
        <th ><div align="center">Cuenta Inventario</div></th>
        <th ><div align="center">Cuenta Venta</div></th>
        <th ><div align="center">Cuenta Dev/Vta</div></th>
        <th ><div align="center">Cuenta Desctos/Bonif.</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 dglineas WHERE linea = '".$_POST['t1']."'");
		
	}elseif($_POST['r1']=="descripcion"){
		echo '<input name="tip_bus" type="hidden" value="descripcion">';
		@$sql = mysqli_query($con ,"SELECT * FROM dglineas WHERE des_linea like '%".$_POST['t1']."%'");
	}
	include("DE10000.php");
	while($reg = mysqli_fetch_array($sql))
	{
	  	echo "<tr>";
		echo '<td><div align="center"><input name="bot" type="radio" value="'. $reg["linea"].'">&nbsp</div></td>';
		echo '<td><div align="center">' . $reg["linea"] . '&nbsp</div></td>';
		echo '<td><div align="left">' . $reg["des_linea"] . '&nbsp</div></td>';
		echo '<td><div align="right">' . $reg["cta_con_costo"] . '&nbsp</div></td>';
		echo '<td><div align="right">' . $reg["cta_con_inven"] . '&nbsp</div></td>';
		echo '<td><div align="right">' . $reg["cta_con_vta"] . '&nbsp</div></td>';
		echo '<td><div align="right">' . $reg["cta_dev_vta"] . '&nbsp</div></td>';
		echo '<td><div align="right">' . $reg["cta_des_bon"] . '&nbsp</div></td>';
	}
	mysqli_close($con);
	?>
    </table>
  </form>
</div>
</body>
</html>