Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/iws8/html/indem/phq/admin/
Upload File :
Current File : /var/www/html/mmishra/iws8/html/indem/phq/admin/training.php

<?
require_once("../header.php");
require_once("../title.php");
?>
<span style="color:green;font-weight:bolder;background-color:khaki;padding:5px">Training Programme</span>
<table id='khaki_box' width='100%'><tr><td>
<table width='100%'>
<?php
$tbl = 'training';
$my_code = $_REQUEST['code'];
if (isset($_POST['submit'])){
  $title = $_POST['title'];
  $date_from = $_POST['date_from'];
  $date_to = $_POST['date_to'];
  $resource_person = $_POST['resource_person'];
  $content = $_POST['content'];
  $participants = $_POST['participants'];
  $date_expiry = $_POST['expiry'];
  if (mysql_num_rows(mysql_query("select * from $tbl where code='$my_code'", $link))){
    //update
    mysql_query("update $tbl set title='$title',date_from='$date_from',date_to='$date_to',resource_person='$resource_person',content='$content',participants='$participants',date_expiry='$date_expiry' where code='$my_code'", $link);
  }else{
    //insert
    mysql_query("insert into $tbl values(NULL,'$code','$title','$date_from','$date_to','$resource_person','$content','$participants','$date_expiry')", $link);
  }

}$rs = mysql_query("select * from $tbl order by date_from", $link);
if (!$rs){
  echo "Training not entered";
  exit;
}
$o = mysql_fetch_object($rs);
$code = $o->code;
$title = $o->title;
$date_from = $o->date_from;
$date_to = $o->date_to;
$resource_person = $o->resource_person;
$content = $o->content;
$participants = $o->participants;
$date_expiry = $o->date_expiry;
?>
<table>
<tr><td>Code</td><td><input type='text' name='code' value='<?=$code?>' size='10'></td></tr>
<tr><td>Title:</td><td><input type='text' name='name' size='30' value='<?=$name?>'></td></tr>
<tr><td>Date from:</td><td><input type='text' name='date_from' size='10' value='<?=$date_from?>'></td></tr>
<tr><td>Date to:</td><td><input type='text' name='date_to' size='10' value='<?=$date_to?>'></td></tr>
<tr><td>Resource Person/s:</td><td><input type='text' name='resource_person' size='30' value='<?=$resource_person?>'></td></tr>
<tr><td>Contents:</td><td><input type='text' name='content' size='30' value='<?=$content?>'></td></tr>
<tr valign='top'><td>Participants:</td><td><textarea name='participants' rows='10' cols='58%'><?=$participants?></textarea></td></tr>
<tr><td>Date Expiry:</td><td><input type='text' name='date_expiry' size='10' value='<?=$date_expiry?>'></td></tr>
<tr><td colspan='2' align='center'><input type='submit' name='submit' value='SAVE'></td></tr>
</table>
<?
require_once("../footer.php");
?>