query($mysqli_query); if(mysqli_num_rows($mysqli_data) > 0){ while($result = mysqli_fetch_assoc($mysqli_data)){ $output .= '
| '.$letter_head.' | |||||||
| Payslip For '.strtoupper(monthFormat($result_slip['month'])).' | |||||||
| NAME | : | '.$result_slip['staff_name'].' | NEW IC NO | : | '.$result_slip['staff_icno'].' | ||
| DESIGNATION | : | '.$result_position['job_position_desc'].' | DATE JOINED | : | '.$result_slip['staff_date_joined'].' | ||
| DEPARTMENT | : | '.$result_department['department_desc'].' | |||||
| GROSS EARNING | Amount(RM) | DEDUCTIONS | Amount(RM) | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| WAGES | '.number_format((float)$result_slip['basic_salary'], 2, '.', '').' | '; if($result_slip['staff_epf'] > 0){ $html .= 'EPF (EMPLOYEE) | '.number_format((float)$result_slip['staff_epf'], 2, '.', '').' | '; }else{ if($result_slip['staff_socso'] > 0){ $html .= 'SOCSO (EMPLOYEE) | '.number_format((float)$result_slip['staff_socso'], 2, '.', '').' | '; $socso_show = 1; }else{ if($result_slip['staff_eis'] > 0){ $html .= 'EIS (EMPLOYEE) | '.number_format((float)$result_slip['staff_eis'], 2, '.', '').' | '; $eis_show = 1; }else{ if($result_slip['staff_pcb'] > 0){ $html .= 'PCB | '.number_format((float)$result_slip['staff_pcb'], 2, '.', '').' | '; $pcb_show = 1; }else{ if($result_slip['staff_zakat'] > 0){ $html .= 'MUSLIM ZAKAT FUND | '.number_format((float)$result_slip['staff_zakat'], 2, '.', '').' | '; $zakat_show = 1; }else{ if($result_slip['deduction'] > 0){ $html .= 'DEDUCTION | '.number_format((float)$result_slip['staff_deduction'], 2, '.', '').' | '; $deduction_show = 1; }else{ $html .= ''; } } } } } } $html .=' | |||||||||
| '; if($result_slip['allowance'] > 0){ $html .= ' ALLOWANCE | '.number_format((float)$result_slip['allowance'], 2, '.', '').' | '; }else{ if($result_slip['commission'] > 0){ $html .= ' COMMISSION'.number_format((float)$result_slip['commission'], 2, '.', '').' | '; $commission_show = 1; }else{ $html .= ''; } } if($result_slip['staff_socso'] > 0 && $socso_show == 0){ $html .= ' | SOCSO (EMPLOYEE) | '.number_format((float)$result_slip['staff_socso'], 2, '.', '').' | '; $socso_show = 1; }else{ if($result_slip['staff_eis'] > 0 && $eis_show == 0){ $html .= 'EIS (EMPLOYEE) | '.number_format((float)$result_slip['staff_eis'], 2, '.', '').' | '; $eis_show = 1; }else{ if($result_slip['staff_pcb'] > 0 && $pcb_show == 0){ $html .= 'PCB | '.number_format((float)$result_slip['staff_pcb'], 2, '.', '').' | '; $pcb_show = 1; }else{ if($result_slip['staff_zakat'] > 0 && $zakat_show == 0){ $html .= 'MUSLIM ZAKAT FUND | '.number_format((float)$result_slip['staff_zakat'], 2, '.', '').' | '; $zakat_show = 1; }else{ if($result_slip['deduction'] > 0 && $deduction_show == 0){ $html .= 'DEDUCTION | '.number_format((float)$result_slip['staff_deduction'], 2, '.', '').' | '; $deduction_show = 1; }else{ $html .= ''; } } } } } $html .=' | |||||||||
| COMMISSION | '.number_format((float)$result_slip['commission'], 2, '.', '').' | '; }else{ $html .= 'COMMISSION | '; } if($result_slip['staff_eis'] > 0 && $eis_show == 0){ $html .= ' | EIS (EMPLOYEE) | '.number_format((float)$result_slip['staff_eis'], 2, '.', '').' | '; $eis_show = 1; }else{ if($result_slip['staff_pcb'] > 0 && $pcb_show == 0){ $html .= 'PCB | '.number_format((float)$result_slip['staff_pcb'], 2, '.', '').' | '; $pcb_show = 1; }else{ if($result_slip['staff_zakat'] > 0 && $zakat_show == 0){ $html .= 'MUSLIM ZAKAT FUND | '.number_format((float)$result_slip['staff_zakat'], 2, '.', '').' | '; $zakat_show = 1; }else{ if($result_slip['deduction'] > 0 && $deduction_show == 0){ $html .= 'DEDUCTION | '.number_format((float)$result_slip['deduction'], 2, '.', '').' | '; $deduction_show = 1; }else{ $html .= ''; } } } } $html.=' | |||||||||||
| '; if($result_slip['staff_pcb'] > 0 && $pcb_show == 0){ $html .= ' | PCB | '.number_format((float)$result_slip['staff_pcb'], 2, '.', '').' | '; $pcb_show = 1; }else{ if($result_slip['staff_zakat'] > 0 && $zakat_show == 0){ $html .= 'MUSLIM ZAKAT FUND | '.number_format((float)$result_slip['staff_zakat'], 2, '.', '').' | '; $zakat_show = 1; }else{ if($result_slip['deduction'] > 0 && $deduction_show == 0){ $html .= 'DEDUCTION | '.number_format((float)$result_slip['staff_deduction'], 2, '.', '').' | '; $deduction_show = 1; }else{ $html .= ''; } } } $html .=' | ||||||||||||||||
| '; if($result_slip['staff_zakat'] > 0 && $zakat_show == 0){ $html .= ' | MUSLIM ZAKAT FUND | '.number_format((float)$result_slip['staff_zakat'], 2, '.', '').' | '; $zakat_show = 1; }else{ if($result_slip['deduction'] > 0 && $deduction_show == 0){ $html .= 'DEDUCTION | '.number_format((float)$result_slip['staff_deduction'], 2, '.', '').' | '; $deduction_show = 1; }else{ $html .= ''; } } $html .=' | ||||||||||||||||||
| '; if($result_slip['deduction'] > 0 && $deduction_show == 0){ $html .= ' | DEDUCTION | '.number_format((float)$result_slip['staff_deduction'], 2, '.', '').' | '; $deduction_show = 1; }else{ $html .= ''; } $html .=' | ||||||||||||||||||||
| TOTAL EARNING / INCOME |
'.number_format((float)$total_earning, 2, '.', '').' | TOTAL DEDUCTIONS | '.number_format((float)$total_deduction, 2, '.', '').' | ||||||||||||||||||||
| EMPLOYER CONTRIBUTIONS | |||||||||||||||||||||||
| NET PAY | '.number_format( (float)$result_slip['total'], 2, '.', '').' | '; if($result_slip['employer_epf'] > 0){ $html .= 'EPF | '.number_format((float)$result_slip['employer_epf'], 2, '.', '').' | '; }else{ if($result_slip['employer_socso'] > 0){ $html .= 'SOCSO | '.number_format((float)$result_slip['employer_socso'], 2, '.', '').' | '; $em_socso_show = 1; }else{ if($result_slip['employer_eis'] > 0){ $html .= 'EIS | '.number_format((float)$result_slip['employer_eis'], 2, '.', '').' | '; $em_eis_show = 1; }else{ $html .= ''; } } } $html .=' | |||||||||||||||
| '; if($result_slip['employer_socso'] > 0 && $em_socso_show == 0){ $html .= ' | SOCSO | '.number_format((float)$result_slip['employer_socso'], 2, '.', '').' | '; $em_socso_show = 1; }else{ if($result_slip['employer_eis'] > 0 && $em_eis_show == 0){ $html .= 'EIS | '.number_format((float)$result_slip['employer_eis'], 2, '.', '').' | '; $em_eis_show = 1; }else{ $html .= ''; } } $html .=' | ||||||||||||||||||
| '; if($result_slip['employer_eis'] > 0 && $em_eis_show == 0){ $html .= ' | EIS | '.number_format((float)$result_slip['employer_eis'], 2, '.', '').' | '; $em_eis_show = 1; }else{ $html .= ''; } $html .=' | ||||||||||||||||||||
| If you need further clarification, please contact Accounts Department. | |||||
| This is computer generated document. No signature is required. |
Hello, kindly receive your monthly salary slip for '.date('Y-m', strtotime($result_slip['month'])).'
'; $mailer = new Mailer() ; $mailer->from = EMAILNOREPLY ; $mailer->to = [ $to ] ; $mailer->subject = $title ; $mailer->body = $body ; $mailer->sendAttachment($_SERVER['DOCUMENT_ROOT'].'/Salary_Slip/'.$filename, $filename); $send = $mailer->send() ; unlink($_SERVER['DOCUMENT_ROOT'].'/Salary_Slip/'.$filename); } $result['status'] = 'success'; }else{ $result['status'] = 'failed'; } echo json_encode($result); exit; } // get all branch $branch = [] ; $get_branch = $mysqli->query("SELECT * FROM branch WHERE deleted_at IS NULL".$user_branch_permission_sql) ; if ( $get_branch->num_rows > 0 ){ while ( $row_branch = $get_branch->fetch_assoc() ){ $branch[$row_branch['branch_id']] = $row_branch['branch_name'] ; } } // get month that has the salary slip $query_slip = $mysqli->query("SELECT a.month FROM salary_slip a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.deleted_at IS NULL ".$user_branch_permission_sql_b." GROUP BY a.month ORDER BY a.month DESC") ; $slip_month = [] ; if(mysqli_num_rows($query_slip) > 0){ while($row = mysqli_fetch_assoc($query_slip)){ $slip_month[] = $row['month']; } } include 'HR/salary-data.php' ; $boolean_role = true ; $boolean_edit = true ; // active page $active_main_menu = 'salary' ; $active_sub_menu = 'salary-list' ; // reset sort by type $sort_by_type = ( $sort_by_type == 'DESC' ? 'ASC' : 'DESC' ) ; ?>|
= $lang['Action']?>
|
Remark
|
||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
'.$slip['staff_idno'].'
|
'.ucwords($slip['staff_name']).'
|
'.number_format((float)$slip['basic_salary'], 2, '.', '').'
|
'.number_format((float)$slip['commission'], 2, '.', '').'
|
'.number_format((float)$slip['allowance'], 2, '.', '').'
|
'.number_format((float)$slip['deduction'], 2, '.', '').'
|
'.$slip['remark'].'
|
'.number_format((float)$slip['sub_total'], 2, '.', '').' | '.number_format((float)$slip['staff_epf'], 2, '.', '').' | '.number_format((float)$slip['staff_socso'], 2, '.', '').' | '.number_format((float)$slip['staff_eis'], 2, '.', '').' | '.number_format((float)$slip['staff_zakat'], 2, '.', '').' | '.number_format((float)$slip['staff_pcb'], 2, '.', '').' | '.number_format((float)$slip['total'], 2, '.', '').' | '.number_format((float)$slip['employer_epf'], 2, '.', '').' | '.number_format((float)$slip['employer_socso'], 2, '.', '').' | '.number_format((float)$slip['employer_eis'], 2, '.', '').' | |
| No data available | |||||||||||||||||