Código PHP:
<?php
class Access {
private $Db;
function ConnectDB($Db)
{
$dsn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=".$Db;
$Connection = odbc_connect($dsn,'','');
return $Connection;
}
function Day($Connection, $Date)
{
$SQL = "SELECT qryEventsAccess.iUserNum, qryEventsAccess.dEvent_Date, qryEventsAccess.dEvent_Time, qryEventsAccess.iReader
FROM qryEventsAccess
WHERE qryEventsAccess.dEvent_Date = $Date
ORDER BY qryEvensPanel.iUserNum, qryEvensPanel.dEvent_Date, qryEvensPanel.dEvent_Time;";
$Exec = odbc_exec($Connection, $SQL);
?>
[HTML]
<table style="border-style: solid;">
<tr style="border-style: solid; text-align: center;"><th>Reporte Usuarios</th></tr>
<tr style="border-style: solid;">
<th >Usuario</th>
<th >Dia</th>
<th >Hora</th>
</tr>
[/HTML]
<?php
if ($Exec)
{
while (odbc_fetch_row($Exec))
{
$Result = odbc_result($Exec, "iUserNum");
$Result1 = odbc_result($Exec, "dEvent_Date");
$Result2 = odbc_result($Exec, "dEvent_Time");
$Time = date_create($Result2);
$Date = date_create($Result1);
echo '
<tr style="border-style: solid; text-align: center;">
<td>'.$Result.'<br></td>
<td>'.date_format($Date, 'Y-m-d').'<br></td>
<td>'.date_format($Time, 'g:i A').'<br></td></tr>';
}
}
else
{
echo "No hay datos";
}
}
}
?>