<? 
$nivel = $_GET["nivel"];
require_once('../../../conf/connection.php');
$nombreuser =$_GET["nombreuser"];
//extraer sucursal
        // $query_sucu="SELECT * FROM user_sistem WHERE nombre='$nombreuser'";
	   //  $res_sucu=mysql_query($query_sucu);
	   //  $sucu=mysql_result($res_sucu,0,"sucursal");
//nombre suscursal
	  // $query_nom="SELECT * FROM sucu WHERE codsucu='$sucu'";
	   //$res_nom=mysql_query($query_nom);
	   //$nom_sucu=mysql_result($res_nom,0,"nombre");
$hoy=date("d-m-Y");
$ano=date("Y");
?>
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
  

    <meta charset="utf-8">
    <title>INVENTARIO</title>
    <meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no, width = device-width">

    <!--[if lt IE 9]><script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    <link rel="stylesheet" href="../../../style.css" media="screen">
    <!--[if lte IE 7]><link rel="stylesheet" href="../style.ie7.css" media="screen" /><![endif]-->
    <link rel="stylesheet" href="../../../style.responsive.css" media="all">

    <script src="../../../jquery.js"></script>
    <script src="../../../script.js"></script>
    <script src="../../../script.responsive.js"></script>



<style>.art-content .art-postcontent-0 .layout-item-0 { border-top-width:1px;border-top-style:solid;border-top-color:#B1C9C7;margin-top: 10px;margin-bottom: 10px;  }
.art-content .art-postcontent-0 .layout-item-1 { border-right-style:solid;border-right-width:1px;border-right-color:#B1C9C7; padding-right: 10px;padding-left: 10px;  }
.ie7 .art-post .art-layout-cell {border:none !important; padding:0 !important; }
.ie6 .art-post .art-layout-cell {border:none !important; padding:0 !important; }

</style>

 <script type="text/javascript" src="../js/jquery-1.6.2.js"></script>
  <script type="text/javascript" src="../../../funciones/scripts.js"></script>
  <script type="text/javascript">
  
  $(document).ready(function(){
	
	  $("#pat").keyup(function(){
	
		  $.post("search.php", {sucu:frm_sch.sucu.value,patron:frm_sch.pat.value, opcion:$("input[@name='rd1']:checked").val()}, function(result) {
			  
			  $("#resultado").html(result).show();
		  });
	  });
  });
  
  var miPopup
		function agregar(){
			miPopup = window.open("add.php?nombreuser=<? echo $nombreuser ?>","miwin","width=900,height=650,scrollbars=yes");
			miPopup.focus();
		}
		function familia(){
			miPopup = window.open("familia/add.php?nombreuser=<? echo $nombreuser ?>","miwin","width=700,height=650,scrollbars=yes");
			miPopup.focus();
		}
		
		function entrada(){
			miPopup = window.open("entradas/index.php?nombreuser=<? echo $nombreuser ?>","miwin","width=700,height=650,scrollbars=yes");
			miPopup.focus();
		}
		
		function salida(){
			miPopup = window.open("salidas/index.php?nombreuser=<? echo $nombreuser ?>","miwin","width=700,height=650,scrollbars=yes");
			miPopup.focus();
		}
		function informe(){
			miPopup = window.open("informe/index.php?nombreuser=<? echo $nombreuser ?>","miwin","width=700,height=650,scrollbars=yes");
			miPopup.focus();
		}
		function compra(){
			window.open("fac_compra/index.php?nombreuser=<? echo $nombreuser ?>");
			focus();
		}
		function cartola(){
			miPopup = window.open("cartola/index.php?nombreuser=<? echo $nombreuser ?>","miwin","width=900,height=700,scrollbars=yes");
			miPopup.focus();
		}
		
		function solicitar(){
			miPopup = window.open("mod_venta/index.php?nombreuser=<? echo $nombreuser ?>","miwin","width=900,height=700,scrollbars=yes");
			miPopup.focus();
		}
		
		
</script>
</head>
<body>
<div id="art-main">
<nav class="art-nav">
    <ul class="art-hmenu">
      <li class="active"><a href="../inventario/index.php?nombreuser=<? echo $nombreuser ?>" class="active">INICIO</a></li>
    </ul> 
    </nav>
<div class="art-sheet clearfix">
            <div class="art-layout-wrapper">
                <div class="art-content-layout">
                    <div class="art-content-layout-row">
                        <div class="art-layout-cell art-content"><article class="art-post art-article">
                                
                                                
                                <div class="art-postcontent art-postcontent-0 clearfix"><div class="art-content-layout">
    <div class="art-content-layout-row">
    <div class="art-layout-cell layout-item-1" style="width: 100%" >
        <h3>MODULO DE INVENTARIO BODEGA</h3>
     <p align="left">
       <form id="frm_sch" name="frm_sch">
       <input type="hidden" name="nombreuser" id="nombreuser" value="<? echo $nombreuser ?>">
       <input type="hidden" name="sucu" id="sucu" value="<? echo $sucu ?>">
    <table width="668">
      <tr align="#69BFE0">
       <td width="250">Buscar por:</td>
      </tr>
      <tr>
        <td align="right">CODIGO DE PRODUCTO:</td>
        <td width="406"><input type="radio" id="rd1" name="rd1" value="1"></td>
      </tr>
      <tr>
        <td align="right"><label>DESCRIPCION DEL PRODUCTO: </label></td>
        <td><input type="radio" id="rd1" name="rd1" value="2"></td>
      </tr>
      <tr>
        <td align="right"><label>PATRON DE BUSQUEDA: </label></td>
        <td><input name="pat" type="text" id="pat" size="60"></td>
      </tr>
    </table>
  </form>
 <?
	    $query_unit="SELECT * FROM articulos WHERE stock='0'";
		$res_unit=mysql_query($query_unit);
		$nr_pro=mysql_num_rows($res_unit);
		      if($nr_pro>0)
			  {	
				$val_sto=mysql_result($res_unit,0,"stock"); 
				
			
			  if($val_sto=="0"){ ?> <fieldset> <font color="#FF0000"> ADVERTENCIA: Existen Producto Sin stock...Revisar Listado y ajustar Inventario. </font>    </fieldset>  <? }			   
			  }
		
		  $query_unitd="SELECT * FROM articulos WHERE stock<=stock_minimo";
		$res_unitd=mysql_query($query_unitd);
		$nr_prod=mysql_num_rows($res_unitd);
		      if($nr_prod>0)
			  {	
		  
		       $val_stod=mysql_result($res_unitd,0,"stock"); 
				$sto_min=mysql_result($res_unitd,0,"stock_minimo");
		  
		  if($sto_min<=$val_stod){ ?> <fieldset> <font color="#FF0000"> ADVERTENCIA: Existen Producto en stock Mínimo...Revisar Listado y ajustar Inventario.</font>    </fieldset>  <? }
			  }
	  
	   ?>

     
     <hr> </p>
     <p align="left">  
     <div id="resultado">
     </div></p>
    
    </div>
    </div>
</div>
<div class="art-content-layout-br layout-item-0">
</div></div>


</article></div>
                        <div class="art-layout-cell art-sidebar1">
                        <div class="art-vmenublock clearfix">
        <div class="art-vmenublockheader">
           
        </div>
        <div class="art-vmenublockcontent">

                
        </div>
</div><div class="art-block clearfix">
        <div class="art-blockheader">
            <h3 class="t">Operaciones</h3>
        </div>
         <div class="art-vmenublockcontent">

<ul class="art-vmenu">

        <li><a onClick="agregar()" href="">AGREGAR PRODUCTOS</a></li>
        <li><a href="" onClick="entrada()">ENTRADA DE PRODUCTOS</a></li>
        <li><a href="" onClick="salida()">SALIDA DE PRODUCTOS</a></li>
        <li><a href="" onClick="cartola()">CARTOLA DE EXISTENCIAS</a></li>
        <li><a href="" onClick="informe()">INFORMES DE BODEGA</a></li>
         <li>---</li>
         <li><a href="" onClick="solicitar()">SOLICITAR PRODUCTOS</a></li>
        

</ul>
</div>
</div></div>
                    </div>
                </div>
            </div><footer class="art-footer">

<p>Copyright © <? echo $ano ?>. All Rights Reserved.</p>
</footer>

    </div>
    <p class="art-page-footer">
        <span id="art-footnote-links">Informatica Francisco Arias E.I.R.L.</span>
    </p>
</div>


</body></html>