session_start();
if(!isset($_SESSION['Unit']) && !isset($_SESSION['user_type'])){
header("Location: ../index.php");
}
//include '../conn.php';
include '../function.php';
function findrank1($pno){
if($pno == '') return $pno;
$results=mysql_query("select rank_hin from rank_master where rank_id=(select rank from employee_master where personal_number=".$pno.")");
if($x = mysql_fetch_array($results)) return $x['rank_hin'];
}
if(isset($_REQUEST["B1"]))
{
$i_ddate="0000-00-00";
if($_REQUEST['enq_ord_date']!=""){
$temp = explode('/',$_REQUEST['enq_ord_date']);
$i_ddate = $temp[2].'-'. $temp[1].'-'. $temp[0];
}
$e_sdate="0000-00-00";
if($_REQUEST['e_sdate']!=""){
$temp = explode('/',$_REQUEST['e_sdate']);
$e_sdate = $temp[2].'-'. $temp[1].'-'. $temp[0];
}
$e_edate="0000-00-00";
if($_REQUEST['e_edate']!=""){
$temp = explode('/',$_REQUEST['e_edate']);
$e_edate = $temp[2].'-'. $temp[1].'-'. $temp[0];
}
$dop="0000-00-00";
if($_REQUEST['dop']!=""){
$temp = explode('/',$_REQUEST['dop']);
$dop = $temp[2].'-'. $temp[1].'-'. $temp[0];
}
$rs = mysql_query('select key_id,personal_number,present_address,present_address_hindi,present_phone_residence_mobile,present_phone_office,present_range,present_state_name,present_district_name,present_rank,present_designation,proficiency_of_employee,present_grad,date_of_selection_grad,s_selection_grad_date,s_selection_grad,higher_selection_grad_date,higher_selection_grad,transfer_posting_flag,transfer_order_date,order_no,release_date,type_of_joining,joining_unit,joining_sub_unit,transfer_reason,posting_date,posting_time,pormotion_date,alloted_to,first_name_of_employee_english,middle_name_of_employee_english,last_name_of_employee_english,archive_date from new_posting_detail where personal_number = '.$_REQUEST['personalno']);
if(mysql_num_rows($rs) > 0)
{
$rs = mysql_fetch_array($rs);
extract($rs);
$personal_number = $personal_number;
$name_of_employee = $first_name_of_employee_english.' '.$middle_name_of_employee_english.' '.$last_name_of_employee_english;
$present_rank = $present_rank;
$unit_name = $joining_unit;
$name_enquiry_officer = $_REQUEST['ef_name'];
$rank_enquiry_officer = $_REQUEST['tempas3'];
$enquiry_order_no = $_REQUEST['e_orderno'];
$type_of_enquiry = $_REQUEST['e_type'];
$enquiry_district = $_REQUEST['tempas2'];
$suspended = $_REQUEST['e_suspend'];
$enquiry_start_date = $e_sdate;
$enquiry_end_date = $e_edate;
$punishment_officer_name = $_REQUEST['p_officer'];
$punishment_order_no = $_REQUEST['p_orderno'];
$type_of_punishment = $_REQUEST['tempas'];
$punishment = $_REQUEST['punishment_name'];
$date_of_punsihment = $dop;
$remark = $_REQUEST['remarks'];
$penaltyText = $_REQUEST['penalty'];
}
mysql_query("INSERT INTO `investigation` (`pno`, `investigation_date`, `officer_name`, `officer_post`, `order_no`, `order_date`, `e_type`,`order_type`, `dist_id`, `investigation_start`, `investigation_end`, `status`, `investigation_unit`) VALUES ('".$_REQUEST['personalno']."', '".$i_ddate ."' , '".$_POST['ef_name']."','".$_POST['tempas3']."', '".$_POST['e_orderno']."', '".$i_ddate."','".$_POST['e_type']."', '".$_POST['e_suspend']."', '".$_POST['tempas2']."', '".$e_sdate."', '".$e_edate."', '1','".$_POST['investigation_unit']."')") or die(mysql_error());
$personal_number=$_REQUEST['personalno'];
updatecrkrecotd($_SESSION['login_pno'], $_REQUEST['personalno'], investigation_transdate);
header("Location: confirm_add.php?id=".$personal_number);
}
function findrank($id = null)
{
$results=mysql_query("select serial_number,rank_id,rank_eng,rank_hin from rank_master where rank_id=".$id);
if($x = mysql_fetch_array($results))
{
return $x['rank_eng'];
} else {
return 'N/A';
}
}
$results=mysql_query("select key_id,personal_number,present_address,present_address_hindi,present_phone_residence_mobile,present_phone_office,present_range,present_state_name,present_district_name,present_rank,present_designation,proficiency_of_employee,present_grad,date_of_selection_grad,s_selection_grad_date,s_selection_grad,higher_selection_grad_date,higher_selection_grad,transfer_posting_flag,transfer_order_date,order_no,release_date,type_of_joining,joining_unit,joining_sub_unit,transfer_reason,posting_date,posting_time,pormotion_date,alloted_to,first_name_of_employee_english,middle_name_of_employee_english,last_name_of_employee_english,archive_date from new_posting_detail where personal_number='".$_REQUEST['id']."' ");
$arow=mysql_fetch_array($results);
extract($arow);
include "../others.php";
?>
UP Police Nominal Roll System