<?php
 
session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
include("DFJQUERY.inc");
include("DFJSISCI.inc");
?>
<table width="854" border='1'>

<?php


echo '<input name="txt_bus" type="hidden" value="'.$_REQUEST['tbus'].'">';
if($_POST['tbus']!=""){
echo '<input name="txt_t1" type="hidden" value="'.$_POST['tbus'].'">';
 @$sql = mysqli_query($con ,"SELECT * FROM ptventa WHERE ptventa.modulo='".$_SESSION['mod_sis']."' AND ubicacion = 'V' AND status = '0' AND np_desc1 like '%".$_POST['tbus']."%' order by nparte1");
 echo mysqli_error($con);
}elseif($_POST['tbus']==""){
 @$sql = mysqli_query($con ,"SELECT * FROM ptventa WHERE ubicacion = 'V' order by nparte1");
 echo '<input name="txt_bus" type="hidden" value="'.$_POST['tbus'].'">';
 }
	echo mysqli_error($con);
	while($reg = mysqli_fetch_array($sql)){
	
	  	echo "<tr height=\"60\">";
		echo '<td> <div align="center"><input name="bot" type="radio" value="'.$reg["nparte1"].'"></div></td>';
		echo "<td> <div align='center'>" . $reg["nparte1"] . "&nbsp;</div></td>";
		echo "<td> <div align='left'>" . $reg["np_desc1"] . "&nbsp;</div></td>";
		echo "<td> <div align='left'>" . $reg["lim_vta1"] . "&nbsp;</div></td>";
		echo "<td> <div align='left'>" . $reg["cos_prom"] . "&nbsp;</div></td>";
		@$sq = mysqli_query($con ,"SELECT * FROM dglineas WHERE linea = '".$reg['linea']."'");
		$row = mysqli_fetch_array($sq);
		echo "<td> <div align='left'>" .$row["des_linea"] . "&nbsp;</div></td>";
		@$sq_basico = mysqli_query($con ,"SELECT * FROM dgbasico WHERE gpo_basico = '".$reg['gpo_basico']."'");
		$rew = mysqli_fetch_array($sq_basico);
		echo "<td> <div align='left'>" . $rew["des_basico"] . "&nbsp;</div></td>";
		echo "<td> <div align='right'>" . $reg["exi_dis"] . "&nbsp;</div></td>";	
		echo "<td> <div align='left'>" . $reg["exi_min"] . "&nbsp;</div></td>";
		echo "<td> <div align='left'>" . $reg["exi_max"] . "&nbsp;</div></td>";	
		echo "</tr>";
	}
	mysqli_close($con);   
	?>
	</table>
