Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/mm/upp/admin/
Upload File :
Current File : /var/www/html/mmishra/mm/upp/admin/trainings.php

<b>Training Programme</b>
<?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='". $_SERVER['PHP_SELF'] ."?url=training&code=$code'>$title</a></td><td>$schedule</td><td>$resource_person</td></tr>";
    }
  }
  echo "</table>";
}
?>