| Current Path : /var/www/html/mmishra/istore/staff/ |
| Current File : /var/www/html/mmishra/istore/staff/projects.php |
<?php
require("../init.inc.php");
//exit on session expiry
if (!$user) header("Location: /");
if ($role == 'guest') {
header("Location: guest/");
}
$tbl = 'projects';
echo $header;
?>
<h2>Projects</h2>
<center>
<?php
$rs = mysql_query("select * from $tbl order by project_code");
if (mysql_num_rows($rs)) {
$colHeads = mysql_num_fields($rs);
echo "<table width='90%' border='1' style='border-collapse: collapse'>
<tr><th>No.</th>";
for ($i=0; $i < $colHeads; $i++) { // Header
$fld = ucwords(str_replace("_", " ", mysql_field_name($rs, $i)));
echo "<th>$fld</th>";
}
echo "</tr>\n";
while ($row = mysql_fetch_row($rs)) { //data
$no++;
echo "<tr><td>$no</td><td>".implode($row,'</td><td>')."</td></tr>\n";
}
echo "</table>";
}
?>
</center>
<?php
echo $footer;
?>