<?php
//echo " <div >
// <a class='button' href='ex.html' onclick='this.blur();' title='Switch to Table view' ><span><b>Tables</b></span></a>
// <a class='button' href='ex.html' onclick='this.blur();' title='Switch to Report view'><span><b>Reports</b></span></a>
// </div>
// <br /><br />
// ";
echo "<div><b>Tables</b> <a href='index.php?navView=Report'>(<u>show reports</u>)</a></div>";
//Get list of tables
$tbl_result = mysql_query("SHOW TABLE STATUS FROM $database");
//List tables
if (!$tbl_result) {
echo "No tables found.\n";
}
else {
while ($array = mysql_fetch_array($tbl_result)) {
$tblNm = $array['Name'];
if(!isset($exclude[$tblNm])){
$rowCount = number_format($array['Rows'],0);
$comment = $array['Comment'];
if($tbl != $tblNm){
echo "<a href=\"?tbl=".$tblNm."\" title=\"".$comment." ".$rowCount." records\">
<img src=\"table.jpg\" style=\"border: none;\" /> ".$tblNm."</a><br /> \n";
}
else {
echo "<a href=\"?tbl=".$tblNm."\" title=\"".$comment." ".$rowCount." records\">
<img src=\"table.jpg\" style=\"border: none;\" /> <b>".$tblNm."</b></a><br /> \n";
if($viewFields == "Y"){
$fields = mysql_query("SHOW COLUMNS FROM ".$tbl);
while ($array = mysql_fetch_array($fields)) {
$fld = $array['Field'];
echo " <img src=\"fields.png\" style=\"margin: 0; border: none;\" /> <span><small style='color: blue;'>".$fld."</small></span><br/>";
}
}
}
}
}
}
?>