<?php
 
session_start();
$com = "M";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DMMYSQLG.php");
require_once("DFJQUERY.inc");
?>
<html>
<link rel="stylesheet" href="ALM_CSS.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<?php

if ($_REQUEST['bot']==""){
	echo '<h2>!!! SELECCIONE UN REGISTRO !!!</h2>';
	echo '<meta content="1; url=AL10600_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
	if(!isset($_REQUEST['tap2'])){
		include('AL10600_CL.php');
		$varible_clase = new clase();
		$res=$varible_clase->lista_busqueda($_REQUEST["bot"]);
		$reg=mysqli_fetch_array($res);
		$_REQUEST['id_pro']=$reg['id_pro'];
		$_REQUEST['tap2']=$reg['np_desc1'];
		$_REQUEST['precio']=$reg['lim_vta1'];
		$_REQUEST['afe_inv']=$reg['afe_inv'];
		$_REQUEST['cve_iva_ven']=$reg['cve_iva_ven'];
		$_REQUEST['afe_coman']=$reg['afe_coman'];
		$_REQUEST['select']=$reg['linea'];
		$_REQUEST['select2']=$reg['gpo_basico'];
		$_REQUEST['tap4']=$reg['exi_min'];
		$_REQUEST['tap5']=$reg['exi_max'];
		$_REQUEST['tap18']=$reg['tip_mon'];
		$_REQUEST['tap14']=$reg['cve_uni_com'];
		$_REQUEST['capacidad']=$reg['capacidad'];
		//$_REQUEST['tap15']=$reg['cve_uni_vta'];
		$_REQUEST['almacen']=$reg['almacen'];
		$_REQUEST['factor']=$reg['factor'];
		$_REQUEST['unidad']=$reg['unidad'];
		$_REQUEST['capacidad']=$reg['capacidad'];
		$_REQUEST['invmin']=$reg['invmin'];
		$_REQUEST['invmax']=$reg['invmax'];
		$_REQUEST['ultimoc']=$reg['ultimoc'];
		$_REQUEST['costop']=$reg['costop'];
		$_REQUEST['existencia']=$reg['existencia'];
		$_REQUEST['maxe']=$reg['maxe'];
		$_REQUEST['maxf']=$reg['maxf'];
		$_REQUEST['maxm']=$reg['maxm'];
		$_REQUEST['maxa']=$reg['maxa'];
		$_REQUEST['maxma']=$reg['maxma'];
		$_REQUEST['maxj']=$reg['maxj'];
		$_REQUEST['maxju']=$reg['maxju'];
		$_REQUEST['maxag']=$reg['maxag'];
		$_REQUEST['maxs']=$reg['maxs'];
		$_REQUEST['maxo']=$reg['maxo'];
		$_REQUEST['maxn']=$reg['maxn'];
		$_REQUEST['maxd']=$reg['maxd'];
		$_REQUEST['mine']=$reg['mine'];
		$_REQUEST['minf']=$reg['minf'];
		$_REQUEST['minm']=$reg['minm'];
		$_REQUEST['mina']=$reg['mina'];
		$_REQUEST['minma']=$reg['minma'];
		$_REQUEST['minj']=$reg['minj'];
		$_REQUEST['minju']=$reg['minju'];
		$_REQUEST['minag']=$reg['minag'];
		$_REQUEST['mins']=$reg['mins'];
		$_REQUEST['mino']=$reg['mino'];
		$_REQUEST['minn']=$reg['minn'];
		$_REQUEST['mind']=$reg['mind'];
		$_REQUEST['entradae']=$reg['entradae'];
		$_REQUEST['entradaf']=$reg['entradaf'];
		$_REQUEST['entradam']=$reg['entradam'];
		$_REQUEST['entradaa']=$reg['entradaa'];
		$_REQUEST['entradama']=$reg['entradama'];
		$_REQUEST['entradaj']=$reg['entradaj'];
		$_REQUEST['entradaju']=$reg['entradaju'];
		$_REQUEST['entradaag']=$reg['entradaag'];
		$_REQUEST['entradas']=$reg['entradas'];
		$_REQUEST['entradao']=$reg['entradao'];
		$_REQUEST['entradan']=$reg['entradan'];
		$_REQUEST['entradad']=$reg['entradad'];
		$_REQUEST['salidae']=$reg['salidae'];
		$_REQUEST['salidaf']=$reg['salidaf'];
		$_REQUEST['salidam']=$reg['salidam'];
		$_REQUEST['salidaa']=$reg['salidaa'];
		$_REQUEST['salidama']=$reg['salidama'];
		$_REQUEST['salidaj']=$reg['salidaj'];
		$_REQUEST['salidaju']=$reg['salidaju'];
		$_REQUEST['salidaag']=$reg['salidaag'];
		$_REQUEST['salidas']=$reg['salidas'];
		$_REQUEST['salidao']=$reg['salidao'];
		$_REQUEST['salidan']=$reg['salidan'];
		$_REQUEST['salidad']=$reg['salidad'];
		
	}
?>
<style type="text/css">BODY {
SCROLLBAR-FACE-COLOR:#0000CC; SCROLLBAR-HIGHLIGHT-COLOR:#00CCFF; SCROLLBAR-SHADOW-COLOR:#0000CC; SCROLLBAR-3DLIGHT-COLOR:#0000CC; SCROLLBAR-ARROW-COLOR:#FFFFFF; SCROLLBAR-TRACK-COLOR:#FFFFFF; SCROLLBAR-DARKSHADOW-COLOR: #330000
}
<!--
.Estilo4 {
	font-family: Arial, Helvetica, sans-serif;
	color: #FFFFFF;
	font-weight: bold;
}
.Estilo5 {font-size: 12px}
.Estilo18 {color: #FFFFFF}
.Estilo19 {font-size: 16px}
.Estilo20 {color: #FFFFFF; font-weight: bold; }
-->
</style>
<script language="javascript">
function ocultaMuestra(divVent){
	if(divVent.style.display=='none'){
		divVent.style.display='';

	}else{
		divVent.style.display='none';

	}
}	
	</script>
	
	
<body>

<form name="frm1" method="post" action="" enctype="multipart/form-data">
  <p>
    <input name="bot" type="hidden" value="<?php
 echo $_REQUEST['bot'];?>"> 
  </p>
  <table width="475"  align="center" bordercolor="#FFCC00" bordercolordark="#FFCC00">
    <tr>
      <th colspan="4">MODIFICAR STOCK </th>
    </tr>
    <tr>
      <td width="113" style="#FFCC00">CODIGO</td>
      <td width="346" colspan="3"><span class="Estilo19">
        <input name="codigo" type="text" id="codigo" size="15"
		  <?php
 
		if(isset($_REQUEST['bot'])){
		echo 'value="'.$reg['codigo'].'"';
		}
		?>
		
		>
      </span></td>
    </tr>
  </table>
  <div id="divVent" style="display:">
    <table width="475"  align="center" bordercolor="#FFCC00" bordercolordark="#FFCC00" >
      <tr>
        <td width="81" style="#FFCC00">DESCRIPCION</td>
        <td colspan="8"><label>
        <input name="tap2" id="tap2" type="text" tabindex="2"
		  onBlur="may(this)" size="30"
		 <?php
 
		if(isset($_REQUEST['bot'])){
		echo 'value="'.$reg['np_desc1'].'"';
		}
		?>>
        </label></td>
        <td style="#FFCC00">INVENTARIO MINIMO</td>
        <td><input name="invmin" type="text" id="invmin" tabindex="20" size="8" value="<?php
 echo $_REQUEST['invmin'];?>"></td>
        <td style="#FFCC00">ULTIMO COSTO</td>
        <td><input name="ultimoc" type="text" id="ultimoc" tabindex="20" size="8" value="<?php
 echo $_REQUEST['ultimoc'];?>"></td>
      </tr>
      
	  
	  
	  
	  
	  <tr>
        <td style="#FFCC00">ALMACEN</td>
        <td colspan="4"><label>
          <select name="almacen" id="almacen" onChange="javascript: document.getElementById('frm1').submit()" tabindex="9">
            <option value="">-----SELECCIONE-----</option>
            <?php
 
$sql = mysqli_query($con ,"SELECT * FROM falmacen WHERE t1 = 'ACTIVO'");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST['almacen']==$reg['np_desc1'] ){
		echo '<option value="' . $reg['np_desc1'] . '" selected>' . $reg['np_desc1'] . '</option>';
	}else{
		echo '<option value="' . $reg['np_desc1'] . '">' . $reg['np_desc1'] . '</option>';
	}
}
?>
          </select>
        </label></td>
        <td style="#FFCC00">UNIDAD</td>
        <td colspan="3"><label><span class="Estilo18">
          <select name="unidad" id="unidad" onChange="javascript: document.getElementById('frm1').submit()" tabindex="9">
            <option value="">-----SELECCIONE-----</option>
            <?php
 
$sql = mysqli_query($con ,"SELECT * FROM dgmedida");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST['unidad']==$reg['np_desc1'] ){
		echo '<option value="' . $reg['np_desc1'] . '" selected>' . $reg['np_desc1'] . '</option>';
	}else{
		echo '<option value="' . $reg['np_desc1'] . '">' . $reg['np_desc1'] . '</option>';
	}
}
?>
          </select>
        </span></label></td>
        <td style="#FFCC00">INVENTARIO MAXIMO</td>
        <td><input name="invmax" type="text" id="invmax" tabindex="20" size="8" value="<?php
 echo $_REQUEST['invmax'];?>"></td>
        <td style="#FFCC00">COSTO PROMEDIO </td>
        <td><input name="costop" type="text" id="costop" tabindex="20" size="8" value="<?php
 echo $_REQUEST['costop'];?>"></td>
      </tr>
      <tr>
        <td style="#FFCC00">FACTOR R</td>
        <td colspan="4"><label>
          <input name="factor" type="text" id="factor" tabindex="20" size="20" value="<?php
 echo $_REQUEST['factor'];?>">
        </label></td>
        <td style="#FFCC00">CAPACIDAD</td>
        <td colspan="3"><label>
          <input name="capacidad" type="text" id="capacidad" tabindex="20" size="20" value="<?php
 echo $_REQUEST['capacidad'];?>">
          </label></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td style="#FFCC00">EXISTENCIA</td>
        <td><input name="existencia" type="text" id="existencia" tabindex="20" size="8" value="<?php
 echo $_REQUEST['existencia'];?>"></td>
      </tr>
      <tr>
        <th colspan="13">&nbsp;</th>
      </tr>
      <tr>
        <th><span class="Estilo22">ENERO</span></th>
        <td colspan="4">&nbsp;</td>
        <th><span class="Estilo22">FEBRERO</span></th>
        <td colspan="3">&nbsp;</td>
        <th width="81"><span class="Estilo22">MARZO</span></th>
        <td colspan="3">&nbsp;</td>
      </tr>
      <tr>
        <td width="81" style="#FFCC00">MAX</td>
        <td width="50" style="#FFCC00">MIN</td>
        <td colspan="2" style="#FFCC00">ENTRADAS</td>
        <td width="119" style="#FFCC00">SALIDAS</td>
        <td width="78" style="#FFCC00">MAX</td>
        <td width="50" style="#FFCC00">MIN</td>
        <td width="74" style="#FFCC00">ENTRADAS</td>
        <td width="74" style="#FFCC00">SALIDAS</td>
        <td style="#FFCC00">MAX</td>
        <td width="50" style="#FFCC00">MIN</td>
        <td width="74" style="#FFCC00">ENTRADAS</td>
        <td width="74" style="#FFCC00">SALIDAS</td>
      </tr>
      <tr>
        <td><label><input name="maxe" type="text" id="maxe" tabindex="20" size="8" value="<?php
 echo $_REQUEST['maxe'];?>"></label></td>
        <td><label><input name="mine" type="text" id="mine" tabindex="20" size="8" value="<?php
 echo $_REQUEST['mine'];?>"></label></td>
        <td colspan="2"><label><input name="entradae" type="text" id="entradae" tabindex="20" size="12" value="<?php
 echo $_REQUEST['entradae'];?>">
        </label></td>
        <td><label>
          <input name="salidae" type="text" id="salidae" tabindex="20" size="12" value="<?php
 echo $_REQUEST['salidae'];?>">
        </label></td>
        <td><label><input name="maxf" type="text" id="maxf" tabindex="20" size="8" value="<?php
 echo $_REQUEST['maxf'];?>"></label></td>
        <td><input name="minf" type="text" id="minf" tabindex="20" size="8" value="<?php
 echo $_REQUEST['minf'];?>"></td>
        <td><label>
          <input name="entradaf" type="text" id="entradaf" tabindex="20" size="12" value="<?php
 echo $_REQUEST['entradaf'];?>">
        </label></td>
        <td><input name="salidaf" type="text" id="salidaf" tabindex="20" size="12" value="<?php
 echo $_REQUEST['salidaf'];?>"></td>
        <td><input name="maxm" type="text" id="maxm" tabindex="20" size="8" value="<?php
 echo $_REQUEST['maxm'];?>"></td>
        <td><input name="minm" type="text" id="minm" tabindex="20" size="8" value="<?php
 echo $_REQUEST['minm'];?>"></td>
        <td><input name="entradam" type="text" id="entradam" tabindex="20" size="12" value="<?php
 echo $_REQUEST['entradam'];?>"></td>
        <td><input name="salidam" type="text" id="salidam" tabindex="20" size="12" value="<?php
 echo $_REQUEST['salidam'];?>"></td>
      </tr>
      <tr>
        <th colspan="13">&nbsp;</th>
      </tr>
      <tr>
        <th><span class="Estilo22">ABRIL</span></th>
        <td colspan="4">&nbsp;</td>
        <th><span class="Estilo22">MAYO</span></th>
        <td colspan="3">&nbsp;</td>
        <th><span class="Estilo22">JUNIO</span></th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="81" style="#FFCC00">MAX</td>
        <td width="50" style="#FFCC00">MIN</td>
        <td colspan="2" style="#FFCC00">ENTRADAS</td>
        <td width="119" style="#FFCC00">SALIDAS</td>
        <td width="78" style="#FFCC00">MAX</td>
        <td width="50" style="#FFCC00">MIN</td>
        <td style="#FFCC00">ENTRADAS</td>
        <td style="#FFCC00">SALIDAS</td>
        <td style="#FFCC00">MAX</td>
        <td style="#FFCC00">MIN</td>
        <td style="#FFCC00">ENTRADAS</td>
        <td style="#FFCC00">SALIDAS</td>
      </tr>
      <tr>
        <td><input name="maxa" type="text" id="maxa" tabindex="20" size="8" value="<?php
 echo $_REQUEST['maxa'];?>"></td>
        <td><input name="mina" type="text" id="mina" tabindex="20" size="8" value="<?php
 echo $_REQUEST['mina'];?>"></td>
        <td colspan="2"><input name="entradaa" type="text" id="entradaa" tabindex="20" size="12" value="<?php
 echo $_REQUEST['entradaa'];?>"></td>
        <td><input name="salidaa" type="text" id="salidaa" tabindex="20" size="12" value="<?php
 echo $_REQUEST['salidaa'];?>"></td>
        <td><input name="maxma" type="text" id="maxma" tabindex="20" size="8" value="<?php
 echo $_REQUEST['maxma'];?>"></td>
        <td><input name="minma" type="text" id="minma" tabindex="20" size="8" value="<?php
 echo $_REQUEST['minma'];?>"></td>
        <td><input name="entradama" type="text" id="entradama" tabindex="20" size="12" value="<?php
 echo $_REQUEST['entradama'];?>"></td>
        <td><input name="salidama" type="text" id="salidama" tabindex="20" size="12" value="<?php
 echo $_REQUEST['salidama'];?>"></td>
        <td><input name="maxj" type="text" id="maxj" tabindex="20" size="8" value="<?php
 echo $_REQUEST['maxj'];?>"></td>
        <td><input name="minj" type="text" id="minj" tabindex="20" size="8" value="<?php
 echo $_REQUEST['minj'];?>"></td>
        <td><input name="entradaj" type="text" id="entradaj" tabindex="20" size="12" value="<?php
 echo $_REQUEST['entradaj'];?>"></td>
        <td><input name="salidaj" type="text" id="salidaj" tabindex="20" size="12" value="<?php
 echo $_REQUEST['salidaj'];?>"></td>
      </tr>
      <tr>
        <th colspan="13">&nbsp;</th>
      </tr>
      <tr>
        <th><span class="Estilo22">JULIO</span></th>
        <td colspan="4">&nbsp;</td>
        <th><span class="Estilo22">AGOSTO</span></th>
        <td colspan="3">&nbsp;</td>
        <th><span class="Estilo22">SEPTIEMBRE</span></th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="81" style="#FFCC00">MAX</td>
        <td width="50" style="#FFCC00">MIN</td>
        <td colspan="2" style="#FFCC00">ENTRADAS</td>
        <td width="119" style="#FFCC00">SALIDAS</td>
        <td width="78" style="#FFCC00">MAX</td>
        <td width="50" style="#FFCC00">MIN</td>
        <td style="#FFCC00">ENTRADAS</td>
        <td style="#FFCC00">SALIDAS</td>
        <td style="#FFCC00">MAX</td>
        <td style="#FFCC00">MIN</td>
        <td style="#FFCC00">ENTRADAS</td>
        <td style="#FFCC00">SALIDAS</td>
      </tr>
      <tr>
        <td><input name="maxju" type="text" id="maxju" tabindex="20" size="8" value="<?php
 echo $_REQUEST['maxju'];?>"></td>
        <td><input name="minju" type="text" id="minju" tabindex="20" size="8" value="<?php
 echo $_REQUEST['minju'];?>"></td>
        <td colspan="2"><input name="entradaju" type="text" id="entradaju" tabindex="20" size="12" value="<?php
 echo $_REQUEST['entradaju'];?>"></td>
        <td><input name="salidaju" type="text" id="salidaju" tabindex="20" size="12" value="<?php
 echo $_REQUEST['salidaju'];?>"></td>
        <td><input name="maxag" type="text" id="maxag" tabindex="20" size="8" value="<?php
 echo $_REQUEST['maxag'];?>"></td>
        <td><input name="minag" type="text" id="minag" tabindex="20" size="8" value="<?php
 echo $_REQUEST['minag'];?>"></td>
        <td><input name="entradaag" type="text" id="entradaag" tabindex="20" size="12" value="<?php
 echo $_REQUEST['entradaag'];?>"></td>
        <td><input name="salidaag" type="text" id="salidaag" tabindex="20" size="12" value="<?php
 echo $_REQUEST['salidaag'];?>"></td>
        <td><input name="maxs" type="text" id="maxs" tabindex="20" size="8" value="<?php
 echo $_REQUEST['maxs'];?>"></td>
        <td><input name="mins" type="text" id="mins" tabindex="20" size="8" value="<?php
 echo $_REQUEST['mins'];?>"></td>
        <td><input name="entradas" type="text" id="entradas" tabindex="20" size="12" value="<?php
 echo $_REQUEST['entradas'];?>"></td>
        <td><input name="salidas" type="text" id="salidas" tabindex="20" size="12" value="<?php
 echo $_REQUEST['salidas'];?>"></td>
      </tr>
      <tr>
        <th colspan="13">&nbsp;</th>
      </tr>
      <tr>
        <th><span class="Estilo22">OCTUBRE</span></th>
        <td colspan="4">&nbsp;</td>
        <th><span class="Estilo22">NOVIEMBRE</span></th>
        <td colspan="3">&nbsp;</td>
        <th><span class="Estilo22">DICIEMBRE</span></th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="81" style="#FFCC00">MAX</td>
        <td width="50" style="#FFCC00">MIN</td>
        <td colspan="2" style="#FFCC00">ENTRADAS</td>
        <td width="119" style="#FFCC00">SALIDAS</td>
        <td width="78" style="#FFCC00">MAX</td>
        <td width="50" style="#FFCC00">MIN</td>
        <td style="#FFCC00">ENTRADAS</td>
        <td style="#FFCC00">SALIDAS</td>
        <td style="#FFCC00">MAX</td>
        <td style="#FFCC00">MIN</td>
        <td style="#FFCC00">ENTRADAS</td>
        <td style="#FFCC00">SALIDAS</td>
      </tr>
      <tr>
        <td><input name="maxo" type="text" id="maxo" tabindex="20" size="8" value="<?php
 echo $_REQUEST['maxo'];?>"></td>
        <td><input name="mino" type="text" id="mino" tabindex="20" size="8" value="<?php
 echo $_REQUEST['mino'];?>"></td>
        <td colspan="2"><input name="entradao" type="text" id="entradao" tabindex="20" size="12" value="<?php
 echo $_REQUEST['entradao'];?>"></td>
        <td><input name="salidao" type="text" id="salidao" tabindex="20" size="12" value="<?php
 echo $_REQUEST['salidao'];?>"></td>
        <td><input name="maxn" type="text" id="maxn" tabindex="20" size="8" value="<?php
 echo $_REQUEST['maxn'];?>"></td>
        <td><input name="minn" type="text" id="minn" tabindex="20" size="8" value="<?php
 echo $_REQUEST['minn'];?>"></td>
        <td><input name="entradan" type="text" id="entradan" tabindex="20" size="12" value="<?php
 echo $_REQUEST['entradan'];?>"></td>
        <td><input name="salidan" type="text" id="salidan" tabindex="20" size="12" value="<?php
 echo $_REQUEST['salidan'];?>"></td>
        <td><input name="maxd" type="text" id="maxd" tabindex="20" size="8" value="<?php
 echo $_REQUEST['maxd'];?>"></td>
        <td><input name="mind" type="text" id="mind" tabindex="20" size="8" value="<?php
 echo $_REQUEST['mind'];?>"></td>
        <td><input name="entradad" type="text" id="entradad" tabindex="20" size="12" value="<?php
 echo $_REQUEST['entradad'];?>"></td>
        <td><label><input name="salidad" type="text" id="salidad" tabindex="20" size="12" value="<?php
 echo $_REQUEST['salidad'];?>">
        </label></td>
      </tr>
	  
	  
	  
	  
      
      <tr>
        <td height="29" colspan="12">
          <div align="center">
            <input type="button" name="bot1" value="Modificar" onClick="cargapag('AL10600_MC.php','_self')" class="original"/>
            <input type="button" name="bot4" value="Regresar" onClick="cargapag('AL10600_PR.php','_self')" class="bot_WsW"/>
          </div></td>
      </tr>
    </table>
  </div>
  <div id="divArt" style="display:none">
</form>
    <?php
 
if(isset($_POST['bot3'])){
	echo '<div align="center"
<?php
 mysqli_close($con);?>>
	<form id="form1" name="form1" action="AL10600_PR.php" target="_self">
		<input type="submit" name="submit" value="Regresar">
	</form>
	</div>';
	
}
?>
 <?php
 
}
?>
</body>
</html>
<?php
 mysqli_close($con);?>

</body>
</html>



