| Current Path : /var/www/html/mmishra/indem/phq/ |
| Current File : /var/www/html/mmishra/indem/phq/trainings.php |
<span style="color:green;font-weight:bolder;background-color:khaki;padding:5px">Training Programmes</span>
<table id='khaki_box' width='100%'><tr><td>
<?php
if (isset($_GET['code'])){
$code = $_GET['code'];
switch($code){
case "conducted":
$filter = "date_to < curdate()";
break;
case "ongoing":
$filter = "date_from < curdate() and date_to > curdate()";
break;
case "tobe":
$filter = "date_from > curdate()";
break;
}
$rs = mysql_query("select * from training where " . $filter, $link);
if ($rs){
echo "<table width='100%'>";
echo "<tr><th>Title</th><th>Schedule</th><th>Resource<br>Person/s</th></tr>";
while ($o = mysql_fetch_object($rs)){
$id = $o->id;
$code = $o->code;
$title = $o->title;
$date_from = $o->date_from;
$date_to = $o->date_to;
if ($date_to == '0000-00-00'){
$schedule = $date_from;
}else{
$schedule = $date_from . " to " . $date_to;
}
$resource_person = $o->resource_person;
echo "<tr><td><a href='training.php?code=$code'>$title</a></td><td>$schedule</td><td>$resource_person</td></tr>";
}
}
echo "</table>";
}
?>
</td></tr></table>