| Current Path : /var/www/html/mmishra/indem/old/indem/phq/admin/ |
| Current File : /var/www/html/mmishra/indem/old/indem/phq/admin/profile.php |
<b>Profile Editing</b><br>
<?php
$tbl = 'z_profiles';
$rank = $_REQUEST['rank'];
$pno = $_REQUEST['pno'];
if (isset($_POST['submit'])){
$pno = $_POST['pno'];
$full_name = $_POST['full_name'];
$date_of_birth = $_POST['date_birth'];
$contact_address = $_POST['contact_address'];
$contact_no = $_POST['contact_no'];
$cadre = $_POST['cadre'];
$honors = $_POST['honors'];
$postings = $_POST['postings'];
$note = $_POST['note'];
$message = $_POST['message'];
$status = $_POST['status'];
if ($_POST['submit'] == 'SAVE'){
if (mysql_num_rows(mysql_query("select * from $tbl where pno='$pno'", $link))){
//update
$sql = "update $tbl set rank='$rank',pno='$pno',full_name='$full_name',date_of_birth='$date_of_birth',contact_address='$contact_address',contact_no='$contact_no',designation='$designation',cadre='$cadre',honors='$honors',postings='$postings',note='$note',message='$message',status='$status' where pno='$pno'";
}else{
//insert
$sql = "insert into $tbl(rank,pno,full_name,date_of_birth,contact_address,contact_no,designation,cadre,honors,postings,note,message,status) values('$rank','$pno','$full_name','$date_of_birth','$contact_address','$contact_no','$designation','$cadre','$honors','$postings','$note','$message','$status')";
}
echo "<div align='right'>" . access_log($url, $sql, $link) . "</div>";
}
}
if ($pno == 0){
$rs = mysql_query("select * from $tbl where rank='$rank'", $link);
if ($rs){
$o = mysql_fetch_object($rs);
$pno = $o->pno;
}
}
$rs = mysql_query("select * from $tbl where pno='$pno'", $link);
if ($rs){
$o = mysql_fetch_object($rs);
$rank = $o->rank;
$pno = $o->pno;
$full_name = $o->full_name;
$date_of_birth = $o->date_birth;
$contact_address = $o->contact_address;
$contact_no = $o->contact_no;
$designation = $o->designation;
$cadre = $o->cadre;
$honors = $o->honors;
$postings = $o->postings;
$note = $o->note;
$message = $o->message;
$status = $o->status;
$date_of_updation = $o->date_of_updation;
}
?>
<table align='right'><tr><td>
<iframe id='khaki_box' src='admin/photograph.php?pno=<?=$pno?>' width='200' height='220' frameborder='0' scrolling='no'></iframe>
</td></tr></table>
Rank<br><input type='text' name='rank' value='<?=$rank?>' size='30'><br>
Full Name<br><input type='text' name='full_name' size='30' value='<?=$full_name?>'><br>
PNo.<br><input type='text' name='pno' size='10' value='<?=$pno?>'><br>
Date of Birth<br><input type='text' name='date_of_birth' size='10' value='<?=$date_of_birth?>'><br>
Contact No.<br><input type='text' name='contact_no' size='30' value='<?=$contact_no?>'><br>
Designation<br><input type='text' name='designation' size='30' value='<?=$designation?>'><br>
Cadre<br><input type='text' name='cadre' size='30' value='<?=$cadre?>'><br>
Honors/Decorations<br><input type='text' name='honors' size='50' value='<?=$honors?>'><br>
Contact Address<br><textarea name='contact_address' rows='3' cols='50'><?=$contact_address?></textarea><br>
Previous Postings<br><textarea name='postings' rows='10' cols='50'><?=$postings?></textarea><br>
Note<br><textarea name='note' rows='3' cols='50'><?=$note?></textarea><br>
Message<br><textarea name='message' rows='10' cols='50'><?=$message?></textarea><br>
Status <select name='status'>
<?php
echo enumerated_data('status',$status,$link);
?>
</select><br>
<input type='submit' name='submit' value='SAVE'> <input type='reset' value='RESET'> Last updated: <?=$date_of_updation?>