<!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;
}
.Estilo20 {color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; }
-->
        </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'];												
			@$xop=$_REQUEST['xop'];
			
			
			@$xactivar_fechas=$_REQUEST['xactivar_fechas'];				
			
			@$xfecha_inicio=$_REQUEST['xfecha_inicio'];	
			@$xfecha_fin=$_REQUEST['xfecha_fin'];				
			
			if(!isset($xfecha_inicio)){
			
				$xfecha_inicio = date("Y-m-d");
				$xfecha_fin = date("Y-m-d");
			}
			
			?>
						
			
			<div id="main">
				<div class="container" >
					<div class="row main-row" style="width:100%;">
					
					
					
						<div class="4u 12u(mobile)" style="width:100%;">

						  <section>
								<h2>Listado de proveedores</h2>
								<ul >
									
												

										  <li style="margin-top:20px;">
												
												
												<form name="form_buscar" id="form_buscar" method="post" action="proveedores_lista.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">
												<input name="xop"  type="hidden" id="xop" value="<?php echo $xop; ?>">			
												</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>

							
						  <?
							@$xid=$_REQUEST['xid'];
							@$xaccion2=$_REQUEST['xaccion2'];
							@$xcriterio=$_REQUEST['xcriterio'];				
							
							include("conexion.php");
							
							$nn=0;
							$xtotal_ingreso=0;
							$xtotal_salida=0;												

							?>														
														
							<section>

							  <div style="width:100%;">
									<div class="row pading_top_row " style="width:100%; " >
										<div  style="width:100%;">
										
											<div style=" display:none;">
													<table width="100%" border="1" cellpadding="1" cellspacing="1" bordercolor="#0066CC" bgcolor="#339966">
                                                        <tr>
                                                          <td>&nbsp;</td>
                                                          <td>&nbsp;</td>
                                                          <td>&nbsp;</td>
                                                          <td>&nbsp;</td>
                                                          <td>&nbsp;</td>
                                                          <td>&nbsp;</td>
                                                          <td>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                          <td>&nbsp;</td>
                                                          <td>&nbsp;</td>
                                                          <td>&nbsp;</td>
                                                          <td>&nbsp;</td>
                                                          <td>&nbsp;</td>
                                                          <td>&nbsp;</td>
                                                          <td>&nbsp;</td>
                                                        </tr>
                                              </table>
											</div>
	
										
									  </div>
									</div>
								    <table width="1159" border="1" cellpadding="1" cellspacing="1" >
                                      <tr>
                                        <td width="26" align="center" valign="middle" bgcolor="#A81B00">&nbsp;</td>
                                        <td width="20" height="37" align="center" valign="middle" bgcolor="#A81B00"><div align="center">
                                            <div align="center"><span class="Estilo20">NRO.</span></div>
                                        </div></td>
                                        <td width="158" align="center" valign="middle" bgcolor="#A81B00"><div align="center">
                                            <div align="left"><span class="Estilo20">NOMBRE COMERCIAL </span></div>
                                        </div></td>
                                        <td width="196" align="center" valign="middle" bgcolor="#A81B00"><div align="left"><span class="Estilo20">RAZ&Oacute;N SOCIAL  </span></div></td>
                                        <td width="60" align="center" valign="middle" bgcolor="#A81B00"><div align="left"><span class="Estilo20">RUC</span></div></td>
                                        <td width="99" align="center" valign="middle" bgcolor="#A81B00"><div align="left"><span class="Estilo20">NOMBRE CONTACTO </span></div></td>
                                        <td width="130" align="center" valign="middle" bgcolor="#A81B00"><div align="left"><span class="Estilo20">APELLIDO CONTACTO </span></div></td>
                                        <td width="99" align="center" valign="middle" bgcolor="#A81B00"><div align="left"><span class="Estilo20">E-MAIL</span></div></td>
                                        <td width="83" align="center" valign="middle" bgcolor="#A81B00"><div align="left"><span class="Estilo20">TELEFONO</span></div></td>
                                        <td width="222" align="center" valign="middle" bgcolor="#A81B00"><div align="right"><span class="Estilo20">DIRECCI&Oacute;N</span></div></td>
                                        <td width="8" align="center" valign="middle" bgcolor="#A81B00">&nbsp;</td>
                                      </tr>
                                      <?
												//@$xid=$_REQUEST['xid'];
												//@$xaccion2=$_REQUEST['xaccion2'];
												//@$xcriterio=$_REQUEST['xcriterio'];				
												
												//include("conexion.php");
												
												if(isset($xaccion2)){

													$result1=mysqli_query($conexion,"SELECT * FROM personas p WHERE pertip_codi_fk=3 and (p.per_nombre_comercial LIKE '%$xcriterio%' OR p.per_razon_social LIKE '%$xcriterio%' OR p.per_ruc LIKE '%$xcriterio%' OR p.per_nombre LIKE '%$xcriterio%' OR p.per_apellido LIKE '%$xcriterio%' OR p.per_telefono1 LIKE '%$xcriterio%' OR p.per_direccion1 LIKE '%$xcriterio%' OR p.per_email LIKE '%$xcriterio%') order by per_nombre_comercial;");													
												
												}else{
													
													$result1=mysqli_query($conexion,"SELECT * FROM personas p WHERE pertip_codi_fk=3 order by per_nombre_comercial;");
																										
												}
												
												$nregistros = mysqli_num_rows($result1);
												  
												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 class="Estilo16"><a href="#" onClick="accion_caja('modificar',<?php echo $row1['opecaj_codi']; ?>,'<?php echo $row1['opecaj_fecha']; ?>',<?php echo $row1['per_codi_fk']; ?>,<?php echo $row1['opecajtip_codi_fk']; ?>,'<?php echo addslashes($row1['opecaj_anotaciones']); ?>',<?php echo $row1['opecaj_monto']; ?>); return false;"></a></td>
                                        <td class="Estilo16"><div align="left">
                                            <div align="center"><?php echo $nn; ?></div>
                                        </div></td>
                                        <td class="Estilo16"><div align="left"><?php echo $row1['per_nombre_comercial']; ?></div></td>
                                        <td class="Estilo16"><div align="left"><?php echo $row1['per_razon_social']; ?></div></td>
                                        <td class="Estilo16"><div align="left"><?php echo $row1['per_ruc']; ?></div></td>
                                        <td class="Estilo16"><div align="left"><?php echo $row1['per_nombre']; ?></div></td>
                                        <td class="Estilo16"><div align="left"><?php echo $row1['per_apellido']; ?></div></td>
                                        <td class="Estilo16"><div align="left"><?php echo $row1['per_email']; ?></div></td>
                                        <td class="Estilo16"><div align="left"><?php echo $row1['per_telefono1']; ?></div></td>
                                        <td  class="Estilo16"><div align="left"><?php echo $row1['per_direccion1']; ?></div></td>
                                        <td class="Estilo16">&nbsp;</td>
                                      </tr>
                                      <?
												}
												?>
                                    </table>
								</div>
							</section>
														








						</div>
					
					
					<a name="enfoque1"></a></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>