<?php
 
session_start();
include("DMMYSQLG.php");

$result = mysqli_query($con ,"SELECT * FROM dginvalm WHERE nparte1 like '".$_POST['m2']."' order by almacen");
@$resultado2=mysqli_fetch_array(mysqli_query($con ,"SELECT nparte1,np_desc1 FROM ptventa WHERE ptventa.modulo='".$_SESSION['mod_sis']."' AND   nparte1 like '".$_POST['m2']."'"));
?>
<html>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<body>
<form name="frm1" id="frm1" method="post" action="">
  <table border='1' align="center">
    <tr>
      <th colspan="3"><?php echo $resultado2['nparte1'].'-'.$resultado2['np_desc1']?>&nbsp;</th>
    </tr>
    <tr>
	  <th><div align="center">Almacen</div></th>
      <th><div align="center">Existencia Fisica</div></th>
      <th><div align="center">Existencia Disponible</div></th>
    </tr>
      <?php

	while($row = mysqli_fetch_array($result))
	{
		$res = mysqli_query($con ,"SELECT * FROM dgalmacen WHERE almacen = '".$row['almacen']."'");
		$dato = mysqli_fetch_array($res);
		  echo "<tr>";
		  echo "<td><div align='center'>" . $dato["desc_almacen"] . "</div></td>";
		  echo "<td><div align='center'>" . $row["exi_fis_alm"] . "</div></td>";
		  echo "<td><div align='center'>" . $row["can_dis_alm"] . "</div></td>";
		  echo "</tr>";
	}
	echo '<input name="bot" type="hidden" value="' . $_POST['m2'] . '"/>';
?>
   </table>
  <div align="center">
    <input type="submit" name="Submit2" value="Regresar" onClick="openpage('DI21100_CO.php','_self')">
  </div>
</form>
</body>
</html>
