<?php
$$class = new hr_payslip_user();
 $payroll_id = '';
 $user_details = ino_user::find_by_id($_SESSION['user_id']);
 $emp_details = hr_employee::find_by_id($user_details->hr_employee_id);
 $$class->hr_employee_id = $emp_details->hr_employee_id;
 $$class->identification_id = $emp_details->identification_id;
 $$class->employee_name = $emp_details->first_name . ' ' . $emp_details->last_name;
 $payroll_id = $emp_details->payroll_id;
// $hr_payslip_line_object = $$class->findBy_employeeId($$class->employee_id);

  $mode = 2;$readonly=1;

 
//pa($$class);pa($$class_second);
if (!empty($$class->hr_employee_id) && !empty($_GET['period_name_id'])) {
 $ps_h = hr_payslip_header::find_by_employeeId_periodNameId($$class->hr_employee_id, $_GET['period_name_id']);
 if ($ps_h) {
  foreach ($$class->field_a as $k => $v) {
   $$class->$v = $ps_h->$v;
  }
  $hr_payslip_line_object = hr_payslip_line::find_by_parent_id($$class->hr_payslip_header_id);
 }
}

if(empty($hr_payslip_line_object)){
 $hr_payslip_line_object = array(new hr_payslip_line());
}

$total_count = count($hr_payslip_line_object);
 $pageno = !empty($_GET['pageno']) && !is_array($_GET['pageno']) ? $_GET['pageno'] : 1;
 $per_page = (!empty($_GET['per_page'])  && !is_array($_GET['per_page'])) ? $_GET['per_page'] : 10;
 $pagination = new pagination($pageno, $per_page, $total_count);
 $pagination->setProperty('_path', 'form.php?');
 $position = ($pageno - 1) * $per_page;

?>