<?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 dginvent WHERE dginvent.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" method="post" action="">
<input type="hidden" name="fla_bus" id="fla_bus" value="<?php
echo $_REQUEST['fla_bus'];?>">
<input type="hidden" name="m2" id="m2" value="<?php
echo $_REQUEST['m2'];?>">
  <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']."'");
		while($dato = mysqli_fetch_array($res))
		{
			$con = $dato["desc_almacen"];
		}
		  echo "<tr>";
		  echo "<td><div align='center'>" . $con . "</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="m2" type="hidden" value="' . $_POST['m2'] . '"/>';
?>
   </table>
  <div align="center">
    <input type="submit" name="Submit2" value="Regresar" onClick="openpage('DG22000_PR.php','_self')">
  </div>
</form>
</body>
</html>
