<?session_start();
require('../valtiempoinact.php');
require("../conectar.php");	
$usuario=$_SESSION["usuario_login"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" href="css/estilos.css" type="text/css">
<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
<style>
.inputsa{height:20px;width:50px;border:solid 1px #A4A4A4;font-family:arial;font-size:14px;}
.inputprov{height:20px;width:140px;border:solid 1px #A4A4A4;font-family:arial;font-size:14px;padding-left:15px;}
.dts{border-collapse:collapse;font-family:arial;font-size:11px;width:100%;}
.categoriaB{position:relative;width:260px;padding-top:3px;padding-bottom:3px;text-align:;font-size:11px;font-family:arial;background:#FFFFFF;border-bottom:1px solid #BDBDBD;border-top:1px solid #BDBDBD;color:#000000;}
.tr1{background:#D8D8D8;}
.tr2{background:#F2F2F2;}
</style>
</head>
<body>
					<?
					 $sqlsol="select CONCAT(nombre,' ',a_pat,' ',a_mat) as nombre,id_empleado,nivel_acceso,area from empleados where usuario='$usuario'";
					 $ejesol=mysql_query($sqlsol);
					 $sol=mysql_fetch_array($ejesol);
					 $nombresol=$sol['nombre'];
					 $idemp=$sol['id_empleado'];
					 $nivel_acceso=$sol['nivel_acceso'];
					 $areasol=$sol['area'];
					 $nomdia=array("DO","LU","MA","MI","JU","VI","SA");
					 $nd=Date("w");
					 $nod=Date("d");
					 $nm=Date("m");
					 $na=Date("y");
					 $h=Date("H");
					 $m=Date("i");
					 $s=Date("s");
					 $al=rand(1,$s);
					 $cod_=$nomdia[$nd].$nod.$nm.$na.$h.$m.$s.$usuario.$al;
					?>


			<div id="consultarreq" class="">
				 <div id="versol">					  
				 <table class="dts">
                         <tr class="categoriaB">
						     <td><b>No</b></td>
			                 <td><b>Fecha solicitud</b></td>
							 <td><b>Solicita</b></td>
							 <td><b>Area</b></td>
				             <td><b>Observacion</b></td>
				             <td><b>Ver</b></td>
							 <td><b>Aprobar</b></td>
					     </tr>
						 <tr>
							<?
							$sqlpre="select DATE_FORMAT(fechasolicitud, '%d/%m/%y') AS fechasolicitud,idempleado,area,observacion,idsolmat,subtotal,iva,total from solicitudmaterial order by idsolmat desc";
							$eje=mysql_query($sqlpre);
							$f=1;
							$d=1;
							while($reg=mysql_fetch_array($eje)){
							 $sqle=mysql_query("select CONCAT(a_pat,' ',a_mat,' ',nombre) AS nom from empleados where id_empleado='$reg[idempleado]'");
							 $emp=mysql_fetch_array($sqle);
							 
							if($f==1){$f=2;}else{$f=1;}
							?>
								<tr class="tr<?echo $f;?>">
								 <td align="center"><?echo $d;?></td>
								 <td align="center"><?echo $reg['fechasolicitud'];?></td>
								 <td><?echo $emp['nom'];?></td>
								 <td><?echo $reg['area'];?></td>
								 <td><?echo $reg['observacion'];?></td>
								 <td align="center"><a href="formatoreq.php?idsolmat=<?echo $reg['idsolmat'];?>&n=1" target="popup" onClick="window.open(this.href, this.target, 'width=1000,height=900'); return false;"><img src="img/buscar.png" height="15" width="15"></a></td>
								 <td align="center">Aprobar</td>	
								 
								</tr>
                          <?$d++;}?>								
                      </table></div>
			</div>
	</body>	