<?php

session_start();
if($_SESSION['tipven']==""){
	$_SESSION['tipven'] = $_POST['tip_ven'];
}
include("DMMYSQLG.php"); 
include("DSA1000.php");
include("DFJSISCI.inc");
include("JQUERY.inc");
$f_m="";
$fec="";

?> 
<html>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script language="JavaScript" type="text/javascript" src="js/click.js?4"></script>
<script type="text/javascript" language="JavaScript1.2" src="js/searchtable.js"></script>
</head>
 
 <script>
    $(function() {
		  theTable = $("#latabla");
		  $("#busq").keyup(function() {
			$.uiTableFilter(theTable, this.value);
		  });
		});
</script>
</head>
<body>
	<div align="center"><form id="form3" name="form3" method="post" action="Inventario.php" >
      <table width="492" height="76"  align="center" bordercolor="#9B0F1A" bordercolordark="#9B0F1A">
	  <tr>
	    <th colspan="2">INVENTARIO</th>
	  </tr><tr>
        <td>   
            <input name="r1" type="radio" value="f" tabindex="3" onClick="arriba(this.value)"/>
            <span class="Estilo1">FOLIO</span>&nbsp;&nbsp;&nbsp;</td>
        <td><span class="Estilo1">
          <input name="folio" type="text" id="folio" size="20" />
      
        </span> </td>
	  </tr>
        <tr>
          <td width="27%"><input name="r1" type="radio" value="de" tabindex="3" onclick="arriba(this.value)"/>
            <span class="Estilo1">DESCRIPCION</span>&nbsp;&nbsp;&nbsp;</td>
          <td width="73%"><input name="descripcion" type="text" id="descripcion" onkeyup="may(this)"/>
          </td>
        </tr>
        <tr>
          <td colspan="2">     
            <div align="center">
              <input type="submit" name="Submit32" value="Buscar" class="bot_WsW" />          
          </div></td>
        </tr>
       
      </table>
  </form>
</div>
     <div align="center" id="busqueda">
       BUSQUEDA RAPIDA
        <input color="#000" name="busq" type="text" id="busq" value placeholder="cualquier texto de la busqueda actual(nombre, folio)" style="width:430"/>
  
     
    </div>
    
<form name="frm1" id="frm1" method="post" action="" >
<div align="center" id="uno">
<?php
	$result = mysqli_query($con ,"SELECT * FROM dginventp");
	?>
    
<table width="525" border='1' id="latabla" name="latabla" bordercolor="#9B0F1A" bordercolordark="#9B0F1A" >
       <thead>   <tr>
        <th colspan="6"> 
          <div align="center">
		 <!--<input type="submit" name="Submit6" value="ENTRADAS POR FACTURA" onClick="openpage('AL10700_PR.php','_self')" class="original">-->
<!--          <input type="Submit" name="bot2" value="Modificar" onClick="openpage('AL10700_MO.php','_self')" class="bot_WsW"/>
          <input type="button" name="bot12" value="Cancelar" onClick="openpage('AL10700_EL.php','_self')" class="bot_RjR"/>
          <input type="button" name="bot42" value="Imprimir" onClick="openpage('AL10700_IM.php','_self')" class="original"/>
		  <input type="button" name="bot9" value="Desplegar"  onClick="openpage('AL10700_DE.php','_self')" class="bot_WsW"/>-->
		  </div >
   		</th></tr>
		<tr>
        <th colspan="6">
		<?php
        
		$res2 = mysqli_query($con ,"SELECT * FROM dginventp ");
		$row2 = mysqli_fetch_array($res2);
	
		?></th>
      </tr>
<tr>
        <th width="30" height="19"><div align="center">SEL</div></th>
        <th width="60"><div align="center">FOLIO </div></th>
        <th width="120"><div align="center">DESCRIPCION ANt</div></th>
		<th width="230"><div align="center">DESCRIPCION NEVA</div></th>
	
		
       
        	<th width="129"><div align="center">PRECIO</div></th>
        	<th width="129"><div align="center">VENTA</div></th>
<!--        <th width="24"><div align="center">Iva</div></th>
        <th width="113"><div align="center">STATUS </div></th>-->
</tr></thead><tbody>
	<?php
$vs=(isset($_POST['submit']))?$_POST['submit']:"";
           $vpr=(isset($_POST['r1']))?$_POST['r1']:"";
	// --->
	  	$fec = isset($_POST['fec'])?$_POST['fec']:"";
		include('DF20000.php');
		$fecha_inicial = $f_m;
		//$pdf->Cell(15,5,$fecha_inicial,1,0,'C');
		$fec = isset($_POST['fec2'])?$_POST['fec2']:"";
		include('DF20000.php');
		$fecha_final = $f_m;

	if($vs=="" && $vpr=="f"){
		echo '<input name="tbusqueda" type="hidden" value="no">';
                $result = mysqli_query($con ,"SELECT * FROM dginventp WHERE nparte1 = '".$_POST['folio']."'");
	  	
   	}elseif($vs=="" && $vpr=="de"){
		echo '<input name="tbusqueda" type="hidden" value="de">';
		$result = mysqli_query($con ,"SELECT * FROM dginventp WHERE np_desc1  LIKE '%".$_POST['descripcion']."%'");         
        }
       
	while($row = mysqli_fetch_array($result))   
	{
	  	echo "<tr>"; 
			echo '<td> <div align="center" style="color:#000"><input name="bot" id="code-"'. $row["nparte1"].'" type="radio" value="'. $row['nparte1'].'"></div></td>';		
		echo "<td> <div align='center' style='color:#000'><strong>" . $row['nparte1'] . "</strong></div></td>";
		echo "<td> <div align='left' style='color:#000'><strong>" . $row['np_desc1'] . "</strong></div></td>";
		        
		        echo "<td> <div align='l' style='color:#000'><input class='Estilo1' id='nom-". $row["nparte1"]."' style=' width: 190px;' value='" . $row["np_desc1"] . "'/></div></td>";
		        echo "<td> <div align='center'><input class='Estilo1' id='pre-". $row["nparte1"]."' style=' width: 80px;' value='" . $row["lim_vta1"] . "'/></div></td>";
		        
		          echo "<td> <div align='center'><input type='checkbox' class='Estilo1' id='a-". $row["nparte1"]."' ". (( $row["activo"]==1)?'checked':'') . " value='1'/></div></td>";
		echo "</tr>"; 
		
	}
//     
       
//        $buscar = $_POST['b'];
//       
//      if(!empty($buscar)) {
//            buscar($buscar);
//      }
//      function buscar($b) {
//             $result = mysqli_query($con ,"SELECT * FROM farticulos WHERE np_desc1 = '".$_POST['b']."'");     
//            $contar = mysqli_num_rows($result);     
//            if($contar == 0){
//                  echo "No se han encontrado resultados para '&lt;b&gt;".$b."&lt;/b&gt;'.";
//            }else{
//                while($row = mysqli_fetch_array($result))   
//	{
//	  	echo "<tr>";
//			echo '<td> <div align="center" style="color:#000"><input name="bot" type="radio" value="'. $row['nparte1'].'"></div></td>';		
//		echo "<td> <div align='center' style='color:#000'><strong>" . $row['nparte1'] . "</strong></div></td>";
//		echo "<td> <div align='center' style='color:#000'><strong>" . $row['np_desc1'] . "</strong></div></td>";
//		echo "<td> <div align='center' style='color:#000'><strong>" . $row['cos_prom'] . "</strong></div></td>";
//                echo "<td> <div align='center' style='color:#000'><strong>" . $row['t7'] . "</strong></div></td>";
//              //  echo "<td> <div align='center' style='color:#000'><strong>" . $row['t5'] . "</strong></div></td>";
//                echo "<td> <div align='center'><input class='Estilo1' id='cant-". $row["nparte1"]."' style=' width: 30px;' value='" . $row["t5"] . "'/></div></td>";
//		echo "</tr>";
//		
//		//fin
//	}
//            }
//      }
        
	mysqli_close($con);
	?>
</tbody>
  </table>
</div>
</form>
</body>
</html>
