<?php
  $page_title = 'Agregar Producto';
  require_once('../../includes/load.php');
  // Checkin What level user has permission to view this page
  page_require_level(4);
?>
<?php include_once('../../layouts/header.php'); ?>
<div class="row">
  <div class="col-md-12">
    <?php echo display_msg($msg); ?>
  </div>
</div>
  <div class="row">
  <div class="col-md-16">
      <div class="panel panel-default">
        <div class="panel-heading">
          <strong>
            <span class="glyphicon glyphicon-plus"></span>
            <span> Producto</span>
         </strong>
        </div> 
 <!-- FORMULARIO PARA GUARDAR EL PROGRAMA-->
        <form  enctype="multipart/form-data" autocomplete="off" id="form" onSubmit="validar()">
          <div class="panel-body">
            <div class="col-md-12">
        		<div class="card-header">
                  <strong>
                     <span> Producto</span>
                  </strong> 
                </div>

                 <div class="card-body">
		              <div class="form-group">
		                <div class="row">		                  	
		                    <div class="col-md-4">
		                      <label for="nombre" class="control-label">Nombre:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <input class="form-control" id="nombre" name="nombre">                                            
		                      </div>               
		                    </div>
		                    <div class="col-md-4">
		                      <label for="descripcion" class="control-label">Descripcion:</label>
		                      <div class="input-group">   
		                              <input class="form-control" id="descripcion" name="descripcion">                             
		                        </div>               
		                    </div>
		                    <div class="col-md-4">
		                      <label for="categoria" class="control-label">Categoria:</label>
		                      <div class="input-group">   
		                             <select id="categoria" name="categoria" class="form-control">
		                                <?php   
										  $consulta = $db->query("SELECT * FROM categoria");
										    while ($row = $db->fetch_assoc($consulta)) {   
										      $id = $row['IdCategoria']; 
										      $NombreCategoria = $row['NombreCategoria'];    
										      echo "<option value='$id'>$NombreCategoria</option>";
										    }
										?>
		                              </select>                             
		                        </div>               
		                    </div>
		                </div>
		               </div>

		               <div class="form-group">
		                <div class="row">
		                	<div class="col-md-4">
		                      <label for="marca" class="control-label">Marca:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <input type="text" id="marca" name="marca" class="form-control">	                                                                        
		                        </div>               
		                    </div>
		                    <div class="col-md-4">
		                      <label for="modelo" class="control-label">Modelo:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <input type="text" id="modelo" name="modelo" class="form-control">                                      
		                        </div>               
		                    </div>
		                    <div class="col-md-4">
		                      <label for="und_medida" class="control-label">Unidad Medida:</label>
		                      <div class="input-group">   
	                              <select id="und_medida" name="und_medida" class="form-control">
	                              	<option>Unidad</option>
	                              	<option>Kilo</option>
	                              	<option>Metro</option>
	                              	<option>Centimetro</option>
	                              	<option>Juego</option>
	                              	<option>Par</option>
	                              	<option>Galon</option>
	                              	<option>Litro</option>
	                              	<option>Kit</option>
	                              </select>                              
		                        </div>               
		                    </div>	
		                </div>
		              </div>
		              <div class="form-group">
		                <div class="row">
		                	<div class="col-md-4">
		                      <label for="estado" class="control-label">Estado:</label>
		                      <div class="input-group">   
	                              <select id="estado" name="estado" class="form-control">
	                              	<option>Activo</option>
	                              	<option>Inactivo</option>
	                              </select>                              
		                        </div>               
		                    </div>
		                    <div class="col-md-4">
		                      <label for="precio" class="control-label">Precio:</label>
		                      <div class="input-group">   
		                              <input type="text" id="precio" name="precio" class="form-control">                             
		                        </div>               
		                    </div>
		                    <div class="col-md-4">
		                      <label for="cod_sap" class="control-label">Codigo Sap:</label>
		                      <div class="input-group">  
		                              <input type="text" id="cod_sap" name="cod_sap" class="form-control">                            
		                        </div>               
		                    </div>
		                </div>
		              </div>
              
		              <div class="form-group">
		                <div class="row">
		                	<div class="col-md-4">
		                      <label for="contacto" class="control-label">Contacto:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <input type="text" id="contacto" name="contacto" class="form-control">                                      
		                        </div>               
		                    </div>	                	
		                </div>
		               </div>
			               <div class="text-center">
	                     		 <button type="submit" class="btn btn-success"><i class="glyphicon glyphicon-floppy-disk"></i>Guardar</button>
	                     		  <a href="listado_producto.php" class="btn btn-primary"><i class="glyphicon glyphicon-th-list"></i>Listado</a>
	                       </div>
          			  </div>
	          	    </div>
	             </div>
	           </div>   
            </div>
          </div>           
        </form>
     </div>
    </div>
  </div>
</div>
</div>




<?php include_once('../../layouts/footer.php'); ?>
<script type="text/javascript" src="js/producto.js"></script>


