<!DOCTYPE HTML>
<!--
	Desarrollado por: Eduardo Alfonso Torres Luna
-->
<html>
	<head>
		<title>SISTEMA DE CONTROL COMERCIAL</title>
		<meta charset="iso-8859-1" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
		<link rel="stylesheet" href="assets/css/main.css" />
		<!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
	    <style type="text/css">
<!--
.Estilo16 {font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
}
-->
        </style>
</head>
	<body>
	
		<div id="aula_virtual" style=" height:20px; ">  
		  
		</div>		
			
		<div id="page-wrapper">
			<div id="header-wrapper">
				<div class="container">
					<div class="row">
						<div class="12u">

							<?php
							include("cabecera.php");
							
							?>

						</div>
					</div>
				</div>
			</div>
			
			<?php
			include("conexion.php");			
			
			@$xaccion2=$_REQUEST['xaccion2'];
			@$xcriterio=$_REQUEST['xcriterio'];												
			
			
			?>
			
			
			
			
			<div id="main">
				<div class="container">
					<div class="row main-row">
					
					
					
						<div class="4u 12u(mobile)">

							<section>
								<h2>Registro de veh&iacute;culos</h2>
								<ul >
									
											<br>
										  <li>
												<a href="vehiculos.php"  onClick="accion_vehiculos('adicionar'); return false;"><img src="images/icono_nuevo.png" alt="Adicionar nuevo" width="20" class="left" /></a>
												
												<a href="vehiculos.php" onClick="accion_vehiculos('adicionar'); return false;">
												<h4>Adicionar nuevo veh&iacute;culo</h4>
												</a>

										  </li>

										  <li style="margin-top:20px;">
												
												
												<form name="form_buscar" id="form_buscar" method="post" action="vehiculos.php">
												
												<div align="left" style="float:left">
								    			Buscar
												</div>														
												
												<div align="left" style="float:left">
								    			<input class="input_texto_buscar" id="xcriterio" type="text" name="xcriterio" value="<?php echo $xcriterio; ?>" >
												<input name="xaccion2"  type="hidden" class="input_texto" id="xaccion2" value="buscar">
												</div>

												<div align="left" style="float:left; margin-left:10px;">
								    			<a href="#"  onClick="buscar(); return false;"><img src="images/buscar.png" alt="Buscar" width="25" class="left" /></a>
												</div>
												
												</form>

										  </li>

											
									
								</ul>
							</section>
							
							<section>
								<h2>Listado de veh&iacute;culos</h2>							
							</section>
							
							<section>
								<div>
									<div class="row">
										<div class="6u 12u(mobile)" style="width:100%;">
											<ul class="link-list">
											
											
											


                                                <table width="344" border="1" cellpadding="1" cellspacing="1" >
                                                  <?php
								
								//CONSULTA SQL PARA DESPLEGAR EL LISTADO DE CATEGORIAS
								if(isset($xaccion2)){																												
																						
									$result1=mysqli_query($conexion,"SELECT * FROM vehiculos v 
																	WHERE veh_placa LIKE '%$xcriterio%' OR 
																	veh_marca LIKE '%$xcriterio%' OR 
																	veh_modelo LIKE '%$xcriterio%' OR 
																	veh_ano LIKE '%$xcriterio%' OR 
																	veh_color LIKE '%$xcriterio%' 
																	ORDER BY veh_placa;");																				
																						
								}else{
								
									$result1=mysqli_query($conexion,"SELECT * FROM vehiculos v ORDER BY veh_placa;");
									
								}

								$nn=0;
								while($row1=mysqli_fetch_array($result1)){
									$nn=$nn+1;
								
								?>
                                                  <tr id="tr<?php echo $nn;?>" style=" cursor:default; background-color:#FFFFFF;"  onmouseover="resaltar('#F9F38A',this.id);" onMouseOut="resaltar('#FFFFFF',this.id);" >
                                                    <td width="22" class="Estilo16"><div align="center"><?php echo $nn; ?></div></td>
                                                    <td width="27" class="Estilo16"><div align="center">
																																							
													<a href="#" onClick="accion_vehiculos('modificar',
																								<?php echo $row1['veh_codi']; ?>,
																								'<?php echo $row1['veh_placa']; ?>',
																								'<?php echo $row1['veh_marca']; ?>',
																								'<?php echo $row1['veh_modelo']; ?>',
																								'<?php echo $row1['veh_ano']; ?>',
																								'<?php echo $row1['veh_color']; ?>',
																								'<?php echo $row1['veh_peso_bruto']; ?>',
																								'<?php echo $row1['veh_peso_neto']; ?>',
																								'<?php echo $row1['veh_carga_util']; ?>',
																								'<?php echo $row1['veh_largo']; ?>',
																								'<?php echo $row1['veh_alto']; ?>',
																								'<?php echo $row1['veh_ancho']; ?>',
																								'<?php echo $row1['traemp_codi_fk']; ?>',
																								'<?php echo $row1['veh_certificado']; ?>'																																																																																																																																																																								
													); return false;">
													
													
													<img src="images/icono_editar.png" alt="Modificar" width="20" /></a></div></td>
                                                    <td width="27" class="Estilo16"><div align="center"><a href="#" 
													onClick="accion_vehiculos('eliminar',
																								<?php echo $row1['veh_codi']; ?>,
																								'<?php echo $row1['veh_placa']; ?>',
																								'<?php echo $row1['veh_marca']; ?>',
																								'<?php echo $row1['veh_modelo']; ?>',
																								'<?php echo $row1['veh_ano']; ?>',
																								'<?php echo $row1['veh_color']; ?>',
																								'<?php echo $row1['veh_peso_bruto']; ?>',
																								'<?php echo $row1['veh_peso_neto']; ?>',
																								'<?php echo $row1['veh_carga_util']; ?>',
																								'<?php echo $row1['veh_largo']; ?>',
																								'<?php echo $row1['veh_alto']; ?>',
																								'<?php echo $row1['veh_ancho']; ?>',
																								'<?php echo $row1['traemp_codi_fk']; ?>',
																								'<?php echo $row1['veh_certificado']; ?>'																																																																																																																																																																																																																						
													); return false;">													
													
													<img src="images/icono_eliminar.png" alt="Eliminar" width="20" /></a></div></td>
                                                    <td width="19" valign="top" class="Estilo16"><div align="center"><span style="float:left; padding:0px;">
                                                      <input name="checkbox" type="checkbox" id="chk_<?php echo $row1['veh_codi']; ?>" onClick="cambiar_estado_vehiculos(<?php echo $row1['veh_codi']; ?>, this.checked);" value="checkbox"  <?php if($row1['veh_estado']==1){ ?> checked <?php }	 ?> >
                                                    </span></div></td>
                                                    <td width="238" valign="middle" class="Estilo16"><div align="left"><?php echo $row1['veh_placa']." (".$row1['veh_marca'].")"; ?></div></td>
                                                  </tr>
                                                  <?
								}
								?>
                                                  <tr  >
                                                    <td width="22" class="Estilo16">&nbsp;</td>
                                                    <td width="27" class="Estilo16">&nbsp;</td>
                                                    <td width="27" class="Estilo16">&nbsp;</td>
                                                    <td class="Estilo16">&nbsp;</td>
                                                    <td class="Estilo16">&nbsp;</td>
                                                  </tr>
                                              </table>
											
											</ul>
									  </div>
										
									</div>
								</div>
							</section>

						</div>
					
					
					<a name="enfoque1"></a>
					
						<div class="8u 12u(mobile)">

							<section class="left-content">
								<h2><div id="titulo_formulario" align="left">Nuevo vehiculo</div>
								</h2>
								<div align="justify">
								
								  <form name="form_procesos" id="form_procesos" method="post" target="frame_procesos" action="procesos/vehiculos.php">
								  <br>
								  
								  
								  <div class="input_texto" align="left">
								   Empresa de transportes *
								  </div>
								  <div align="left">
								    <select style="padding:3px; width:100%; letter-spacing:-1px;" onChange="hay_cambios_pedidos();"  name="xempresa_transporte" id="xempresa_transporte" requiered >

										<option value=""></option>
                                      <?
									
									
									$r_empresa_transportes=mysqli_query($conexion,"SELECT * FROM transportistas_empresa t ORDER BY traemp_nombre;");																					
									
									while($row_empresa_transportes=mysqli_fetch_array($r_empresa_transportes)){
									
									?>
                                      <option value="<?php echo $row_empresa_transportes['traemp_codi']; ?>"><?php echo $row_empresa_transportes['traemp_nombre']; ?></option>
                                      <?
									}
									?>
                                    </select>								    									
									
								  </div>
								  
								  
								  
								  <div class="input_texto" align="left">
								  N&uacute;mero de Placa*
								  </div>
								  <div align="left">
								    <input class="input_texto" onKeyPress="return comillas(event)"  id="xplaca" type="text" name="xplaca" required >
								  </div>


								  <div class="input_texto" align="left">
								  Certificado de inscripci&oacute;n
								  </div>
								  <div align="left">
								    <input class="input_texto" onKeyPress="return comillas(event)"  id="xcertificado_inscripcion" type="text" name="xcertificado_inscripcion" required >
								  </div>


								  <div class="input_texto"  align="left">
								  Marca </div>
								  <div align="left">
								    <input class="input_texto" onKeyPress="return comillas(event)"  id="xmarca" type="text" name="xmarca">
								  </div>


								  <div class="input_texto"  align="left">
								  Modelo </div>
								  <div align="left">
								    <input class="input_texto" onKeyPress="return comillas(event)"  id="xmodelo" type="text" name="xmodelo">
								  </div>


								  <div class="input_texto"  align="left">
								  A&ntilde;o </div>
								  <div align="left">
								    <input class="input_texto" onKeyPress="return comillas(event)"  id="xano" type="text" name="xano">
								  </div>


								  <div class="input_texto"  align="left">
								  Color </div>
								  <div align="left">
								    <input class="input_texto" onKeyPress="return comillas(event)"  id="xcolor" type="text" name="xcolor">
								  </div>


								  <div class="input_texto"  align="left">
								  Peso Bruto (Kg) </div>
								  <div align="left">
								    <input class="input_texto" onKeyPress="return comillas(event)"  id="xpeso_bruto" type="text" name="xpeso_bruto">
								  </div>


								  <div class="input_texto"  align="left">
								  Peso Neto (Kg) </div>
								  <div align="left">
								    <input class="input_texto" onKeyPress="return comillas(event)"  id="xpeso_neto" type="text" name="xpeso_neto">
								  </div>


								  <div class="input_texto"  align="left">
								  Carga util (Kg) </div>
								  <div align="left">
								    <input class="input_texto" onKeyPress="return comillas(event)"  id="xcarga_util" type="text" name="xcarga_util">
								  </div>


								  <div class="input_texto"  align="left">
								  Largo (m) </div>
								  <div align="left">
								    <input class="input_texto" onKeyPress="return comillas(event)"  id="xlargo" type="text" name="xlargo">
								  </div>

								  <div class="input_texto"  align="left">
								  Alto (m) </div>
								  <div align="left">
								    <input class="input_texto" onKeyPress="return comillas(event)"  id="xalto" type="text" name="xalto">
								  </div>

								  <div class="input_texto"  align="left">
								  Ancho (m) </div>
								  <div align="left">
								    <input class="input_texto" onKeyPress="return comillas(event)"  id="xancho" type="text" name="xancho">
								  </div>



								  <div id="d_eliminar" class="input_texto"  align="left" style=" display:none; color:#FF0000; font-size:20px; margin-top:20px;">
								  Si está seguro que quiere eliminar el registro del vehículo, presione el botón Aceptar.
								  </div>

								  <div class="input_texto" style="margin-top:10px;"  align="left">
								    <input style="padding:5px;" type="button" onClick="enviar_formulario_vehiculos();" name="Submit" value="Aceptar">
									<input style="padding:5px;" type="button" onClick="accion_vehiculos('adicionar');" name="cancelar" value="Cancelar">
								  (*) dato requerido 
								  <input name="xaccion"  type="hidden" class="input_texto" id="xaccion" value="adicionar">
								  
								  <input class="input_texto" id="xid"   type="hidden" name="xid">	
								  
								  </div>

								  <div align="left">
								    <iframe id="frame_procesos" name="frame_procesos" title="fotos" width="10" height="10" frameborder="0" scrolling="No" marginheight="0" marginwidth="0" allowtransparency="AllowTransparency"></iframe>
								  </div>
								  
                                  </form>
								</div>
								
							</section>

						</div>


					</div>
				</div>
			</div>

			<?
			include("pie.php");
			
			?>				
			
		</div>

		<!-- Scripts -->
			<script src="assets/js/jquery.min.js"></script>
			<script src="assets/js/skel.min.js"></script>
			<script src="assets/js/skel-viewport.min.js"></script>
			<script src="assets/js/util.js"></script>
			<!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
			<script src="assets/js/main.js"></script>
			<script src="assets/js/funciones.js"></script>
			
			<script language="javascript">
			//function accion_familias2(xaccion,xid,xtitu,xabrev){
			//	alert("es es: "+xaccion+xid+xtitu+xabrev);
			//}	
			document.getElementById('xcriterio').focus();
			
			
			</script>
			
	</body>
</html>