<th width="13%">Education</th> <th width="8%">Birthday</th> <th width="8%">Address</th> </tr> <?php $office = new Office_m(); ?> <?php foreach ($rows as $row) { ?> <?php $bg = $this->Helps->set_line_colors(); ?> <?php $office->get_by_office_id($row->office_id); ?> <?php $type_employment = $this->options->type_employment(); ?> <tr bgcolor="<?php echo $bg; ?> " onmouseover="this.bgColor = '<?php echo $this->config->item('mouseover_linecolor'); ?> ';" onmouseout ="this.bgColor = '<?php echo $bg; ?> ';">
function training_preview($employee_id = '', $report_name = '') { $employee = new Employee_m(); $employee->get_by_id($employee_id); $office = new Office_m(); $office->get_by_office_id($employee->office_id); $type_employment = $this->options->type_employment(); $a = Setting::getField('republic'); $b = Setting::getField('lgu_name'); $c = Setting::getField('lgu_office'); $d = Setting::getField('lgu_address'); // this is for heading republic $lgu_code = Setting::getField('lgu_code'); // Laguna Province if ($lgu_code == 'laguna_province') { $logo = 'dtr/template/laguna_province/logo.jpg'; } $html = ' <table width="100%" border="0" cellpadding="5"> <tr> <td colspan="4" align="center" style="font-family:\'Times New Roman\', Times, serif"><b><em>' . $a . '</em></b></td> </tr> <tr> <td colspan="4" align="center" style="font-family:\'Times New Roman\', Times, serif"><b><em>' . $b . '</em></b></td> </tr> <tr> <td colspan="4" align="center" style="font-family:\'Times New Roman\', Times, serif"><b><em>' . $c . '</em></b></td> </tr> <tr> <td colspan="4" align="center" style="font-family:\'Times New Roman\', Times, serif"><b><em>' . $d . '</em></b></td> </tr> <tr> <td colspan="4" align="center" style="font-family:\'Times New Roman\', Times, serif"> </td> </tr> <tr> <td colspan="4" align="center" style="font-family:\'Times New Roman\', Times, serif"> </td> </tr> <tr> <td colspan="4" align="center" style="font-size:18px;">Employee Training Record</td> </tr> <tr> <td width="16%"> </td> <td width="35%"> </td> <td width="27%"> </td> <td width="22%"> </td> </tr> <tr> <td align="left"><strong>Name:</strong></td> <td>' . $employee->lname . ', ' . $employee->fname . ' ' . $employee->mname . '</td> <td> </td> <td> </td> </tr> <tr> <td align="left"><strong>Department:</strong></td> <td>' . $office->office_name . '</td> <td align="left"><strong>Sex:</strong></td> <td>' . $employee->sex . '</td> </tr> <tr> <td align="left"><strong>Position:</strong></td> <td>' . $employee->position . '</td> <td align="left"><strong>Employment Status:</strong></td> <td>' . $type_employment[$employee->permanent] . '</td> </tr> </table> <table width="100%" border="0"> <tr> <td colspan="3" align="center">' . $report_name . '</td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> <table width="100%" border="1"> <tbody><tr> <td width="10%"><strong>Date From</strong></td> <td width="9%"><strong>Date to</strong></td> <td width="4%"><strong>Course Title</strong></td> <td width="10%"><strong>Duration</strong></td> <td width="13%"><strong>Conducted By</strong></td> </tr>'; $params = array('format' => 'Letter'); $this->load->library('mpdf', $params); // LOAD a stylesheet $stylesheet = file_get_contents(base_url() . 'css/mpdf/mpdfstyletables.css'); $this->mpdf->WriteHTML($stylesheet, 1); // The parameter 1 tells that this is css/style only and no body/html/text $this->mpdf->WriteHTML($html); // Training=========================================================== $t = new Training(); $t->order_by('date_from', 'DESC'); $rows = $t->get_by_employee_id($employee_id); foreach ($rows as $row) { $entry = ' <tr> <td>' . $row->date_from . '</td> <td>' . $row->date_to . '</td> <td>' . $row->name . '</td> <td>' . $row->number_hours . '</td> <td>' . $row->conducted_by . '</td> </tr>'; $this->mpdf->WriteHTML($entry); } $signatories = ' <tr> <td></td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </tbody></table> '; // Signatories $training_prepared = Setting::getField('training_prepared'); $training_prepared_position = Setting::getField('training_prepared_position'); $training_certified = Setting::getField('training_certified'); $training_certified_position = Setting::getField('training_certified_position'); $signatories .= ' <table width="100%" border="0"> <tr> <td width="38%"> </td> <td width="23%"> </td> <td width="39%"> </td> </tr> <tr> <td align="center">PREPARED BY:</td> <td> </td> <td align="center">CERTIFIED CORRECT:</td> </tr> <tr> <td align="center"> </td> <td> </td> <td align="center"> </td> </tr> <tr> <td align="center"> </td> <td> </td> <td align="center"> </td> </tr> <tr> <td align="center">' . $training_prepared . '</td> <td> </td> <td align="center">' . $training_certified . '</td> </tr> <tr> <td align="center">' . $training_prepared_position . '</td> <td> </td> <td align="center">' . $training_certified_position . '</td> </tr> </table> '; $this->mpdf->WriteHTML($signatories); $this->mpdf->Output('dtr/template/pds/archives/pds_' . date('Y_m_d') . '.pdf', 'I'); }
function schedule_retirement_pay($date_retired = '', $employee_id = '1') { $data = array(); $data['msg'] = ''; $this->load->library('fpdf'); if (!defined('FPDF_FONTPATH')) { define('FPDF_FONTPATH', $this->config->item('fonts_path')); } $this->load->library('fpdi'); // initiate FPDI $pdf = new FPDI('L', 'mm', 'Legal'); $pdf->SetAutoPageBreak(FALSE); // add a page $pdf->AddPage(); // set the sourcefile $pdf->setSourceFile('dtr/template/leave/schedule_retirement_pay.pdf'); // select the first page $tplIdx = $pdf->importPage(1); // use the page we imported $pdf->useTemplate($tplIdx); $e = new Employee_m(); $e->get_by_employee_id($employee_id); // set font, font style, font size. $pdf->SetFont('Times', '', 10); $pdf->SetTextColor(89, 89, 89); // set initial placement $pdf->SetXY(142, 20.5); $personal = new Personal_m(); $personal->where('employee_id', $e->id); $personal->get(1); $this->load->helper('date'); $o = new Office_m(); $o->get_by_office_id($e->office_id); $period = 'January 1, 2012 May 10, 2012'; $office_name = $o->office_name; $lgu_name = Setting::getField('lgu_name'); //var_dump($date_retired); $date_retired_diff = $date_retired; $date_birth = convert_long_date($personal->birth_date, TRUE); $first_day_of_service = convert_long_date($e->first_day_of_service); $date_retired = convert_long_date($date_retired, TRUE); $salary = $this->Salary_grade->get_monthly_salary($e->salary_grade, $e->step); //$pdf->SetX(114); $pdf->Write(0, $period); $pdf->Ln(10); $pdf->SetX(63); $pdf->Write(0, $office_name); $pdf->Ln(5); $pdf->SetX(63); $pdf->Write(0, $lgu_name); $pdf->SetFont('Times', 'B', 10); $pdf->Ln(21.5); $pdf->SetX(14); $pdf->Write(0, $e->fname . ' ' . substr($e->mname, 0, 1) . '. ' . $e->lname); $pdf->SetFont('Times', '', 10); $pdf->SetX(65); $pdf->Write(0, $date_birth); $pdf->SetX(88); $pdf->Write(0, $date_retired); $date1 = new DateTime("1970-7-01"); $date2 = new DateTime("2011-11-16"); $date1 = new DateTime($e->first_day_of_service); $date2 = new DateTime($date_retired_diff); $interval = $date1->diff($date2); //echo "difference " . $interval->y . " years, " . $interval->m." months, ".$interval->d." days "; if ($interval->y != 0) { $pdf->SetX(114); $pdf->Write(0, $interval->y . " years"); } if ($interval->m != 0) { $pdf->Ln(5); $pdf->SetX(114); $pdf->Write(0, $interval->m . " months"); } if ($interval->d != 0) { $pdf->Ln(5); $pdf->SetX(114); $pdf->Write(0, $interval->d . " days"); } // Salary $pdf->SetXY(145, 53); $pdf->Cell(20, 8, number_format($salary, 2), '', 0, 'C', FALSE); $total_leave = $this->Leave_card->get_total_leave_credits($employee_id); $vacation_leave = $total_leave['vacation']; $sick_leave = $total_leave['sick']; $total = $vacation_leave + $sick_leave; $terminal_leave = $salary * $total * 0.0478087; // vacation leave $pdf->SetXY(203, 58); $pdf->Cell(20, 8, number_format($vacation_leave, 3), '', 0, 'R', FALSE); // sick leave $pdf->SetXY(203, 63); $pdf->Cell(20, 8, number_format($sick_leave, 3), '', 0, 'R', FALSE); // total $pdf->SetXY(203, 68); $pdf->Cell(20, 8, number_format($total, 3), '', 0, 'R', FALSE); // terminal leave $pdf->SetX(274); $pdf->Cell(20, 8, number_format($terminal_leave, 2), '', 0, 'R', FALSE); $pdf->SetFont('Times', 'B', 10); // grand total leave $pdf->SetXY(203, 119); $pdf->Cell(20, 8, number_format($total, 3), '', 0, 'R', FALSE); // total terminal amount $pdf->SetX(274); $pdf->Cell(20, 8, number_format($terminal_leave, 2), '', 0, 'R', FALSE); // Signatories $pdf->Ln(35); $pdf->SetX(13); $pdf->Cell(50, 8, Setting::getField('retirement_signatory_prepared'), '', 0, 'C', FALSE); // date $pdf->SetFont('Times', '', 10); $pdf->SetX(76); $pdf->Cell(50, 8, date('F d, Y'), '', 0, 'C', FALSE); $pdf->SetFont('Times', 'B', 10); $pdf->SetX(147); $pdf->Cell(50, 8, Setting::getField('retirement_signatory_approved'), '', 0, 'C', FALSE); $pdf->SetFont('Times', '', 10); $pdf->Ln(5); $pdf->SetX(13); $pdf->Cell(50, 8, Setting::getField('retirement_signatory_prepared_position'), '', 0, 'C', FALSE); $pdf->SetX(146); $pdf->Cell(50, 8, Setting::getField('retirement_signatory_approved_position'), '', 0, 'C', FALSE); $pdf->SetFont('Times', 'B', 10); $pdf->Ln(25); $pdf->SetX(13); $pdf->Cell(50, 8, Setting::getField('retirement_signatory_certified'), '', 0, 'C', FALSE); $pdf->SetX(88); $pdf->Cell(50, 8, Setting::getField('retirement_signatory_attested'), '', 0, 'C', FALSE); $pdf->SetX(147); $pdf->Cell(50, 8, Setting::getField('retirement_signatory_availability'), '', 0, 'C', FALSE); $pdf->SetX(223); $pdf->Cell(50, 8, Setting::getField('retirement_signatory_noted'), '', 0, 'C', FALSE); $pdf->SetFont('Times', '', 10); $pdf->Ln(5); $pdf->SetX(13); $pdf->Cell(50, 8, Setting::getField('retirement_signatory_certified_position'), '', 0, 'C', FALSE); $pdf->SetX(88); $pdf->Cell(50, 8, Setting::getField('retirement_signatory_attested_position'), '', 0, 'C', FALSE); $pdf->SetX(147); $pdf->Cell(50, 8, Setting::getField('retirement_signatory_availability_position'), '', 0, 'C', FALSE); $pdf->SetX(223); $pdf->Cell(50, 8, Setting::getField('retirement_signatory_noted_position'), '', 0, 'C', FALSE); header('Cache-Control: maxage=3600'); //Adjust maxage appropriately header('Pragma: public'); $pdf->Output('dtr/reports/schedule_retirement_pay' . $employee_id . '.pdf', 'F'); // index 'L' for landscape $this->pages['L'] = 'dtr/reports/schedule_retirement_pay' . $employee_id . '.pdf'; }
function jo_preview($office_id = '', $period = '') { $this->Employee->fields = array('id', 'employee_id', 'office_id', 'lname', 'fname', 'mname', 'tax_status', 'dependents'); $this->Employee->employment_type = 4; $rows = $this->Employee->get_employee_list($office_id, ''); $o = new Office_m(); $o->get_by_office_id($office_id); $disbursing_officer = $o->disbursing_officer; $str = $o->office_name; if (strlen($str) % 2 == 1) { $str .= ' '; } $length = strlen($str) / 2; $arr2 = str_split($str, $length); $office_page1 = $arr2[0]; $office_page2 = $arr2[1]; list($month, $day1, $day2, $year) = explode("-", $period); $month_name = $this->Helps->get_month_name($month); $period_text = 'For the Month of ' . $month_name . ' ' . $day1 . '-' . $day2 . ', ' . $year; if (strlen($period_text) % 2 == 1) { $period_text .= ' '; } $length = strlen($period_text) / 2; $period_text_arr = str_split($period_text, $length); $period_page1 = $period_text_arr[0]; $period_page2 = $period_text_arr[1]; $agency_accountant = Setting::getField('agency_accountant'); $agency_accountant_position = Setting::getField('agency_accountant_position'); $head_of_office = Setting::getField('head_of_office'); $head_of_office_position = Setting::getField('head_of_office_position'); $heading = '<table width="100%" border="0"> <tr> <td> </td> <td> </td> <td> </td> <td align="right"></td> <td> </td> <td align="right"><H1>DAILY WAGE PAY</H1></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="right"> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="right">' . strtoupper($office_page1) . '</td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="right"><strong>' . $period_page1 . '</strong></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="right"> </td> </tr> <tr> <td colspan="6" style="font-size:11px">We acknowledge receipt of the sum shown opposite our names as full compensation for the services rendered for the period stated.</td> </tr> </table>'; $page = ' <table width="100%" border="1"> <tr> <td width="3%" rowspan="3" align="center" valign="middle"><strong>No.</strong></td> <td width="45%" rowspan="3" align="center" valign="middle"><strong>NAME</strong></td> <td width="19%" rowspan="3" align="center" valign="middle"><strong>TIN</strong></td> <td width="12%" rowspan="3" align="center" valign="middle"><strong>Tax Exemption</strong></td> <td width="12%" rowspan="3" align="center" valign="middle"><strong>Rate per Day</strong></td> <td width="6%" rowspan="3" align="center" valign="middle"><strong>Rate per Hour</strong></td> <td width="3%"> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr>'; $grand_total_salary = 0; $grand_total_amount_due = 0; $deduction = 0; $p = new Personal_m(); $r = new Rates(); $j = new Jo_days(); $n = 1; foreach ($rows as $row) { $p->get_by_employee_id($row['id']); $r->get_by_employee_id($row['employee_id']); $j->where('employee_id', $row['employee_id']); $j->where('period', $period); $j->get(); $total_salary = $r->rate_per_day * $j->days; $grand_total_salary += $total_salary; $total_amount_due = $total_salary - $deduction; $grand_total_amount_due += $total_amount_due; $tax_status = $row['tax_status'] != 'Single' ? 'ME' . $row['dependents'] : 'S'; $page .= '<tr> <td>' . $n . '</td> <td>' . strtoupper($row['lname']) . ', ' . $row['fname'] . ' ' . $row['mname'] . '</td> <td>' . $p->tin . '</td> <td>' . $tax_status . '</td> <td align="right">' . number_format($r->rate_per_day, 2) . '</td> <td> </td> <td> </td> </tr>'; $n++; } $page .= '<tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td><strong>TOTAL</strong></td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> <table width="100%" border="1"> <tr> <td><table width="100%" border="0"> <tr> <td width="3%"> </td> <td width="64%">CERTIFIED</td> <td width="4%"> </td> <td width="6%"> </td> <td width="4%"> </td> <td width="16%"> </td> <td width="3%"> </td> </tr> <tr> <td> </td> <td colspan="6">Each person whose name appears on this roll had rendered services for the time stated</td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="center">_______________________</td> <td> </td> </tr> <tr> <td> </td> <td><strong>' . strtoupper($o->office_head) . '</strong></td> <td> </td> <td> </td> <td> </td> <td align="center">Date</td> <td> </td> </tr> <tr> <td> </td> <td colspan="5" style="font-size:11px">' . $o->position . '</td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table></td> </tr> </table> <table width="100%" border="1"> <tr> <td><table width="100%"> <tr> <td width="3%"> </td> <td width="35%">CERTIFIED: Funds available in the amount of</td> <td width="33%">' . number_format($grand_total_amount_due, 2) . '</td> <td width="6%"> </td> <td width="4%"> </td> <td width="16%"> </td> <td width="3%"> </td> </tr> <tr> <td> </td> <td colspan="6"> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="center"> </td> <td> </td> </tr> <tr> <td> </td> <td align="center"><strong>' . $agency_accountant . '</strong></td> <td> </td> <td> </td> <td> </td> <td align="center">_______________________</td> <td> </td> </tr> <tr> <td> </td> <td align="center">' . $agency_accountant_position . '</td> <td> </td> <td> </td> <td> </td> <td align="center">Date</td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table></td> </tr> </table> <pagebreak /> '; $page2 = '<table width="100%" border="0"> <tr> <td><H1>ROLL - JOB ORDER</H1></td> <td> </td> <td> </td> <td align="right"></td> <td> </td> <td align="right"></td> </tr> <tr> <td></td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="right"> </td> </tr> <tr> <td>' . strtoupper($office_page2) . '</td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="right"> </td> </tr> <tr> <td><strong>' . $period_page2 . '</strong></td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="right"> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="right"> </td> </tr> <tr> <td colspan="6"> </td> </tr> </table> <table width="100%" border="1"> <tr> <td width="5%" rowspan="3" align="center" valign="middle"><strong>No of Hours</strong></td> <td width="19%" rowspan="3" align="center" valign="middle"><strong>No. of Days with Pay</strong></td> <td width="15%" rowspan="3" align="center" valign="middle"><strong>Total Amount of Salary</strong></td> <td width="7%" rowspan="3" align="center" valign="middle"><strong>Pag-ibig Personal Contribution</strong></td> <td width="10%" rowspan="3" align="center" valign="middle"><strong>Total Deductions</strong></td> <td width="13%" rowspan="3" align="center" valign="middle"><strong>Total Amount Due</strong></td> <td width="5%" rowspan="3" align="center" valign="middle"><strong>No.</strong></td> <td width="20%" rowspan="3" align="center" valign="middle"><strong>SIGNATURE OR THUMBMARK</strong></td> <td width="6%"> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr>'; $n = 1; $grand_total_salary = 0; $grand_total_amount_due = 0; $deduction = 0; $j = new Jo_days(); $r = new Rates(); foreach ($rows as $row) { $j->where('employee_id', $row['employee_id']); $j->where('period', $period); $j->get(); $r->get_by_employee_id($row['employee_id']); $total_salary = $r->rate_per_day * $j->days; $grand_total_salary += $total_salary; $deduction = $r->pagibig_amount; $total_amount_due = $total_salary - $deduction; $grand_total_amount_due += $total_amount_due; $page2 .= ' <tr> <td></td> <td align="center">' . $j->days . '</td> <td align="right">' . number_format($total_salary, 2) . '</td> <td>' . $r->pagibig_amount . '</td> <td align="right">' . $deduction . '</td> <td align="right">' . number_format($total_amount_due, 2) . '</td> <td>' . $n . '</td> <td></td> <td> </td> </tr>'; $n++; } $page2 .= ' <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td><strong>TOTAL</strong></td> <td align="right"><strong>' . number_format($grand_total_salary, 2) . '</strong></td> <td> </td> <td> </td> <td align="right"><strong>' . number_format($grand_total_amount_due, 2) . '</strong></td> <td> </td> <td> </td> <td> </td> </tr> </table> <table width="100%" border="1"> <tr> <td><table width="100%" border="0"> <tr> <td width="3%"> </td> <td colspan="2">APPROVED FOR PAYMENT</td> <td width="31%"> </td> <td width="4%"> </td> <td width="16%"> </td> <td width="3%"> </td> </tr> <tr> <td> </td> <td colspan="6"> </td> </tr> <tr> <td> </td> <td width="17%"> </td> <td width="26%"> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="center">_______________________</td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td align="center"><strong>' . $head_of_office . '</strong></td> <td> </td> <td> </td> <td align="center">Date</td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td align="center">' . $head_of_office_position . '</td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table></td> </tr> </table> <table width="100%" border="1"> <tr> <td><table width="100%" border="0"> <tr> <td width="3%"> </td> <td colspan="6">CERTIFIED: Each person whose name appears on the above rolls has been</td> </tr> <tr> <td> </td> <td colspan="6">paid the amount stated opposite his name after identifying himself</td> </tr> <tr> <td> </td> <td width="17%"> </td> <td width="26%"> </td> <td width="31%"> </td> <td width="4%"> </td> <td width="16%"> </td> <td width="3%"> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="center"> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td align="center"><strong>' . $disbursing_officer . '</strong></td> <td> </td> <td> </td> <td align="center">_______________________</td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td align="center">Disbursing Officer</td> <td> </td> <td> </td> <td align="center">Date</td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table></td> </tr> </table> '; $html = $heading . $page . $page2; $params = array('format' => 'Legal'); $this->load->library('mpdf', $params); //$mpdf=new mPDF('c','Letter'); $this->mpdf->mirrorMargins = 1; // Use different Odd/Even headers and footers and mirror margins $stylesheet = file_get_contents(base_url() . 'css/mpdf/mpdfstyletables.css'); $this->mpdf->WriteHTML($stylesheet, 1); // The parameter 1 tells that this is css/style only and no $this->mpdf->WriteHTML($html); $this->mpdf->Output(); }
function divisions($office_id = '') { $o = new Office_m(); $o->get_by_office_id($office_id); $data['page_name'] = '<b>Divisions of "' . $o->office_name . '"</b>'; $data['msg'] = ''; $this->load->library('pagination'); $divisions = new Division(); $config['base_url'] = base_url() . 'training_manage/course'; $config['total_rows'] = $divisions->count(); $config['per_page'] = '15'; $config['full_tag_open'] = '<p>'; $config['full_tag_close'] = '</p>'; $this->pagination->initialize($config); // How many related records we want to limit ourselves to $limit = $config['per_page']; // Set the offset for our paging $offset = $this->uri->segment(4); $divisions->where('office_id', $office_id); $divisions->order_by('name'); $data['rows'] = $divisions->get($limit, $offset); $data['office_id'] = $office_id; $data['page'] = $this->uri->segment(3); $data['main_content'] = 'divisions'; return View::make('includes/template', $data); }
function back_id($results) { $params = array('mode' => '', 'format' => 'Legal', 'default_font_size' => 0, 'default_font' => '', 'mgl' => '0', 'mgr' => '0', 'mgt' => '0', 'mgb' => '0', 'mgh' => '0', 'mgf' => '0', 'orientation' => 'P'); $this->load->library('mpdf', $params); // LOAD a stylesheet //$this->mpdf->SetHTMLHeader('<div align="center" style="font-size:15">LAGUNA UNIVERSITY PROPERTY INVENTORY SYSTEM<div>'); $stylesheet = file_get_contents(base_url() . 'css/mpdf/mpdfstyletables.css'); $this->mpdf->WriteHTML($stylesheet, 1); // The parameter 1 tells that this is css/style only and no body/html/text //$today = date("F, l, d, Y - H:i:s a"); //$this->mpdf->SetFooter($today.'||{PAGENO} of {nbpg}'); $tbl_start_b = '<table border="0"><tr>'; $this->mpdf->WriteHTML($tbl_start_b); $x = '4'; //4 start counting $y = '0'; foreach ($results as $result) { //get info from PDS table $p = new Pds_personal_info_m(); $row = $p->get_by_employee_id($result->employee_id); //get info from Employee table $e = new Employee_m(); $e_row = $e->get_by_id($val); $blood_type = ''; if (strlen($row->blood_type) >= 1) { $blood_type = """ . $row->blood_type . """; } $y++; $o = new Office_m(); $office = $o->get_by_office_id($e_row->office_id); $html_f = '<td align="center"> <table border="0" width="205" height="320" style="background-image: url(images/id/id-back.png) no-repeat; font-size:9px; font-family:Arial" > <tr><td height="12" colspan="2"></td></tr> <tr> <td width="20%" height="37" align="left">ADDRESS:</td> <td align="center">' . ucwords(strtolower($row->permanent_address)) . '</td> </tr> <tr> <td height="18" align="left" valign="bottom">BIRTHDAY:</td> <td align="center" valign="bottom">' . $row->birth_date . '</td> </tr> <tr> <td height="18" align="left" valign="bottom">BLOOD TYPE:</td> <td align="center" valign="bottom">' . $blood_type . '</td> </tr> <tr> <td height="18" align="left" valign="bottom">GSIS:</td> <td align="center" valign="bottom">' . $row->gsis . '</td> </tr> <tr> <td height="20" align="left" valign="bottom">PAG-IBIG:</td> <td align="center" valign="bottom">' . $row->pagibig . '</td> </tr> <tr> <td height="20" align="left" valign="bottom">PHILHEALTH:</td> <td align="center" valign="bottom">' . $row->philhealth . '</td> </tr> <tr> <td height="20" align="left" valign="bottom">TIN:</td> <td align="center" valign="bottom">' . $row->tin . '</td> </tr> <tr> <td height="10" colspan="2" align="center"> This card must be surrendered immediately upon termination or separation from service. if found. please send or mail to</td> </tr> <tr> <td align="center" colspan="2"> <b>Provincial Government of Laguna<br>' . $office->office_name . '</b> <br>' . $office->office_address . ' </td> </tr> <tr> <td align="center" colspan="2" height="20" valign="bottom"><b>IN CASE OF EMERGENCY, PLEASE NOTIFY:</b></td> </tr> <tr> <td align="center" colspan="2"><b> <br /> </b></td> </tr> <tr> <td align="center" height="61" colspan="2" style="background-image: url(images/id/gov.signiture.png) no-repeat;"> </td> </tr> </table></td>'; if ($y == $x) { $html_f = ' <tr><td align="center"> <table border="0" width="205" height="320" style="background-image: url(images/id/id-back.png) no-repeat; font-size:9px; font-family:Arial" > <tr><td height="12" colspan="2"></td></tr> <tr> <td width="20%" height="37" align="left">ADDRESS:</td> <td align="center">' . ucwords(strtolower($row->permanent_address)) . '</td> </tr> <tr> <td height="18" align="left" valign="bottom">BIRTHDAY:</td> <td align="center" valign="bottom">' . $row->birth_date . '</td> </tr> <tr> <td height="18" align="left" valign="bottom">BLOOD TYPE:</td> <td align="center" valign="bottom">' . $blood_type . '</td> </tr> <tr> <td height="18" align="left" valign="bottom">GSIS:</td> <td align="center" valign="bottom">' . $row->gsis . '</td> </tr> <tr> <td height="20" align="left" valign="bottom">PAG-IBIG:</td> <td align="center" valign="bottom">' . $row->pagibig . '</td> </tr> <tr> <td height="20" align="left" valign="bottom">PHILHEALTH:</td> <td align="center" valign="bottom">' . $row->philhealth . '</td> </tr> <tr> <td height="20" align="left" valign="bottom">TIN:</td> <td align="center" valign="bottom">' . $row->tin . '</td> </tr> <tr> <td height="10" colspan="2" align="center"> This card must be surrendered immediately upon termination or separation from service. if found. please send or mail to</td> </tr> <tr> <td align="center" colspan="2"> <b>Provincial Government of Laguna<br>' . $office->office_name . '</b> <br>' . $office->office_address . ' </td> </tr> <tr> <td align="center" colspan="2" height="20" valign="bottom"><b>IN CASE OF EMERGENCY, PLEASE NOTIFY:</b></td> </tr> <tr> <td align="center" colspan="2"><b> <br /> </b></td> </tr> <tr> <td align="center" height="61" colspan="2" style="background-image: url(images/id/gov.signiture.png) no-repeat;"> </td> </tr> </table></td></tr>'; $x = $x + 3; //3 count of generated id per column } $this->mpdf->WriteHTML($html_f); } $tbl_end_b = '</tr></table>'; $this->mpdf->WriteHTML($tbl_end_b); header('Cache-Control: maxage=3600'); //Adjust maxage appropriately header('Pragma: public'); $this->mpdf->Output('dtr/template/id_generated/back_id.pdf', 'F'); return TRUE; }
<div class="clean-green"><?php echo Session::flashData('msg'); ?> </div> <?php } else { } ?> <form action="" method="post"> <table width="100%" border="0" cellpadding="5" cellspacing="5"> <tr> <td align="right"><strong>Office:</strong></td> <td> <?php $o = new Office_m(); $o->get_by_office_id($office_id); echo $o->office_name; ?> </td> <td></td> </tr> <tr> <td align="right"><strong>Division Name:</strong></td> <td><input name="name" type="text" id="name" value="<?php echo $division->name; ?> " size="50" /></td> <td></td> </tr> <tr> <td align="right"><strong>Description:</strong></td>
//output the data $x = 2; $y = 1; $rows = $this->Office_pass->get_office_pass(50); $office = ''; foreach ($rows as $row) { $id = $row['id']; $employee_id = $row['employee_id']; $date = $row['date']; $time_out = $row['time_out']; $time_in = $row['time_in']; $seconds = $row['seconds']; $this->Employee->fields = array('lname', 'fname', 'mname', 'office_id'); $employee = $this->Employee->get_employee_info($employee_id); $office = new Office_m(); $office->get_by_office_id($employee['office_id']); $bg = $this->Helps->set_line_colors(); ?> <tr bgcolor="<?php echo $bg; ?> " onmouseover="this.bgColor = '<?php echo $this->config->item('mouseover_linecolor'); ?> ';" onmouseout ="this.bgColor = '<?php echo $bg; ?> ';" style="border-bottom: 1px solid #999999;"> <td bgcolor=""><input name="employee[]" type="checkbox" value="<?php echo $id;
function preview($rows, $report_name = '') { $html = ' <table width="100%" border="0"> <tr> <td colspan="3" align="center">' . $report_name . '</td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> <table width="100%" border="1"> <tbody><tr> <td width="10%"><strong>Employee ID</strong></td> <td width="9%"><strong>Name</strong></td> <td width="4%"><strong>Sex</strong></td> <td width="10%"><strong>Position/<br /> Designation</strong></td> <td width="13%"><strong>Office / Department</strong></td> <td width="11%"><strong>Employment Status</strong></td> <td width="6%"><strong>Salary Grade</strong></td> <td width="9%"><strong>Eligibility</strong></td> <td width="11%"><strong>Education</strong></td> <td width="8%"><strong>Birthday</strong></td> <td width="9%"><strong>Address</strong></td></tr>'; $params = array('format' => 'Letter-L'); $this->load->library('mpdf', $params); // LOAD a stylesheet $stylesheet = file_get_contents(base_url() . 'css/mpdf/mpdfstyletables.css'); $this->mpdf->WriteHTML($stylesheet, 1); // The parameter 1 tells that this is css/style only and no body/html/text $this->mpdf->WriteHTML($html); $office = new Office_m(); foreach ($rows as $row) { $office->get_by_office_id($row->office_id); $type_employment = $this->options->type_employment(); $birth_date = $row->birth_date; if ($row->birth_date == '0000-00-00') { $birth_date = ''; } $entry = ' <tr> <td>' . $row->employee_id . '</td> <td>' . $row->lname . ',' . $row->fname . ' ' . $row->mname . '</td> <td>' . $row->sex . '</td> <td>' . $row->position . '</td> <td>' . $office->office_name . '</td> <td>' . $type_employment[$row->permanent] . '</td> <td>' . $row->salary_grade . '/' . $row->step . '</td> <td>' . $row->eligibility . '</td> <td>' . $row->education . '</td> <td>' . $birth_date . '</td> <td>' . $row->res_address . '</td> </tr>'; $this->mpdf->WriteHTML($entry); } $signatories = ' <tr><td><p> </p></td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td><td> </td></tr> </tbody></table>'; // Signatories $sr_prepared = Setting::getField('sr_prepared'); $sr_prepared_position = Setting::getField('sr_prepared_position'); $sr_certified = Setting::getField('sr_certified'); $sr_certified_position = Setting::getField('sr_certified_position'); $signatories .= ' <table width="100%" border="0"> <tr> <td width="38%"> </td> <td width="23%"> </td> <td width="39%"> </td> </tr> <tr> <td align="center">PREPARED BY:</td> <td> </td> <td align="center">CERTIFIED CORRECT:</td> </tr> <tr> <td align="center"> </td> <td> </td> <td align="center"> </td> </tr> <tr> <td align="center"> </td> <td> </td> <td align="center"> </td> </tr> <tr> <td align="center">' . $sr_prepared . '</td> <td> </td> <td align="center">' . $sr_certified . '</td> </tr> <tr> <td align="center">' . $sr_prepared_position . '</td> <td> </td> <td align="center">' . $sr_certified_position . '</td> </tr> </table> '; $this->mpdf->WriteHTML($signatories); $this->mpdf->Output('dtr/template/pds/archives/pds_' . date('Y_m_d') . '.pdf', 'F'); return 'dtr/template/pds/archives/pds_' . date('Y_m_d') . '.pdf'; exit; $this->load->helper('settings'); $this->load->library('fpdf'); //define('FPDF_FONTPATH',$this->config->item('fonts_path')); $this->load->library('fpdi'); // initiate FPDI $pdf = new FPDI('L', 'mm', 'Letter'); // add a page $pdf->AddPage(); // set the sourcefile //$pdf->setSourceFile('dtr/template/service_record/service_record.pdf'); // import page 1 //$tplIdx = $pdf->importPage(1); // use the imported page and place it at point 10,10 with a width of 100 mm //$pdf->useTemplate($tplIdx, 1, 1, 210); // now write some text above the imported page $pdf->SetFont('Arial'); $pdf->SetTextColor(0, 0, 0); $pdf->SetXY(15, 60); $pdf->SetFont('Arial', '', 16); $pdf->Cell(0, 3, "Report Name", '', 1, 'C', false); //$pdf->Ln(4); //$e = new Employee_m(); //$e->get_by_employee_id( $employee_id ); $pdf->SetFont('Arial', '', 12); //$pdf->Cell(0,8,"Employee No.:".$e->id ,'',1,'L',false); //$pdf->Ln(2); //$pdf->SetFont('Arial', '', 12); //$pdf->Cell(0,8,"Employee Name:".$e->lname.', '.$e->fname.' '.$e->mname ,'',1,'L',false); $pdf->Ln(4); $pdf->Cell(0, 8, "Emp ID Name Sex Position/Designation Office Employment Status Salary Grade Eligibility Education Birth Day Address", '1', 1, 'L', false); $pdf->Ln(4); $i = 1; $this->load->helper('text'); //$pdf->Cell(30,12, word_wrap('msayado maahhn ndhah ahhhehe so ano gagawin mo now', 10) ,'1',1,'L',false); //$pdf->MultiCell(30,3,word_wrap("hello this is a sample nlong text with line break ", 15) ,'1',1,'L',false); //$pdf->MultiCell(30,3,word_wrap("hello this is a sample nlong text with line break ", 15) ,'0',1,'L',false); foreach ($rows as $row) { $pdf->SetFont('Arial', '', 11); $pdf->SetX(10); //$pdf->Write(0, $row->id); $pdf->Cell(15, 12, $row->id, '1', 0, 'L', false); $pdf->SetX(29); //$pdf->Write(0, $row->lname.', '.$row->fname.''.$row->mname); $pdf->Cell(30, 12, word_wrap($row->lname . ', ' . $row->fname . '' . $row->mname, 10), '1', 1, 'L', false); $pdf->SetFont('Arial', '', 8); $pdf->SetX(62); $pdf->Write(0, $row->sex); $pdf->SetX(75); //$pdf->Write(0, $row->company); $pdf->Write(0, $row->position); //$pdf->SetFont('Arial', '', 12); $pdf->SetX(160); $pdf->Write(0, $row->movement); //$pdf->SetX(150); //$pdf->Write(0, $row->salary_grade); $pdf->SetFont('Arial', '', 8); $pdf->SetX(185); //$pdf->Write(0, $row->status); if ($row->govt_service == 1) { $row->govt_service = 'Yes'; } else { $row->govt_service = 'No'; } $pdf->SetX(190); //$pdf->Write(0, $row->govt_service); $pdf->SetFont('Arial', '', 12); if ($i == 6 || $i == 10 || $i == 13 || $i == 16 || $i == 19 || $i == 22) { $pdf->Ln(8); } else { $pdf->Ln(7); } $i++; } $pdf->Cell(0, 8, "--------------------------------------------------------- Nothing Follows ---------------------------------------------------------", '', 1, 'C', false); // Signatories $pdf->Ln(15); $pdf->SetX(20); $pdf->Cell(90, 5, "PREPARED BY:", '0', 0, 'C', false); $pdf->Cell(90, 5, "CERTIFIED CORRECT:", '0', 1, 'C', false); $pdf->Ln(10); $sr_prepared = Setting::getField('sr_prepared'); $sr_prepared_position = Setting::getField('sr_prepared_position'); $sr_certified = Setting::getField('sr_certified'); $sr_certified_position = Setting::getField('sr_certified_position'); $pdf->SetX(20); $pdf->Cell(90, 5, $sr_prepared, '0', 0, 'C', false); //4th param border $pdf->Cell(90, 5, $sr_certified, '0', 1, 'C', false); $pdf->SetX(20); $pdf->Cell(90, 5, $sr_prepared_position, '0', 0, 'C', false); $pdf->Cell(90, 5, $sr_certified_position, '0', 1, 'C', false); // Output $pdf->Output('dtr/template/pds/archives/pds_' . date('Y_m_d') . '.pdf', 'F'); return 'dtr/template/pds/archives/pds_' . date('Y_m_d') . '.pdf'; }