<?php
/**********************************************************************
***********************************************************************/
$page_security = 'SA_PAYROLLTRANSVIEW';
$path_to_root = "../..";

include($path_to_root . "/includes/session.inc");

page(_($help_context = "View Payroll Summary"), true);

include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/payroll/includes/db/payroll_inquiry_db.inc");
include_once($path_to_root . "/payroll/includes/db/loans_db.inc");
include_once($path_to_root . "/payroll/includes/db/employees_db.inc");

if (isset($_GET["trans_no"]))
{
	$trans_no = $_GET["trans_no"];
}


br();

display_heading("Employee ID #$trans_no");

br(1);

    $employee = get_employee($trans_no);
    if($employee){
        display_heading2("Employee Details");
        br(1);
        start_outer_table(TABLESTYLE2,"width=80%");
        table_section(1,'50%');
            label_cells("Full Name", $employee['middle_name'], "class='tableheader2'", "width=200px");
            end_row();
            start_row(); 
            label_cells("Calling Name", $employee['first_name'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            label_cells("Last Name", $employee['last_name'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            label_cells("Initials", $employee['initials'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            label_cells("NIC", $employee['nic'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            label_cells("Passport No", $employee['passport'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            label_cells("Passport Expiry Date", sql2date($employee['passport_expiry_date']), "class='tableheader2'", "width=200px");
            end_row();
            start_row();  
            label_cells("Driving License No", $employee['dl_no'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            label_cells("DL Expiry Date", sql2date($employee['dl_expiry_date']), "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            
            if($employee['gender'] == "M")
                $employee['gender'] = "Male";
            else
                $employee['gender'] = "Female";
            
            label_cells("Gender", $employee['gender'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            
            if($employee['marital_status'] == "S")
                $employee['marital_status'] = "Single";
            else
                $employee['marital_status'] = "Married";
            
            label_cells("Marital Status", $employee['marital_status'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            label_cells("Nationality", $employee['nationality'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            
            if($employee['inactive'] == 0)
                $employee['inactive'] = "Active";
            else
                $employee['inactive'] = "Inactive";
            
            label_cells("Record Status", $employee['inactive'], "class='tableheader2'", "width=200px");
            end_row();

        table_section(2,'50%');
            label_cells("Date of Joining", sql2date($employee['date_of_joining']), "class='tableheader2'", "width=200px");
            end_row();
            start_row(); 
            
            if($employee['resigned'] == 1)
                $resigned = "Yes";
            else
                $resigned = "No";        
            
            label_cells("Resigned", $resigned, "class='tableheader2'", "width=200px");
            end_row();
            
            if($employee['resigned'] == 1)
            {
                start_row();
                label_cells("Date of Resigning", sql2date($employee['date_of_resignation']), "class='tableheader2'", "width=200px");
                end_row();
            }
                
            start_row();
            label_cells("Address", $employee['address'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            label_cells("Work Telephone No", $employee['work_telephone_no'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            label_cells("Home Telephone No", $employee['home_telephone_no'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();  
            label_cells("Mobile No", $employee['mobile_no'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            label_cells("Office Mobile No", $employee['office_mobile_no'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            label_cells("Emergency Contact Details", $employee['emergency_contact_details'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            label_cells("Work Email Id", $employee['work_email_id'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();  
            label_cells("Other Email Ids", $employee['other_email_ids'], "class='tableheader2'", "width=200px");
            end_row();
            start_row();
            label_cells("EPF No", $employee['epf_no'], "class='tableheader2'", "width=200px");
            end_row();
            
        end_outer_table(); 
    }

end_page(true, false, false, ST_EMPLOYEE, $trans_no);
?>