<!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" lang="es" xml:lang="es">
<head>
<meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 charset=windows-1252>
<META NAME="language" CONTENT="ES">
<title>Reporte Online</title>
<link href="../calendario/css/calendario.css" type="text/css" rel="stylesheet">
<script src="../calendario/js/calendar.js" type="text/javascript"></script>
<script src="../calendario/js/calendar-es.js" type="text/javascript"></script>
<script src="../calendario/js/calendar-setup.js" type="text/javascript"></script>
<style type="text/css">
body {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 12px;
color: #333;
text-decoration: none;
line-height: 16px;
background-color: #FFFFFF;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
form {
line-height: 30px;
}
.confirm {
color: #036;
font-style: italic;
}
.style3 {color: #000000}
</style>
</head>
<body>
<div class="AreaDesarrollo">
<center><div class="a"></div> </center>
<center>
<?php
/// set fechas ////
$fechaini = "";
$fechafin = "";
if ($_GET['txtFecha1'] == ""){
$fechaini = date("d/m/Y");
}else{
$fechaini = $_GET['txtFecha1'];
}
if ($_GET['txtFecha2'] == ""){
$fechafin = date("d/m/Y");
}else{
$fechafin = $_GET['txtFecha2'];
}
//////////////////
?>
<form method="GET" name="formulario" action="<?=$_SERVER['PHP_SELF']?>">
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="3" bgcolor="#FFFFFF">
<tr>
<td width="875" colspan="10" style="font-family:'Arial Narrow';font-size:12px"><img src="../images/cab_visitas.jpg" width="900" height="63" /></td>
</tr>
<tr>
<td colspan="10" align="center" style="color:#ffffff"> </td>
</tr>
<tr>
<td colspan="10" align="center" style="color:#ffffff"><div align="left">Fecha Inicio :
<input name="txtFecha1" type="text" id="txtFecha1" value="<?php echo $fechaini; ?>" readonly="true" />
<img src="../calendario/ima/calendario.png" width="16" height="16" border="0" title="Fecha Inicial" id="lanzador" />
<script type="text/javascript"> Calendar.setup({ inputField:"txtFecha1",ifFormat:"%d/%m/%Y",button:"lanzador"}); </script>
Fecha Fin:
<input name="txtFecha2" type="text" id="txtFecha2" value="<?php echo $fechafin; ?>" readonly="true" />
<img src="../calendario/ima/calendario.png" width="16" height="16" border="0" title="Fecha Inicial" id="lanzador2" />
<script type="text/javascript"> Calendar.setup({ inputField:"txtFecha2",ifFormat:"%d/%m/%Y",button:"lanzador2"}); </script>
<input type="submit" class="FormSubmitReg" name="buscar" value="Buscar" />
<input type="button" class="FormSubmitReg" name="buscar2" value="Regresar" onclick="location.href='../index.php'" />
</div></td>
</tr>
<tr>
<td colspan="10" align="center" style="color:#ffffff">
<?php
require_once("../conexion/conexion.php");
$strSQL="SP_REPORTE_ONLINE '$fechaini', '$fechafin'";
///////////////////////////////
$objQuery = mssql_query($strSQL) or die ("Error Query [".$strSQL."]");
$Num_Rows = mssql_num_rows($objQuery);
$Per_Page = 10; // Per Page
$Page = $_GET["Page"];
if(!$_GET["Page"])
{
$Page=1;
}
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows<=$Per_Page)
{
$Num_Pages =1;
}
else if(($Num_Rows % $Per_Page)==0)
{
$Num_Pages =($Num_Rows/$Per_Page) ;
}
else
{
$Num_Pages =($Num_Rows/$Per_Page)+1;
$Num_Pages = (int)$Num_Pages;
}
$Page_End = $Per_Page * $Page;
IF ($Page_End > $Num_Rows)
{
$Page_End = $Num_Rows;
}
///////////////////////////////
//while($f=mssql_fetch_array($re)){
for($i=$Page_Start;$i<$Page_End;$i++)
{
?>
<p></p>
<p> </p>
<center>
<table width="101%" height="30" border="1" align="center" cellpadding="3" cellspacing="0">
<tr bgcolor="#CCCCCC">
<th width="9%"><div align="left"><span class="style3">Vistante</span></div></th>
<th width="9%"><span class="style3">Documento</span></th>
<th width="11%"><span class="style3">Remitente</span></th>
<th width="11%"><span class="style3">Motivo</span></th>
<th width="10%"><span class="style3">Sede</span></th>
<th width="10%"><span class="style3">Oficina</span></th>
<th width="10%"><span class="style3">Empleado</span></th>
<th width="10%"><span class="style3">Lugar reunión </span></th>
<th width="10%"><span class="style3">Fecha Ingreso </span></th>
<th width="10%"><span class="style3">Fecha Salida </span></th>
</tr>
<?
for($i=$Page_Start;$i<$Page_End;$i++)
{
if ($color == "#e8f3ff"){
$color = "#FFFFFF";
}else{
$color = "#e8f3ff";
}
if ($color == ""){
$color = "#FFFFFF";
}
?>
<tr bgcolor="<?=$color?>" onMouseOver="this.style.backgroundColor='#BFDEFF';" onMouseOut="this.style.backgroundColor='<?=$color?>'">
<td><span class="style3">
<?=mssql_result($objQuery,$i,"Visitante");?>
</span></td>
<td><span class="style3">
<?=mssql_result($objQuery,$i,"Documento");?>
</span></td>
<td><span class="style3">
<?=mssql_result($objQuery,$i,"remitente");?>
</span></td>
<td><span class="style3">
<?=mssql_result($objQuery,$i,"nombotivo");?>
</span></td>
<td><span class="style3">
<?=mssql_result($objQuery,$i,"nomsede");?>
</span></td>
<td><span class="style3">
<?=mssql_result($objQuery,$i,"nomoficina");?>
</span></td>
<td><span class="style3">
<?=mssql_result($objQuery,$i,"nomempleado");?>
</span></td>
<td><span class="style3">
<?=mssql_result($objQuery,$i,"nomreunion");?>
</span></td>
<td><span class="style3">
<?=mssql_result($objQuery,$i,"fingreso");?>
</span></td>
<td><span class="style3">
<?=mssql_result($objQuery,$i,"hsalida");?>
</span></td>
</tr>
<?
}
?>
</table>
</center>
<?php }?>
<p></p>
<span class="style3"><br />
Total:
<?= $Num_Rows;?>
,
<?=$Num_Pages;?>
Paginás :
<?
if($Prev_Page)
{
echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Atras</a> ";
}
for($i=1; $i<=$Num_Pages; $i++){
if($i != $Page)
{
echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]";
}
else
{
echo "<b> $i </b>";
}
}
if($Page!=$Num_Pages)
{
echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Adelante>></a> ";
}
mssql_close($cnx); ?>
</span></td>
</tr>
</table>
<div>
</form>
</body>
</html>