Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/indem/old/indem/phq/operator/
Upload File :
Current File : /var/www/html/mmishra/indem/old/indem/phq/operator/posting.php

<b>Posting Details</b>
<?php
$tbl = "t_posting";
$my_id = $_REQUEST['id'];
if (!$my_id) $my_id = 0;
$pno = $_REQUEST['pno'];
echo "&nbsp;[<a href='$PHP_SELF?url=$url&pno=$pno&id=0'>New...</a>]";
if ($_POST['submit'] == 'SAVE'){
  $unit = $_REQUEST['unit'];
  $district = $_REQUEST['district'];
  $range = $_REQUEST['range'];
  $zone = $_REQUEST['zone'];
  $date_of_reporting = $_REQUEST['date_of_reporting'];
  $date_of_releaving = $_REQUEST['date_of_releaving'];
  $duration = $_REQUEST['duration'];

  $rs = mysql_query("select * from $tbl where id=$my_id", $link);
  if (mysql_num_rows($rs)){//update
    $sql = "update $tbl set unit='$unit',district='$district',range='$range',zone='$zone',date_of_reporting='$date_of_reporting',date_of_releaving='$date_of_releaving',duration=$duration,date_of_updation=now() where id=$my_id";
  }else{//insert
    $mysql = "insert into $tbl(id,pno,unit,district,range,zone,date_of_reporting,date_of_releaving,duration,date_of_updation) values(NULL,'$pno','$unit','$district','$range','$zone','$date_of_reporting','$date_of_releaving',$duration,now())";
  }
  echo "<div align='right'>" . access_log($url, $sql, $link) . "</div>";
}else{
  //echo "<div align='right'>Posting details...</div>";
}
$rs = mysql_query("select * from $tbl where pno='$pno'", $link);
while ($o = mysql_fetch_object($rs)){
  $id = $o->id;
  if ($id == $my_id){
    $unit = $o->unit;
    $district = $o->district;
    $range = $o->range;
    $zone = $o->zone;
    $date_of_reporting = $o->date_of_reporting;
    $date_of_releaving = $o->date_of_releaving;
    $duration = $o->duration;
    $date_of_updation = $o->date_of_updation;
  }
}
?>
<input type='hidden' name='id' value='<?=$my_id?>'>
<table width='100%'>
<tr><td nowrap colspan='2' align='center'><b>Posting Place</b>
<table width='100%' id='green_box'>
<tr><td>Unit</td><td>District</td><td>Range</td><td>Zone</td></tr>
<tr><td><select id='hindi' name='unit'>
<?php
echo enumerated_data('unit',$unit,$link);
?>
</select></td>
<td><select id='hindi' name='district'>
<?php
echo enumerated_data('district',$district,$link);
?>
</select></td>
<td><select id='hindi' name='range'>
<?php
echo enumerated_data('range',$range,$link);
?>
</select></td>
<td><select id='hindi' name='zone'>
<?php
echo enumerated_data('zone',$zone,$link);
?>
</select></td></tr></table></td></tr>
<tr><td width='20%' nowrap>Date of Reporting</td><td width='80%'><input type='text' name='date_of_reporting' value='<?=$date_of_reporting?>' size='10' maxlength='10'></td></tr>
<tr><td>Date of Releaving</td><td><input type='text' name='date_of_releaving' value='<?=$date_of_releaving?>' size='10' maxlength='10'></td></tr>
<tr><td>Duration</td><td><input type='text' name='duration' value='<?=$duration?>' size='10' maxlength='3'> Days</td></tr>
</table>
<input type='submit' name='submit' value='SAVE'> <input type='reset' value='RESET'> Last updated: <?=$date_of_updation?>

<table width='100%'>
<tr><th>Unit</th><th>District</th><th>Range</th><th>Zone</th><th>Joining</th><th>Releaving</th><th>Duration</th></tr>
<?php
$rs = mysql_query("select * from $tbl where pno='$pno'", $link);
while ($o = mysql_fetch_object($rs)){
  echo "<tr><td id='hindi'>$o->unit</td><td id='hindi'>$o->district</td><td id='hindi'>$o->range</td><td id='hindi'>$o->zone</td>";
  echo "<td><a href='$PHP_SELF?url=$url&pno=$pno&id=$o->id'>$o->date_of_reporting</a></td>";
  echo "<td>$o->date_of_releaving</td><td id='hindi'>$o->duration</td></tr>";
}
?>
</table>