<?php

include_once($_SERVER['DOCUMENT_ROOT'] . '/student_portal/acceptance_pay/database/includes/databaseFunctions.php');

openDatabase();

$db = getDBInstance();
if(!$db)
{
  echo $db->lastErrorMsg();
} 
else 
{
  echo "Opened database successfully<br/>";
}

 $sql =<<<EOF
      SELECT * from COLLEGEPAYLOGS;
EOF;
 $ret = $db->query($sql);
echo "<table border=\"1\" style=\"width:100%\">";
echo   "<tr>";
echo     "<td><b>ID</b></td>";
echo     "<td><b>TXNREF</b></td>";
echo     "<td><b>DATETIME</b></td>"; 
echo     "<td><b>AMOUNT</b></td>";
echo     "<td><b>RESPONSEDESC</b></td>";
echo     "<td><b>RESPONSECODE</b></td>";
echo     "<td><b>CUSTNAME</b></td>";
echo     "<td><b>STUDENTID</b></td>";
echo   "</tr>";
while($row = $ret->fetchArray(SQLITE3_ASSOC) )
{
echo   "<tr>";
echo     "<td>". $row['ID'] . "</td>";
echo     "<td>". $row['TXNREF'] . "</td>";
echo     "<td>". $row['DATETIME'] ."</td>";
echo     "<td>". $row['AMOUNT'] ."</td>"; 
echo     "<td>". $row['RESPONSEDESC'] ."</td>";
echo     "<td>". $row['RESPONSECODE'] ."</td>";
echo     "<td>". $row['CUSTNAME'] ."</td>";
echo     "<td>". $row['STUDENTID'] ."</td>";
echo   "</tr>";
}
echo "</table>"; 
?>
<head>
    <meta charset="UTF-8">
    <title>COLLEGEPAY DEMO APP</title>
</head>
<a href="http://localhost/CollegePayX/">HOME</a>
<a href="http://localhost/CollegePayX/requery.php">Requery</a>