<?php
  $page_title = 'Agregar Produccion';
  require_once('../../includes/load.php');
  // Checkin What level user has permission to view this page
  page_require_level(5);
?>
<?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> Produccion</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> Produccion</span>
                  </strong> 
                </div>

                 <div class="card-body">
		              <div class="form-group">
		                <div class="row">
		                  	<div class="col-md-4">
		                      <label for="maquinaria" class="control-label">Maquinaria:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <select id="maquinaria" name="maquinaria" class="form-control">
		                                <?php   
																		  $consulta = $db->query("SELECT * FROM activo");
																		    while ($row = $db->fetch_assoc($consulta)) {   
																		      $id = $row['id']; 
																		      $NombreActivo = $row['NombreActivo'];    
																		      echo "<option value='$id'>$NombreActivo</option>";
																		    }
																		?>
		                              </select> 
		                                                                        
		                        </div>               
		                    </div>
		                    <div class="col-md-4">
		                      <label for="implemento" class="control-label">Implemento:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <select id="implemento" name="implemento" class="form-control">
		                                <?php   
																		  $consulta = $db->query("SELECT * FROM implemento");
																		    while ($row = $db->fetch_assoc($consulta)) {   
																		      $id = $row['id']; 
																		      $NombreImplemento = $row['NombreImplemento'];    
																		      echo "<option value='$id'>$NombreImplemento</option>";
																		    }
																		?>
		                              </select>                                             
		                        </div>               
		                    </div>
		                    <div class="col-md-4">
		                      <label for="servicio" class="control-label">Servicio:</label>
		                      <div class="input-group">   
		                              <select id="servicio" name="servicio" class="form-control">
		                                <?php   
																		  $consulta = $db->query("SELECT * FROM tiposerviciomi");
																		    while ($row = $db->fetch_assoc($consulta)) {   
																		      $id = $row['IdTipoServicioMI']; 
																		      $NombreTipoServicioMI = $row['NombreTipoServicioMI'];    
																		      echo "<option value='$id'>$NombreTipoServicioMI</option>";
																		    }
																		?>
		                              </select>                            
		                        </div>               
		                    </div>
		                </div>
		               </div>

		               <div class="form-group">
		                <div class="row">
		                  	<div class="col-md-4">
		                      <label for="operacion" class="control-label">Operación:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                             <input type="text" id="operacion" name="operacion" class="form-control" required>		                                                                        
		                        </div>               
		                    </div>
		                    <div class="col-md-4">
		                      <label for="produccion" class="control-label">Produccion:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                             <input type="date" id="produccion" name="produccion" class="form-control" required>                                            
		                        </div>               
		                    </div>
		                    <div class="col-md-4">
		                      <label for="horas_ope" class="control-label">Horas Ope:</label>
		                      <div class="input-group">  
		                              <input type="text" id="horas_ope" name="horas_ope" class="form-control" value="0">                            
		                        </div>               
		                    </div>
		                </div>
		              </div>


		              <div class="form-group">
		                <div class="row">
		                  	<div class="col-md-4">
		                      <label for="horas_e_ope" class="control-label">Hrs Extras Ope:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <input type="text" id="horas_e_ope" name="horas_e_ope" class="form-control" value="0">	                                                                        
		                        </div>               
		                    </div>
		                    <div class="col-md-4">
		                      <label for="despacho_gln" class="control-label">Despacho Gln:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <input type="text" id="despacho_gln" name="despacho_gln" class="form-control" value="0">                                      
		                        </div>               
		                    </div>
		                    <div class="col-md-4">
		                      <label for="h_inicial" class="control-label">H. Inicial:</label>
		                      <div class="input-group">   
		                              <input type="text" id="h_inicial" name="h_inicial" class="form-control" value="0">                             
		                        </div>               
		                    </div>
		                </div>
		              </div>
              
		              <div class="form-group">
		                <div class="row">
		                  	<div class="col-md-4">
		                      <label for="h_final" class="control-label">H.Final:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <input type="text" id="h_final" name="h_final" class="form-control" value="0">                                           
		                      </div>               
		                    </div>
		                    <div class="col-md-4">
		                      <label for="responsable" class="control-label">Responsable:</label>
		                      <div class="input-group">   
		                              <select id="responsable" name="responsable" class="form-control">
		                                <?php   
																		  $consulta = $db->query("SELECT * FROM responsableactivo");
																		    while ($row = $db->fetch_assoc($consulta)) {   
																		      $id = $row['id']; 
																		      $NombreResponsableActivo = $row['NombreResponsableActivo'];
																		      $ApellidoResponsableActivo = $row['ApellidoResponsableActivo'];    
																		      echo "<option value='$id'>$NombreResponsableActivo $ApellidoResponsableActivo</option>";
																		    }
																		?>
		                              </select>                              
		                        </div>               
		                    </div>
		                    <div class="col-md-4">
		                      <label for="observacion" class="control-label">Observacion:</label>
		                      <div class="input-group">   
		                              <input type="text" id="observacion" name="observacion" 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_maquinaria.php" class="btn btn-primary"><i class="glyphicon glyphicon-th-list"></i>Listado</a>
	                       </div>
          			  </div>
	          	    </div>
	             </div>
	           </div>   
            </div>
          </div>           
        </form>
        <!-- INICIO SECCION DE LA TABLA DE OPERACION-->
        <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> Operacion</span>
				         </strong>
				        </div> 
				          <div class="panel-body">
				            <div class="col-md-12">
				            	<table class="table table-bordered table-striped" id="mytable">
								        <thead>
								          <tr>
								            <th style="text-align: center; padding-right: 10px;">Operacion</th>
								            <th style="text-align: center; padding-right: 10px;">Produccion</th>
								            <th style="text-align: center; padding-right: 10px;">Registro</th>
								            <th style="text-align: center; padding-right: 10px;">Campaña</th>
								            <th style="text-align: center; padding-right: 10px;">Reuso</th>
								            <th style="text-align: center; padding-right: 10px;">Granja</th>
								            <th style="text-align: center; padding-right: 10px;">Destino</th>
								            <th style="text-align: center; padding-right: 10px;">Servicio</th>
								            <th style="text-align: center; padding-right: 10px;">Estado</th>
								            <th style="text-align: center; padding-right: 10px;">Opcion</th>
								          </tr>
								        </thead>
								     </table>   
					          </div>
					        </div>          
				     </div>
				    </div>
        </div>
        <!-- FIN SECCION DE LA TABLA DE OPERACION-->
     </div>
    </div>
  </div>
</div>
</div>


 

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


