function ten_tardiness_second($second_offenders = array()) { $this->load->library('fpdf'); define('FPDF_FONTPATH', $this->config->item('fonts_path')); $this->load->library('fpdi'); // initiate FPDI $pdf = new FPDI('P', 'mm', 'Legal'); $pdf->SetLeftMargin(20); $pdf->SetRightMargin(15); // add a page $pdf->AddPage(); // set the sourcefile $pdf->setSourceFile('dtr/template/notice2nd.pdf'); // select the first page $tplIdx = $pdf->importPage(1); // use the page we imported $pdf->useTemplate($tplIdx); $offices = Input::get('offices'); $office_id = $offices[0]; $m1 = 'Jul'; $m2 = 'Aug'; $m3 = 'Sep'; $m4 = 'Oct'; $m5 = 'Nov'; $m6 = 'Dec'; $mo1 = '07'; $mo2 = '08'; $mo3 = '09'; $mo4 = '10'; $mo5 = '11'; $mo6 = '12'; $pdf->SetFont('Arial', '', '12'); $pdf->SetXY(155, 50); $pdf->Write(0, date('F d, Y')); $pdf->SetX(35); $pdf->SetFont('Arial', 'B', ''); $pdf->Cell(0, 6, "HON. EDWARD S. HAGEDORN ", '', 1, 'L', FALSE); $pdf->SetFont('Arial', '', ''); $pdf->SetX(35); $pdf->Cell(0, 6, "City Mayor", '', 1, 'L', FALSE); $pdf->SetX(35); $pdf->Cell(0, 6, "Puerto Princesa City", '', 1, 'L', FALSE); $pdf->Cell(0, 6, "", '', 1, 'C', FALSE); $pdf->Cell(0, 6, "Thru: ATTY. SHIRLEY R. DAGANTA", '', 1, 'C', FALSE); $pdf->Cell(0, 6, "CG Assistant Dept. Head II", '', 1, 'C', FALSE); $pdf->Cell(0, 6, "Assistant City Legal Officer II", '', 1, 'C', FALSE); $pdf->Ln(12); $pdf->SetX(35); $pdf->SetFont('Arial', 'B', ''); $pdf->Write(0, 'Madam:'); $pdf->SetFont('Arial', '', ''); $pdf->Ln(6); $pdf->SetX(35); $pdf->MultiCell(0, 6, " Please be informed that despite the first notice issued to him/her as per records in this office, it has been observed that the he/she has continuously incurred the following tardiness and undertime, viz:", 0, 'L', false); //$pdf->SetX(35); //$pdf->Cell(0,6," $number of your employees has incurred the following, viz:",'',0,'L',false); $pdf->SetFont('Arial', 'BI', 10); $pdf->Ln(2); $pdf->SetFillColor(210, 210, 210); //$pdf->SetX(20); //header $pdf->Cell(50, 8, "Name", 'RLTB', 0, 'C', 1); $pdf->Cell(20, 4, $m1, '1', 0, 'C', 1); $pdf->Cell(20, 4, $m2, '1', 0, 'C', 1); $pdf->Cell(20, 4, $m3, '1', 0, 'C', 1); $pdf->Cell(20, 4, $m4, '1', 0, 'C', 1); $pdf->Cell(20, 4, $m5, '1', 0, 'C', 1); $pdf->Cell(20, 4, $m6, '1', 1, 'C', 1); $pdf->SetFont('Arial', '', 9); $pdf->SetFillColor(240, 240, 240); $pdf->Cell(50, 4, "", 'RLB', 0, 'C', false); $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1); $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1); $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1); $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1); $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1); $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1); $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1); $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1); $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1); $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1); $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1); $pdf->Cell(10, 4, "UT", '1', 1, 'C', 1); $pdf->SetFillColor(215, 255, 215); $year1 = Input::get('year'); $tardis = $second_offenders; if (is_array($tardis)) { foreach ($tardis as $tardi) { $name = $this->Employee->get_employee_info($tardi, $field = ''); $late1 = $this->Tardiness->count_late($name['employee_id'], $mo1, $year1, 1, 3); $late2 = $this->Tardiness->count_late($name['employee_id'], $mo2, $year1, 1, 3); $late3 = $this->Tardiness->count_late($name['employee_id'], $mo3, $year1, 1, 3); $late4 = $this->Tardiness->count_late($name['employee_id'], $mo4, $year1, 1, 3); $late5 = $this->Tardiness->count_late($name['employee_id'], $mo5, $year1, 1, 3); $late6 = $this->Tardiness->count_late($name['employee_id'], $mo6, $year1, 1, 3); $under_time1 = $this->Tardiness->count_late($name['employee_id'], $mo1, $year1, 2, 4); $under_time2 = $this->Tardiness->count_late($name['employee_id'], $mo2, $year1, 2, 4); $under_time3 = $this->Tardiness->count_late($name['employee_id'], $mo3, $year1, 2, 4); $under_time4 = $this->Tardiness->count_late($name['employee_id'], $mo4, $year1, 2, 4); $under_time5 = $this->Tardiness->count_late($name['employee_id'], $mo5, $year1, 2, 4); $under_time6 = $this->Tardiness->count_late($name['employee_id'], $mo6, $year1, 2, 4); $late1['tardi_count'] = $this->Tardiness->is_tardy_zero($late1['tardi_count']); $late2['tardi_count'] = $this->Tardiness->is_tardy_zero($late2['tardi_count']); $late3['tardi_count'] = $this->Tardiness->is_tardy_zero($late3['tardi_count']); $late4['tardi_count'] = $this->Tardiness->is_tardy_zero($late4['tardi_count']); $late5['tardi_count'] = $this->Tardiness->is_tardy_zero($late5['tardi_count']); $late6['tardi_count'] = $this->Tardiness->is_tardy_zero($late6['tardi_count']); $under_time1['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time1['tardi_count']); $under_time2['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time2['tardi_count']); $under_time3['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time3['tardi_count']); $under_time4['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time4['tardi_count']); $under_time5['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time5['tardi_count']); $under_time6['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time6['tardi_count']); //start employee tardy $pdf->Cell(50, 4, ucwords(strtolower(utf8_decode($name['fname'] . ' ' . $name['mname'] . ' ' . $name['lname']))), 'RLTB', 0, 'L', false); $pdf->Cell(10, 4, $late1['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $under_time1['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $late2['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $under_time2['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $late3['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $under_time3['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $late4['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $under_time4['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $late5['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $under_time5['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $late6['tardi_count'], '1', 0, 'C', FALSE); $pdf->Cell(10, 4, $under_time6['tardi_count'], '1', 1, 'C', FALSE); } } $pdf->Cell(50, 4, "", 'RLTB', 0, 'L', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE); $pdf->Cell(10, 4, "", '1', 1, 'C', FALSE); // line break $pdf->Ln(5); $pdf->SetFont('Arial', '', '12'); $pdf->SetX(35); $pdf->MultiCell(0, 6, " Section 8, Rule XVII of the Omnibus Rules Implementing Book V of Executive Order No. 292, states that: \n\t\t\t\t 'Officers and employees who have incurred tardiness and undertime, regardless of the number of minutes per day, ten (10) times a month for at least two (2) consecutive months during the year or for at least two (2) months in a semester shall be subject to disciplinary action.'\n\t\t\t\t Violation of the said rule carries the following penalties:\n\t\t\n\t\t\t\t 1.\tFirst Offense - Reprimand;\n\t\t\t\t 2.\tSecond Offense - Suspension for one (1) day to thirty (30) days; and\n\t\t\t\t 3.\tThird Offense - Dismissal.\n\t\t\n\t\t\t\t For your appropriate action.\n\t\t", '', 1, 'L', false); $pdf->Cell(0, 6, " Very truly yours, ", 0, 'R', FALSE); $pdf->Cell(0, 6, " ", '', 1, 'R', FALSE); $pdf->Cell(0, 6, " ", '', 1, 'R', FALSE); $pdf->SetFont('Arial', 'B', ''); $pdf->Cell(0, 6, " FELIMON R. SABAS ", '', 1, 'R', FALSE); $pdf->SetFont('Arial', '', ''); $pdf->Cell(0, 6, " CG Department Head II ", '', 1, 'R', FALSE); $pdf->Cell(0, 6, " (City Personnel Officer) ", '', 1, 'R', FALSE); $pdf->MultiCell(0, 6, "\n\t\tNOTED:\n\t\t\n\t\tBY AUTHORITY OF THE CITY MAYOR:", 0, 'L', FALSE); $pdf->SetFont('Arial', 'B', ''); $pdf->Cell(0, 6, " ATTY. AGUSTIN M. ROCAMORA", '', 1, 'L', FALSE); $pdf->SetFont('Arial', '', ''); $pdf->Cell(0, 6, " City Administrator II", '', 1, 'L', FALSE); header('Cache-Control: maxage=3600'); //Adjust maxage appropriately header('Pragma: public'); //If the parameter is D = download F = save as file $pdf->Output('dtr/reports/ten_tardiness_second.pdf', 'F'); }
function leave_certification_quezon($vl = 0, $sl = 0, $employee_id = '1') { $this->load->library('fpdf'); define('FPDF_FONTPATH', $this->config->item('fonts_path')); $this->load->library('fpdi'); // initiate FPDI $pdf = new FPDI('P', 'mm', 'Letter'); // Margin $pdf->SetRightMargin(22); // add a page $pdf->AddPage(); // set the sourcefile $pdf->setSourceFile('dtr/template/certification/quezon_certification.pdf'); // select the first page $tplIdx = $pdf->importPage(1); // use the page we imported $pdf->useTemplate($tplIdx); $vacation_leave = $vl; $sick_leave = $sl; $name = $this->Employee->get_employee_info($employee_id); $office_name = $this->Office->get_office_name($name['office_id']); // set font, font style, font size. $pdf->SetFont('Arial', '', 12); // set initial placement $pdf->SetXY(136, 50.5); // line break $last_earn = $this->Leave_card->get_last_earn($rows['employee_id']); if ($last_earn != '') { $last_earn = date('F d, Y', strtotime($last_earn)); } else { $dt = new Carbon(); $dt->subMonth(); $date = new Carbon('last day of ' . $this->Helps->get_month_name($dt->month) . ' ' . $dt->year); $last_earn = $this->Helps->get_month_name($date->month) . ' ' . $date->day . ', ' . $date->year; } //$pdf->Write(0, date('F').' '.date('d').', '.date('Y')); $pdf->Ln(37); // go to 25 X (indent) $pdf->SetX(35); $extension = ''; if ($name['extension'] != '') { $extension = ', ' . $name['extension']; } $pdf->MultiCell(0, 6, " This is to certify that as per our office records, " . $name['salut'] . ' ' . ucwords(strtolower(utf8_decode($name['fname']))) . ' ' . ucwords(strtolower(utf8_decode($name['mname']))) . ' ' . ucwords(strtolower(utf8_decode($name['lname']))) . $extension . ', ' . $name['position'] . ' in the ' . utf8_decode($office_name) . ' has the following leave balances as of ' . $last_earn . '.', 0, 'J', false); $pdf->Ln(5.5); $pdf->SetX(35); // set font, font style, font size. $pdf->SetFont('Arial', '', 12); //$pdf->Write(0, $name['position']); $pdf->Ln(5.5); $pdf->SetX(35); //$pdf->Write(0, $office_name); $pdf->Ln(5.5); $pdf->SetX(35); $pdf->Ln(4); $pdf->SetX(35); // set font, font style, font size. $pdf->SetFont('Arial', '', 12); //get the last month that earned leave credit $last_month_last_day = date('Y-m-d', strtotime('-1 second', strtotime(date('m') . '/01/' . date('Y') . ' 00:00:00'))); //list($year, $month, $day) = split('[-.-]', $last_month_last_day);deprecated list($year, $month, $day) = explode('-', $last_month_last_day); $last_month_last_day = date("F d, Y", mktime(0, 0, 0, $month, $day, $year)); $pdf->SetX(136); $pdf->SetXY(128, 119); $pdf->Write(0, number_format($vacation_leave, 3)); //sick $pdf->SetXY(128, 125); $pdf->Write(0, number_format($sick_leave, 3)); //total $pdf->SetXY(128, 131); $pdf->Write(0, number_format($vacation_leave + $sick_leave, 3)); $pdf->Ln(5); $pdf->SetX(35); $pdf->MultiCell(0, 6, " This certification is being issued for whatever legal purpose it may serve.", 0, 'L', false); $pdf->Ln(5); $pdf->SetX(35); $pdf->MultiCell(0, 6, " Issued this " . date('jS') . " day of " . date('F, Y') . ", in Lucena City.", 0, 'L', false); $pdf->Ln(15); $pdf->SetX(110); $statement_prepared = Setting::getField('statement_prepared'); $statement_prepared_position = Setting::getField('statement_prepared_position'); $statement_certified = Setting::getField('statement_certified'); $statement_certified_position = Setting::getField('statement_certified_position'); $pdf->SetFont('Arial', 'B', 12); //$pdf->Cell(90,5, $statement_prepared, '0', 0,'C',false); //4th param border $pdf->Cell(90, 5, utf8_decode($statement_certified), '0', 1, 'C', false); $pdf->SetFont('Arial', '', 12); //$pdf->Cell(90,5, $statement_prepared_position, '0', 0,'C',false); $pdf->SetX(110); $pdf->Cell(90, 5, $statement_certified_position, '0', 1, 'C', false); header('Cache-Control: maxage=3600'); //Adjust maxage appropriately header('Pragma: public'); //$pdf->Output('dtr/reports/leave_certification_'.$employee_id.'.pdf', 'F'); $pdf->Output('dtr/reports/leave_certification_' . $employee_id . '.pdf', 'I'); //return Redirect::to('dtr/reports/leave_certification_'.$employee_id.'.pdf', 'refresh'); }