<? 
$nivel = $_GET["nivel"];
$nombrevar =$_GET["nombreuser"];
$hoy=date("d-m-Y");
require_once('../../../../conf/connection.php');

            
?>
<!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">
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Cabin|Open+Sans+Condensed:700&amp;subset=latin">

    <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>
$(document).ready(function(){
// Demo 5
$('#identidad').Rut({
  on_error: function(){ alert('Rut incorrecto'); },
  format_on: 'keyup' 
});
$("#content > ul").tabs();
});

function cerrar() {
			window.close();
		}
		
</script>  
 <script type="text/javascript" src="../../js/jquery-1.6.2.js"></script>
   <script src="../../js/jquery.Rut.js" type="text/javascript"></script>
  <script type="text/javascript" src="../../../../funciones/scripts.js"></script>
  <script type="text/javascript">

 //He aqui la magia de AJAX gracias al Framework JQuery!
  $(document).ready(function(){
	  //programamos el vento click del boton enviar del formulario
	  $("#enviar").click(function() {
		  
		  //Variables del formulario
		  var cod=frm_add.codigo.value;
		  var fam=frm_add.familia.value;
		 
		   
		  //preguntamos si no hay campos vacios
		  if(cod!="" && fam!="" )
		  {
		      //Enviamos mediante el metodo post de JQuery $.post("archivo.php",{parametros}, callback);
		      $.post("add_reg.php", {enviar:frm_add.enviar.value, codigo:cod, familia:fam }, function(output){
			    //El parametro output, recibe como salida lo generado por el script php
				alert(output);
				//con esta linea limpiamos el formulario
				document.frm_add.reset();
		      });
		  }
		  else
		  {
			  alert("Campos obligatorios (*) vacios!");
		  }
	  });
  });
</script>
</head>
<body>
<div id="art-main">

<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>Informe de inventario por familia </h3>
     <p >
      <?php
					  	$query_familias="SELECT * FROM grupos  ORDER BY nombre_grupo ASC";
						$res_familias=mysql_query($query_familias);
						$contador=0;
						?>
      <form id="formulario" name="formulario" method="post" action="verifica.php" >
        <input type="hidden" id="sucu" name="sucu" value="<? echo $sucu ?>">
				<fieldset><legend>Verificar registro </legend>
                <table class="fuente8" width="98%" cellspacing=0 cellpadding=3 border=0>					
					 
					  <tr>
					    <td width="14%">FAMILIA: </td>
					    <td width="86%"><select id="AcboFamilias" name="AcboFamilias" class="comboGrande">
					      <option value="<? echo $cd_familia ?>">
					        <?  echo $cd_nombre?>
					        </option>
					      <option value="0">Todos los articulos</option>
					      <?php
								while ($contador < mysql_num_rows($res_familias)) { ?>
					      <option value="<?php echo mysql_result($res_familias,$contador,"idgrupos")?>">
						  <?php echo mysql_result($res_familias,$contador,"nombre_grupo")?></option>
					      <? $contador++;
								} ?>
					      </select></td>
					   
					    </tr>
					  <tr>
					    <td>FORMATO: </td>
					    <td><select id="tipo" name="tipo" class="comboMedio">
					      <option value="0"></option>
					      <option value="1">MICROSOFT EXCEL(.XLS)</option>
					      </select></td>
					    </tr>
					  <tr>
					    <td colspan="2"><input type="hidden" value="1" id="consignacion" name="consignacion" class="comboPequeno">				        </td>
					    </tr>
					  <tr>
					    <td colspan="2" align="right">
                        <input name="submit" width="69" type="submit" class="art-button"id="submit" value="Buscar"> 
                        <input name="button" type="reset" class="art-button"  id="button" value="Limpiar"></td>
				      </tr>
					</table>
		</fieldset>
	
      </form></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>
                </div>
            </div><footer class="art-footer">

<p>Copyright © 2015. 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>