function up()
 {
     $lgu_code = Setting::getField('lgu_code');
     if ($lgu_code == '') {
         if ($this->db->table_exists('pds_profile')) {
             $this->db->order_by('id');
             $q = $this->db->get('pds_profile');
             if ($q->num_rows() > 0) {
                 foreach ($q->result_array() as $row) {
                     $p = new Employee_m();
                     $p->get_by_id($row['employee_id']);
                     $p->item_number = $row['item_number'];
                     $p->last_promotion = $row['last_promotion'];
                     $p->level = $row['level'];
                     $p->eligibility = $row['eligibility'];
                     $p->graduated = $row['graduated'];
                     $p->course = $row['course'];
                     $p->units = $row['units'];
                     $p->post_grad = $row['post_grad'];
                     $p->save();
                 }
             }
         }
     }
 }
 function up()
 {
     // Do only if Province of Laguna
     $lgu_code = Setting::getField('lgu_code');
     if ($lgu_code == 'laguna_province') {
         $o = new Office_m();
         $offices = $o->get();
         foreach ($offices as $office) {
             // Select all employees by office
             $e = new Employee_m();
             $employees = $e->get_by_office_id($office->office_id);
             $office_id = sprintf("%03d", $office->office_id);
             // Add leading zeros
             $i = 1;
             foreach ($employees as $employee) {
                 // Lets update the employee id
                 $employee_id = sprintf("%03d", $i);
                 // Add leading zeros
                 $update_employee = new Employee_m();
                 $update_employee->get_by_id($employee->id);
                 $update_employee->employee_id = $office_id . $employee_id;
                 $update_employee->save();
                 $i++;
             }
         }
     }
 }
 function up()
 {
     if ($this->db->table_exists('pds_personal_info')) {
         $q = $this->db->get('pds_personal_info');
         if ($q->num_rows() > 0) {
             foreach ($q->result_array() as $row) {
                 $e = new Employee_m();
                 $e->get_by_id($row['employee_id']);
                 $e->birth_date = $row['birth_date'];
                 $e->sex = $row['sex'];
                 $e->save();
             }
         }
     }
 }
 function up()
 {
     if ($this->db->table_exists('training_attendees')) {
         $q = $this->db->get('training_attendees');
         if ($q->num_rows() > 0) {
             foreach ($q->result_array() as $row) {
                 $e = new Employee_m();
                 $e->get_by_id($row['employee_id']);
                 if (!$e->exists()) {
                     $this->db->where('id', $row['id']);
                     $this->db->delete('training_attendees');
                     //echo $this->db->last_query().'<br>';
                 }
             }
         }
         $this->db->where('event_id', 0);
         $this->db->delete('training_attendees');
     }
 }
示例#5
0
	</tr>
	<?php 
$i = 0;
?>
	<?php 
$p = new Plantilla_m();
?>
	<?php 
foreach ($rows as $row) {
    ?>
	<?php 
    $p->where('year', $year);
    $p->where('plantilla_item_id', $row->id);
    $p->get();
    $e = new Employee_m();
    $e->get_by_id($p->employee_id);
    // last param of dg_editCell is the size of the textbox
    $onclick0 = "onClick=\"dg_editCell(offices,'" . $p->id . "','item_no','offices.0.{$i}', 'plantilla')\"";
    $onclick1 = "onClick=\"dg_editCell(offices,'" . $p->id . "','position','offices.1.{$i}', 'plantilla', '40')\"";
    $onclick2 = "onClick=\"dg_editCell(offices,'" . $p->id . "','year','offices.2.{$i}', 'plantilla', '8')\"";
    $onclick3 = "onClick=\"dg_editCell(offices,'" . $p->id . "','sg','offices.3.{$i}', 'plantilla', '5')\"";
    $onclick4 = "onClick=\"dg_editCell(offices,'" . $p->id . "','amount','offices.4.{$i}', 'plantilla', '10')\"";
    ?>
	<?php 
    $bg = $this->Helps->set_line_colors();
    ?>
	<tr bgcolor="<?php 
    echo $bg;
    ?>
" onmouseover="this.bgColor = '<?php 
    echo $this->config->item('mouseover_linecolor');
示例#6
0
    function sr_print_preview($employee_id = '', $report_name = '')
    {
        $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');
        $logo = 'dtr/template/logo/logo.jpg';
        // Laguna Province
        if ($lgu_code == 'laguna_province') {
            $logo = 'dtr/template/laguna_province/logo.jpg';
        }
        $employee = new Employee_m();
        $employee->get_by_id($employee_id);
        $personal = new Personal();
        $personal->get_by_employee_id($employee_id);
        // 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');
        $service = '<table width="100%" border="0" cellpadding="5" cellspacing="5">
  <tr>
    <td colspan="5" align="center" style="font-size:25px"><strong>SERVICE RECORD</strong></td>
  </tr>
  <tr>
    <td width="24%" align="left"><strong>Employee Number :</strong></td>
    <td width="22%"><b>' . $employee->employee_id . '</b></td>
    <td width="15%">&nbsp;</td>
    <td width="29%">&nbsp;</td>
    <td width="10%">&nbsp;</td>
  </tr>
  <tr>
    <td align="left"><strong>Name :</strong></td>
    <td colspan="3" style="font-family:\'Times New Roman\', Times, serif"><em><b>' . $employee->lname . ',   ' . $employee->fname . '    ' . $employee->mname . '</b></em></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="left"><strong>Birthday :</strong></td>
    <td><em><b>' . $employee->birth_date . '</b></em></td>
    <td align="right"><strong>Birthplace :</strong></td>
    <td><em><b>' . $personal->birth_place . '</b></em></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="5" align="left" style="font-size:11px"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>This is to certify that the employee named herein above actually rendered services in this Office as shown by the service record below, each line of which is supported by appointment and other papers actually issued by this Office and approved by the authorities concerned.</em></td>
  </tr>
</table>


<table width="100%" border="1">
  <tr>
    <td colspan="2" align="center" valign="middle">SERVICE<br />
    (Inclusive Date)</td>
    <td colspan="3" align="center" valign="middle">RECORDS OF APPOINTMENT</td>
    <td align="center" valign="middle">OFFICE ENTITY / DIVISION</td>
    <td align="center" valign="middle">L/V ABS<br />
    W/O PAY</td>
    <td colspan="2" align="center" valign="middle">SEPARATION</td>
  </tr>
  <tr>
    <td align="center">From</td>
    <td align="center">To</td>
    <td align="center">Designation</td>
    <td align="center">Status</td>
    <td align="center">Salary</td>
    <td align="center">Station/Place of Assignment/Branch</td>
    <td align="center">&nbsp;</td>
    <td align="center">Date</td>
    <td align="center">Cause</td>
  </tr>



';
        $html = '
<!-- defines the headers/footers - this must occur before the headers/footers are set -->

<!--mpdf
<htmlpagefooter name="myfooter">
<table width="100%">
  <tr>
    <td colspan="3" align="center">-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  </td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Issued in compliance with Executive Order No. 54 Dated August 10, 1954, and in accordance with Circular No. 58, dated August 10, 1954, of the System.</td>
  </tr>
  <tr>
    <td width="19%">&nbsp;</td>
    <td width="42%">&nbsp;</td>
    <td width="39%">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="center">PREPARED BY</td>
    <td align="center">CERTIFIED CORRECT</td>
  </tr>
  <tr>
    <td align="center">' . date('F d, Y') . '</td>
    <td align="center">&nbsp;</td>
    <td align="center">&nbsp;</td>
  </tr>
  <tr>
    <td align="center">Date</td>
    <td align="center">&nbsp;</td>
    <td align="center">&nbsp;</td>
  </tr>
  <tr>
    <td align="center">&nbsp;</td>
    <td align="center">' . $sr_prepared . '</td>
    <td align="center">' . $sr_certified . '</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="center">' . $sr_prepared_position . '</td>
    <td align="center">' . $sr_certified_position . '</td>
  </tr>
</table></htmlpagefooter>

mpdf-->

<!-- set the headers/footers - they will occur from here on in the document -->
<!--mpdf
<sethtmlpagefooter name="myfooter" page="all" value="1"/>
mpdf-->

<table width="100%" border="0">
  <tr>
    <td>&nbsp;</td>
    <td align="center" style="font-family:\'Times New Roman\', Times, serif"><b><em>' . $a . '</em></b></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="center" style="font-family:\'Times New Roman\', Times, serif"><b><em>' . $b . '</em></b></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="center" style="font-family:\'Times New Roman\', Times, serif"><b><em>' . $c . '</em></b></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="center" style="font-family:\'Times New Roman\', Times, serif"><b><em>' . $d . '</em></b></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<style type="text/css">
#apDiv1 {
	position:absolute;
	width:104px;
	height:106px;
	z-index:1;
	left: 100px;
	top: 55px;
}
</style>
<div id="apDiv1"><img src="' . base_url() . $logo . '" alt="" name="logo" width="110" height="110"/></div>

' . $service;
        $s = new Service_record();
        //$s->order_by('date_from');
        $s->select('id, employee_id, date_from, date_to, designation, status, salary, office_entity, branch, remarks, lwop, separation_date, separation_cause, STR_TO_DATE(date_from,"%m/%d/%Y") as nice_date', false);
        $s->order_by("nice_date");
        $rows = $s->get_by_employee_id($employee_id);
        $i = 1;
        // Number of entries to display per page
        $first_page = Setting::getField('service_record_entries_first_page');
        $second_page = Setting::getField('service_record_entries_second_page');
        $third_page = Setting::getField('service_record_entries_3rd_page');
        $fourth_page = Setting::getField('service_record_entries_4th_page');
        //for ($i ==0; $i != 70; $i ++)
        foreach ($rows as $row) {
            $number_character = strlen($row->designation . $row->salary . $row->salary . $row->office_entity . $row->lwop . $row->separation_date . $row->separation_cause);
            $html .= '<tr>
				<td align="center">' . $row->date_from . '</td>
				<td align="center">' . $row->date_to . '</td>
				<td align="center">' . $row->designation . '</td>
				<td align="center">' . $row->status . '</td>
				<td align="right">' . $row->salary . '</td>
				<td align="center">' . $row->office_entity . '</td>
				<td align="left">' . $row->lwop . '</td>
				<td align="left">' . $row->separation_date . '</td>
				<td align="left" style="font-size:7">' . $row->separation_cause . '</td>
			  </tr>';
            // Second page
            if ($i == $first_page) {
                $html .= '</table>';
                // close the table
                $html .= '<pagebreak />' . $service;
            }
            // If there is third page
            if ($i == $first_page + $second_page) {
                $html .= '</table>';
                // close the table
                $html .= '<pagebreak />' . $service;
            }
            // If there is 4th page
            if ($i == $first_page + $second_page + $third_page) {
                $html .= '</table>';
                // close the table
                $html .= '<pagebreak />' . $service;
            }
            // If there is 5th page
            if ($i == $first_page + $second_page + $third_page + $fourth_page) {
                $html .= '</table>';
                // close the table
                $html .= '<pagebreak />' . $service;
            }
            $i++;
        }
        $html .= '</table>';
        //$html.='
        //<pagebreak />
        //'.$service.'</table>
        //<pagebreak />
        //';
        $params = array('format' => 'Letter');
        $params = array('format' => 'Legal');
        $params = array('format' => Setting::getField('service_record_paper_size'));
        $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->SetHTMLHeader('Page {PAGENO} of {nb}', '', false);
        //$this->mpdf->SetHTMLFooter('{PAGENO}');
        $this->mpdf->WriteHTML($html);
        $this->mpdf->Output();
    }
示例#7
0
 function employees($employee_id = '')
 {
     $data['page_name'] = '<b>Employee\'s Training Record</b>';
     $data['focus_field'] = 'tra_name';
     $data['msg'] = '';
     $employee_id = Input::get('employee_id');
     $e = new Employee_m();
     $data['employee'] = $e->get_by_id(Input::get('employee_id'));
     $data['pics'] = file_exists('pics/' . $e->pics) ? $e->pics : 'not_available.jpg';
     $image_properties = array('src' => base_url() . 'pics/' . $data['pics'], 'width' => '140', 'height' => '140');
     $data['pics'] = $image_properties;
     $em = new Employee_movement_m();
     $em->get_by_id($e->employee_movement_id);
     $data['employment_movement'] = $em->employee_movement;
     if (Input::get('op')) {
         // TRAINING PROGRAMS=========================
         $tra_name = Input::get('tra_name');
         $tra_date_from = Input::get('tra_date_from');
         $tra_date_to = Input::get('tra_date_to');
         $tra_hours = Input::get('tra_hours');
         $tra_conduct = Input::get('tra_conduct');
         $tra_location = Input::get('tra_location');
         $t = new Training();
         $t->get_by_employee_id($employee_id);
         $t->delete_all();
         $i = 0;
         foreach ($tra_name as $tra) {
             if ($tra != "") {
                 $t = new Training();
                 $t->employee_id = $employee_id;
                 $t->name = $tra_name[$i];
                 $t->date_from = $tra_date_from[$i];
                 $t->date_to = $tra_date_to[$i];
                 $t->number_hours = $tra_hours[$i];
                 $t->conducted_by = $tra_conduct[$i];
                 $t->location = $tra_location[$i];
                 $t->save();
             }
             $i++;
         }
         $data['msg'] = 'Trainings has been saved!';
     }
     // Recommended trainings
     if (Input::get('op2')) {
         $recommends = Input::get('recommend_id');
         $reco_year = Input::get('reco_year');
         $course_id = Input::get('course_id');
         $relevant = Input::get('relevant');
         $reco_remarks = Input::get('reco_remarks');
         $i = 0;
         foreach ($recommends as $r_id) {
             if ($reco_year[$i] != '') {
                 $t = new Training_recomended_m();
                 $t->where('course_id', $course_id[$i]);
                 $t->where('reco_year', $reco_year[$i]);
                 $t->where('employee_id', $employee_id);
                 $t->get();
                 $t->employee_id = $employee_id;
                 $t->reco_year = $reco_year[$i];
                 $t->course_id = $course_id[$i];
                 $t->relevant = $relevant[$i];
                 $t->reco_remarks = $reco_remarks[$i];
                 $t->save();
             }
             $i++;
         }
         // Remove checked
         if (Input::get('remove')) {
             foreach (Input::get('remove') as $recommended_id) {
                 $t = new Training_recomended_m();
                 $t->get_by_id($recommended_id);
                 $t->delete();
             }
         }
     }
     // Actual duties
     if (Input::get('op3')) {
         $duties_ids = Input::get('duties_id');
         $duty_from = Input::get('duty_from');
         $duty_to = Input::get('duty_to');
         $duty_desc = Input::get('duty_desc');
         $i = 0;
         foreach ($duties_ids as $r_id) {
             if ($duty_from[$i] != '') {
                 $ed = new Employee_duty_m();
                 $ed->get_by_id($r_id);
                 $ed->employee_id = $employee_id;
                 $ed->duty_from = $duty_from[$i];
                 $ed->duty_to = $duty_to[$i];
                 $ed->duty_desc = $duty_desc[$i];
                 $ed->save();
             }
             $i++;
         }
     }
     // Training===========================================================
     $t = new Training();
     $t->order_by('date_from', 'DESC');
     $data['trains'] = $t->get_by_employee_id($employee_id);
     $data['tra_location_options'] = array('local' => 'Local', 'regional' => 'Regional', 'national' => 'National', 'international' => 'International');
     if ($employee_id == '') {
         $data['trains'] = array();
     }
     // Recommended Trainings
     $t = new Training_recomended_m();
     $t->order_by('reco_year');
     $data['recommends'] = $t->get_by_employee_id($employee_id);
     // Actual Duties
     $ed = new Employee_duty_m();
     $ed->order_by('duty_from');
     $data['duties'] = $ed->get_by_employee_id($employee_id);
     $data['selected'] = $e->office_id;
     //Use for office listbox
     $data['options'] = $this->options->office_options();
     // Courses
     $t = new Training_course();
     $data['courses'] = $t->courses();
     $data['employee_id'] = $employee_id;
     $data['main_content'] = 'employees';
     return View::make('includes/template', $data);
 }
示例#8
0
 function front_id($results)
 {
     $this->load->helper('settings');
     //print preview of MR
     $this->load->library('fpdf');
     $this->load->library('fpdi');
     // initiate FPDI
     $pdf = new FPDI('L');
     // add a page
     $pdf->AddPage();
     // set the sourcefile
     $pagecount = $pdf->setSourceFile('pdf-report/id/front-id.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);
     //367
     // now write some text above the imported page
     $pdf->SetTextColor(0, 0, 0);
     $pdf->SetFont('Arial', '', 9);
     $n = 1;
     foreach ($results as $result) {
         $s = new Employee_m();
         $row = $s->get_by_id($result->employee_id);
         if ($n == 11) {
             //add new page
             $pdf->addPage();
             for ($n = 1; $n <= 1; $n++) {
                 $tplidx = $pdf->ImportPage(1);
                 $pdf->useTemplate($tplIdx);
                 //, 1, 1, 210
             }
             $n = $n - 1;
         }
         //======================== START Column 1 ==============================
         $pic = 'pics/not_available.png';
         $photo = 'pics/' . $row->employee_id . '.png';
         if (file_exists($photo)) {
             $pic = 'pics/' . $row->employee_id . '.png';
         }
         //signature
         $sign = 'pics/signatures/' . $row->employee_id . '.png';
         $employee_id = $row->employee_id;
         $name = utf8_decode($row->fname . ' ' . $row->lname);
         $lblname = 'NAME';
         $office = 'LAGUNA UNIVERSITY';
         $position = $row->position;
         $fs = '11.5';
         if (strlen($name) >= 22) {
             $fs = '9';
         }
         //----------------------------- Row 1 ----------------------------------
         if ($n == 1) {
             //Employee number
             $pdf->SetTextColor(0, 0, 0);
             $pdf->SetFont('Arial', 'B', 9);
             $pdf->SetXY(18.5, 29);
             $pdf->Cell(30, 0, 'EMP No. ' . $employee_id, '0', 0, 'C', false);
             //Employee Photo 2x3
             $pdf->image($pic, 17.5, 31, 32, 37);
             //x, y, w, h
             //Employee name
             $pdf->SetFont('Arial', 'B', $fs);
             $pdf->SetXY(18.5, 71);
             $pdf->Cell(30, 0, strtoupper($name), '0', 0, 'C', false);
             //label name
             $pdf->SetFont('Arial', '', 5);
             $pdf->SetXY(18.5, 74);
             $pdf->Cell(30, 0, $lblname, '0', 0, 'C', false);
             //Signature
             if (file_exists($sign)) {
                 $pdf->image($sign, 20, 75, 25, 10);
                 //x, y, w, h
             }
             //label signature
             $pdf->SetXY(18.5, 83);
             $pdf->Cell(30, 0, 'SIGNATURE', '0', 0, 'C', false);
             //Office
             $pdf->SetTextColor(255, 255, 255);
             //r, g ,b
             $pdf->SetFont('Arial', 'B', 13);
             $pdf->SetXY(18.5, 88);
             $pdf->Cell(30, 0, $office, '0', 0, 'C', false);
             //Position
             $pdf->SetTextColor(255, 255, 0);
             $pdf->SetFont('Arial', '', 10);
             $pdf->SetXY(18.5, 94);
             $pdf->Cell(30, 0, strtoupper($position), '0', 0, 'C', false);
         }
         //----------------------------- Row 2 ----------------------------------
         if ($n == 2) {
             //Employee number
             $pdf->SetTextColor(0, 0, 0);
             $pdf->SetFont('Arial', 'B', 9);
             $pdf->SetXY(76.5, 29);
             $pdf->Cell(30, 0, 'EMP No. ' . $employee_id, '0', 0, 'C', false);
             //Employee Photo 2x3
             $pdf->image($pic, 75.5, 31, 32, 37);
             //x, y, w, h
             //Employee name
             $pdf->SetFont('Arial', 'B', $fs);
             $pdf->SetXY(76.5, 71);
             $pdf->Cell(30, 0, strtoupper($name), '0', 0, 'C', false);
             //label name
             $pdf->SetFont('Arial', '', 5);
             $pdf->SetXY(76.5, 74);
             $pdf->Cell(30, 0, $lblname, '0', 0, 'C', false);
             //Signature
             if (file_exists($sign)) {
                 $pdf->image($sign, 78, 75, 25, 10);
                 //x, y, w, h
             }
             //label signature
             $pdf->SetXY(76.5, 83);
             $pdf->Cell(30, 0, 'SIGNATURE', '0', 0, 'C', false);
             //Office
             $pdf->SetTextColor(255, 255, 255);
             //r, g ,b
             $pdf->SetFont('Arial', 'B', 13);
             $pdf->SetXY(76.5, 88);
             $pdf->Cell(30, 0, $office, '0', 0, 'C', false);
             //Position
             $pdf->SetTextColor(255, 255, 0);
             $pdf->SetFont('Arial', '', 10);
             $pdf->SetXY(76.5, 94);
             $pdf->Cell(30, 0, strtoupper($position), '0', 0, 'C', false);
         }
         //----------------------------- Row 3 ----------------------------------
         if ($n == 3) {
             //Employee number
             $pdf->SetTextColor(0, 0, 0);
             $pdf->SetFont('Arial', 'B', 9);
             $pdf->SetXY(134.5, 29);
             $pdf->Cell(30, 0, 'EMP No. ' . $employee_id, '0', 0, 'C', false);
             //Employee Photo 2x3
             $pdf->image($pic, 133.5, 31, 32, 37);
             //x, y, w, h
             //Employee name
             $pdf->SetFont('Arial', 'B', $fs);
             $pdf->SetXY(134.5, 71);
             $pdf->Cell(30, 0, strtoupper($name), '0', 0, 'C', false);
             //label name
             $pdf->SetFont('Arial', '', 5);
             $pdf->SetXY(134.5, 74);
             $pdf->Cell(30, 0, $lblname, '0', 0, 'C', false);
             //Signature
             if (file_exists($sign)) {
                 $pdf->image($sign, 136, 75, 25, 10);
                 //x, y, w, h
             }
             //label signature
             $pdf->SetXY(134.5, 83);
             $pdf->Cell(30, 0, 'SIGNATURE', '0', 0, 'C', false);
             //Office
             $pdf->SetTextColor(255, 255, 255);
             //r, g ,b
             $pdf->SetFont('Arial', 'B', 13);
             $pdf->SetXY(134.5, 88);
             $pdf->Cell(30, 0, $office, '0', 0, 'C', false);
             //Position
             $pdf->SetTextColor(255, 255, 0);
             $pdf->SetFont('Arial', '', 10);
             $pdf->SetXY(134.5, 94);
             $pdf->Cell(30, 0, strtoupper($position), '0', 0, 'C', false);
         }
         //----------------------------- Row 4 ----------------------------------
         if ($n == 4) {
             //Employee number
             $pdf->SetTextColor(0, 0, 0);
             $pdf->SetFont('Arial', 'B', 9);
             $pdf->SetXY(192.5, 29);
             $pdf->Cell(30, 0, 'EMP No. ' . $employee_id, '0', 0, 'C', false);
             //Employee Photo 2x3
             $pdf->image($pic, 191.5, 31, 32, 37);
             //x, y, w, h
             //Employee name
             $pdf->SetFont('Arial', 'B', $fs);
             $pdf->SetXY(192.5, 71);
             $pdf->Cell(30, 0, strtoupper($name), '0', 0, 'C', false);
             //label name
             $pdf->SetFont('Arial', '', 5);
             $pdf->SetXY(192.5, 74);
             $pdf->Cell(30, 0, $lblname, '0', 0, 'C', false);
             //Signature
             if (file_exists($sign)) {
                 $pdf->image($sign, 194, 75, 25, 10);
                 //x, y, w, h
             }
             //label signature
             $pdf->SetXY(192.5, 83);
             $pdf->Cell(30, 0, 'SIGNATURE', '0', 0, 'C', false);
             //Office
             $pdf->SetTextColor(255, 255, 255);
             //r, g ,b
             $pdf->SetFont('Arial', 'B', 13);
             $pdf->SetXY(192.5, 88);
             $pdf->Cell(30, 0, $office, '0', 0, 'C', false);
             //Position
             $pdf->SetTextColor(255, 255, 0);
             $pdf->SetFont('Arial', '', 10);
             $pdf->SetXY(192.5, 94);
             $pdf->Cell(30, 0, strtoupper($position), '0', 0, 'C', false);
         }
         //----------------------------- Row 5 ----------------------------------
         if ($n == 5) {
             //Employee number
             $pdf->SetTextColor(0, 0, 0);
             $pdf->SetFont('Arial', 'B', 9);
             $pdf->SetXY(250.5, 29);
             $pdf->Cell(30, 0, 'EMP No. ' . $employee_id, '0', 0, 'C', false);
             //Employee Photo 2x3
             $pdf->image($pic, 249.5, 31, 32, 37);
             //x, y, w, h
             //Employee name
             $pdf->SetFont('Arial', 'B', $fs);
             $pdf->SetXY(250.5, 71);
             $pdf->Cell(30, 0, strtoupper($name), '0', 0, 'C', false);
             //label name
             $pdf->SetFont('Arial', '', 5);
             $pdf->SetXY(250.5, 74);
             $pdf->Cell(30, 0, $lblname, '0', 0, 'C', false);
             //Signature
             if (file_exists($sign)) {
                 $pdf->image($sign, 252, 75, 25, 10);
                 //x, y, w, h
             }
             //label signature
             $pdf->SetXY(250.5, 83);
             $pdf->Cell(30, 0, 'SIGNATURE', '0', 0, 'C', false);
             //Office
             $pdf->SetTextColor(255, 255, 255);
             //r, g ,b
             $pdf->SetFont('Arial', 'B', 13);
             $pdf->SetXY(250.5, 88);
             $pdf->Cell(30, 0, $office, '0', 0, 'C', false);
             //Position
             $pdf->SetTextColor(255, 255, 0);
             $pdf->SetFont('Arial', '', 10);
             $pdf->SetXY(250.5, 94);
             $pdf->Cell(30, 0, strtoupper($position), '0', 0, 'C', false);
         }
         //======================== END Column 1 ==============================
         //======================== START Column 1 ==============================
         //----------------------------- Row 2 ----------------------------------
         if ($n == 6) {
             //Employee number
             $pdf->SetTextColor(0, 0, 0);
             $pdf->SetFont('Arial', 'B', 9);
             $pdf->SetXY(18.5, 129);
             $pdf->Cell(30, 0, 'EMP No. ' . $employee_id, '0', 0, 'C', false);
             //Employee Photo 2x3
             $pdf->image($pic, 17.5, 132, 32, 37);
             //x, y, w, h
             //Employee name
             $pdf->SetFont('Arial', 'B', $fs);
             $pdf->SetXY(18.5, 172);
             $pdf->Cell(30, 0, strtoupper($name), '0', 0, 'C', false);
             //label name
             $pdf->SetFont('Arial', '', 5);
             $pdf->SetXY(18.5, 175);
             $pdf->Cell(30, 0, $lblname, '0', 0, 'C', false);
             //Signature
             if (file_exists($sign)) {
                 $pdf->image($sign, 20, 176, 25, 10);
                 //x, y, w, h
             }
             //label signature
             $pdf->SetXY(18.5, 184);
             $pdf->Cell(30, 0, 'SIGNATURE', '0', 0, 'C', false);
             //Office
             $pdf->SetTextColor(255, 255, 255);
             //r, g ,b
             $pdf->SetFont('Arial', 'B', 13);
             $pdf->SetXY(18.5, 188.5);
             $pdf->Cell(30, 0, $office, '0', 0, 'C', false);
             //Position
             $pdf->SetTextColor(255, 255, 0);
             $pdf->SetFont('Arial', '', 10);
             $pdf->SetXY(18.5, 200);
             $pdf->Cell(30, -11, strtoupper($position), '0', 0, 'C', false);
         }
         //----------------------------- Row 2 ----------------------------------
         if ($n == 7) {
             //Employee number
             $pdf->SetTextColor(0, 0, 0);
             $pdf->SetFont('Arial', 'B', 9);
             $pdf->SetXY(76.5, 129);
             $pdf->Cell(30, 0, 'EMP No. ' . $employee_id, '0', 0, 'C', false);
             //Employee Photo 2x3
             $pdf->image($pic, 75.5, 132, 32, 37);
             //x, y, w, h
             //Employee name
             $pdf->SetFont('Arial', 'B', $fs);
             $pdf->SetXY(76.5, 172);
             $pdf->Cell(30, 0, strtoupper($name), '0', 0, 'C', false);
             //label name
             $pdf->SetFont('Arial', '', 5);
             $pdf->SetXY(76.5, 175);
             $pdf->Cell(30, 0, $lblname, '0', 0, 'C', false);
             //Signature
             if (file_exists($sign)) {
                 $pdf->image($sign, 78, 176, 25, 10);
                 //x, y, w, h
             }
             //label signature
             $pdf->SetXY(76.5, 184);
             $pdf->Cell(30, 0, 'SIGNATURE', '0', 0, 'C', false);
             //Office
             $pdf->SetTextColor(255, 255, 255);
             //r, g ,b
             $pdf->SetFont('Arial', 'B', 13);
             $pdf->SetXY(76.5, 188.5);
             $pdf->Cell(30, 0, $office, '0', 0, 'C', false);
             //Position
             $pdf->SetTextColor(255, 255, 0);
             $pdf->SetFont('Arial', '', 10);
             $pdf->SetXY(76.5, 200);
             $pdf->Cell(30, -11, strtoupper($position), '0', 0, 'C', false);
         }
         //----------------------------- Row 3 ----------------------------------
         if ($n == 8) {
             //Employee number
             $pdf->SetTextColor(0, 0, 0);
             $pdf->SetFont('Arial', 'B', 9);
             $pdf->SetXY(134.5, 129);
             $pdf->Cell(30, 0, 'EMP No. ' . $employee_id, '0', 0, 'C', false);
             //Employee Photo 2x3
             $pdf->image($pic, 133.5, 132, 32, 37);
             //x, y, w, h
             //Employee name
             $pdf->SetFont('Arial', 'B', $fs);
             $pdf->SetXY(134.5, 172);
             $pdf->Cell(30, 0, strtoupper($name), '0', 0, 'C', false);
             //label name
             $pdf->SetFont('Arial', '', 5);
             $pdf->SetXY(134.5, 175);
             $pdf->Cell(30, 0, $lblname, '0', 0, 'C', false);
             //Signature
             if (file_exists($sign)) {
                 $pdf->image($sign, 136, 176, 25, 10);
                 //x, y, w, h
             }
             //label signature
             $pdf->SetXY(134.5, 184);
             $pdf->Cell(30, 0, 'SIGNATURE', '0', 0, 'C', false);
             //Office
             $pdf->SetTextColor(255, 255, 255);
             //r, g ,b
             $pdf->SetFont('Arial', 'B', 13);
             $pdf->SetXY(134.5, 188.5);
             $pdf->Cell(30, 0, $office, '0', 0, 'C', false);
             //Position
             $pdf->SetTextColor(255, 255, 0);
             $pdf->SetFont('Arial', '', 10);
             $pdf->SetXY(134.5, 200);
             $pdf->Cell(30, -11, strtoupper($position), '0', 0, 'C', false);
         }
         //----------------------------- Row 4 ----------------------------------
         if ($n == 9) {
             //Employee number
             $pdf->SetTextColor(0, 0, 0);
             $pdf->SetFont('Arial', 'B', 9);
             $pdf->SetXY(192.5, 129);
             $pdf->Cell(30, 0, 'EMP No. ' . $employee_id, '0', 0, 'C', false);
             //Employee Photo 2x3
             $pdf->image($pic, 191.5, 132, 32, 37);
             //x, y, w, h
             //Employee name
             $pdf->SetFont('Arial', 'B', $fs);
             $pdf->SetXY(192.5, 172);
             $pdf->Cell(30, 0, strtoupper($name), '0', 0, 'C', false);
             //label name
             $pdf->SetFont('Arial', '', 5);
             $pdf->SetXY(192.5, 175);
             $pdf->Cell(30, 0, $lblname, '0', 0, 'C', false);
             //Signature
             if (file_exists($sign)) {
                 $pdf->image($sign, 194, 176, 25, 10);
                 //x, y, w, h
             }
             //label signature
             $pdf->SetXY(192.5, 184);
             $pdf->Cell(30, 0, 'SIGNATURE', '0', 0, 'C', false);
             //Office
             $pdf->SetTextColor(255, 255, 255);
             //r, g ,b
             $pdf->SetFont('Arial', 'B', 13);
             $pdf->SetXY(192.5, 188.5);
             $pdf->Cell(30, 0, $office, '0', 0, 'C', false);
             //Position
             $pdf->SetTextColor(255, 255, 0);
             $pdf->SetFont('Arial', '', 10);
             $pdf->SetXY(192.5, 200);
             $pdf->Cell(30, -11, strtoupper($position), '0', 0, 'C', false);
         }
         //----------------------------- Row 5 ----------------------------------
         if ($n == 10) {
             //Employee number
             $pdf->SetTextColor(0, 0, 0);
             $pdf->SetFont('Arial', 'B', 9);
             $pdf->SetXY(250.5, 129);
             $pdf->Cell(30, 0, 'EMP No. ' . $employee_id, '0', 0, 'C', false);
             //Employee Photo 2x3
             $pdf->image($pic, 249.5, 132, 32, 37);
             //x, y, w, h
             //Employee name
             $pdf->SetFont('Arial', 'B', $fs);
             $pdf->SetXY(250.5, 172);
             $pdf->Cell(30, 0, strtoupper($name), '0', 0, 'C', false);
             //label name
             $pdf->SetFont('Arial', '', 5);
             $pdf->SetXY(250.5, 175);
             $pdf->Cell(30, 0, $lblname, '0', 0, 'C', false);
             //Signature
             if (file_exists($sign)) {
                 $pdf->image($sign, 252, 176, 25, 10);
                 //x, y, w, h
             }
             //label signature
             $pdf->SetXY(250.5, 184);
             $pdf->Cell(30, 0, 'SIGNATURE', '0', 0, 'C', false);
             //Office
             $pdf->SetTextColor(255, 255, 255);
             //r, g ,b
             $pdf->SetFont('Arial', 'B', 13);
             $pdf->SetXY(250.5, 188.5);
             $pdf->Cell(30, 0, $office, '0', 0, 'C', false);
             //Position
             $pdf->SetTextColor(255, 255, 0);
             $pdf->SetFont('Arial', '', 10);
             $pdf->SetXY(250.5, 200);
             $pdf->Cell(30, -11, strtoupper($position), '0', 0, 'C', false);
         }
         $n++;
         //======================== END Column 2 ==============================
     }
     // Output
     $pdf->Output('pdf-report/front-id.pdf', 'F');
     return 'pdf-report/front-id.pdf';
 }
示例#9
0
 /**
  * Enter description here...
  *
  * @param unknown_type $employee_id
  * @param unknown_type $office_id
  * @param unknown_type $page
  */
 function edit_employee($employee_id = '', $office_id = '', $page = '')
 {
     $data['page_name'] = '<b>Edit Employee</b>';
     $data['msg'] = '';
     $this->Employee->fields = array('shift_id', 'friday_exempted', 'office_id', 'detailed_office_id', 'permanent', 'first_day_of_service', 'position', 'assistant_dept_head', 'employee_id', 'division_id', 'salary_grade', 'step', 'pics', 'id', 'salut', 'lname', 'fname', 'mname', 'extension', 'orig_id', 'emergency_contact', 'emergency_contact_no');
     $employee_info = $this->Employee->get_employee_info($employee_id);
     if ($employee_id == '') {
         $employee_info = $this->Employee->get_employee_info(Input::get('orig_id'));
     }
     $shift_id_from_select = $employee_info['shift_id'];
     //Use for office listbox
     $data['options'] = $this->options->office_options();
     $data['selected'] = $employee_info['office_id'];
     $data['division_id'] = $employee_info['division_id'];
     //for detailed office
     $data['detailed_options'] = $this->options->office_options($add_select = TRUE);
     $data['detailed_selected'] = $employee_info['detailed_office_id'];
     //dropdown for type of employment
     $data['permanent_options'] = $this->options->type_employment();
     $data['permanent_options_selected'] = $employee_info['permanent'];
     $data['first_day_of_service'] = $employee_info['first_day_of_service'];
     $data['position'] = $employee_info['position'];
     $data['assistant_dept_head'] = $employee_info['assistant_dept_head'];
     $data['employee_id'] = $employee_info['employee_id'];
     $data['friday_exempted'] = $employee_info['friday_exempted'];
     //Salary grade options
     $data['sg_options'] = $this->options->salary_grade();
     //step increment
     $data['step_options'] = $this->options->step();
     $data['sg_selected'] = $employee_info['salary_grade'];
     $data['step_selected'] = $employee_info['step'];
     $data['page'] = $this->uri->segment(5);
     $data['office_return'] = $this->uri->segment(4);
     $data['image_file_name'] = $employee_info['pics'];
     //Shift List
     $data['shifts_options'] = $this->options->shift();
     $data['shift2'] = $employee_info['shift_id'];
     if ($employee_info['pics'] == '' || !file_exists('pics/' . $employee_info['pics'])) {
         $data['image_file_name'] = 'not_available.jpg';
     }
     $data['id'] = $employee_info['id'];
     $data['salutation'] = $employee_info['salut'];
     $data['lname'] = $employee_info['lname'];
     $data['fname'] = $employee_info['fname'];
     $data['mname'] = $employee_info['mname'];
     $data['extension'] = $employee_info['extension'];
     //The original employee id
     $data['orig_id'] = $employee_info['id'];
     $data['emergency_contact'] = $employee_info['emergency_contact'];
     $data['emergency_contact_no'] = $employee_info['emergency_contact_no'];
     if (Input::get('op')) {
         $orig_id = Input::get('orig_id');
         $id = Input::get('id');
         if ($employee_id != Input::get('employee_id')) {
             $this->form_validation->set_rules('employee_id', 'Employee ID', 'required|callback_employee_id_check');
         }
         $this->form_validation->set_rules('salutation', 'Salutation', 'required');
         $this->form_validation->set_rules('lname', 'Last Name', 'required');
         $this->form_validation->set_rules('fname', 'First Name', 'required');
         $this->form_validation->set_rules('position', 'Position', 'required');
         $this->form_validation->set_rules('extension', 'First Name', '');
         $this->form_validation->set_rules('permanent', 'Type of employment', 'required');
         if ($this->form_validation->run($this) == FALSE) {
             $data['selected'] = Input::get('office_id');
             $data['detailed_selected'] = Input::get('detailed_office_id');
             $data['employee_id'] = Input::get('employee_id');
             $data['page'] = Input::get('page');
             $data['office_return'] = Input::get('office_return');
         } else {
             if (Input::get('employee_id') != $employee_info['employee_id']) {
                 $em = new Employee_m();
                 $em->get_by_id($orig_id);
                 $em->orig_id = $employee_info['employee_id'];
                 $em->save();
                 # code...
             }
             //echo $orig_id;
             //echo Input::get('employee_id');
             //var_dump($employee_info['employee_id']);
             //var_dump($employee_info['orig_id']);
             //exit;
             $info = array('employee_id' => Input::get('employee_id'), 'lname' => Input::get('lname'), 'fname' => Input::get('fname'), 'mname' => Input::get('mname'), 'extension' => Input::get('extension'), 'office_id' => Input::get('office_id'), 'division_id' => Input::get('division_id'), 'section_id' => Input::get('section_id'), 'detailed_office_id' => Input::get('detailed_office_id'), 'salut' => Input::get('salutation'), 'permanent' => Input::get('permanent'), 'first_day_of_service' => Input::get('first_day_of_service'), 'salary_grade' => Input::get('sg'), 'step' => Input::get('step'), 'position' => Input::get('position'), 'assistant_dept_head' => Input::get('assistant_dept_head'), 'shift_id' => Input::get('shift2'), 'shift_type' => Input::get('shift2'), 'friday_exempted' => Input::get('friday_exempted'), 'updated' => 1, 'emergency_contact' => Input::get('emergency_contact'), 'emergency_contact_no' => Input::get('emergency_contact_no'));
             //$data['emergency_contact'] = $employee_info['emergency_contact'];
             //File name of the photo
             $file_register = Session::get('file_register');
             if ($file_register) {
                 $info['pics'] = $file_register;
                 $info['finger_pics'] = '/../' . current_work_dir() . '/pics/' . Session::get('file_register');
             }
             $this->Employee->update_employee($info, $id);
             $this->Logs->insert_logs('employees', 'EDIT EMPLOYEE', 'Edit employee (' . $id . ')', $id);
             $page = Input::get('page');
             $office_return = Input::get('office_return');
             // Use for messaging
             Session::flash('msg', 'Employee updated!');
             return Redirect::to('employees/index/' . $page . '/' . $office_return, 'refresh');
         }
     }
     $data['main_content'] = 'edit_employee';
     return View::make('includes/template', $data);
 }
示例#10
0
    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 = "&quot;" . $row->blood_type . "&quot;";
            }
            $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>&nbsp;<br />&nbsp;</b></td>
  						  </tr>
						  <tr>
						    <td align="center" height="61" colspan="2" style="background-image: url(images/id/gov.signiture.png) no-repeat;">&nbsp;</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>&nbsp;<br />&nbsp;</b></td>
  						  </tr>
						  <tr>
						    <td align="center" height="61" colspan="2" style="background-image: url(images/id/gov.signiture.png) no-repeat;">&nbsp;</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;
    }
示例#11
0
<table width="100%" border="0" class="type-one">
      <tr class="type-one-header">
        <th width="8%" bgcolor="#D6D6D6"><strong>Employee No.</strong></th>
        <th width="25%" bgcolor="#D6D6D6"><strong>Employee Name</strong></th>
        <th width="30%" bgcolor="#D6D6D6"><strong>Department / Office</strong></th>
      <th width="8%" bgcolor="#D6D6D6"><strong>Status</strong></th>
          <th width="10%" bgcolor="#D6D6D6"><strong>Date Requested</strong></th>
        <th width="30%" bgcolor="#D6D6D6"><strong>Action</strong></th>
  </tr>
	  
	  <?php 
$add_to_cart = '';
foreach ($results as $result) {
    //get by employee ID
    $e = new Employee_m();
    $rows = $e->get_by_id($result->employee_id);
    if ($e->count() >= '1') {
        foreach ($rows as $row) {
            if ($row->id == $result->employee_id) {
                $add_to_cart = "<a href='" . base_url() . "employees/remove_cart/" . $page . "/" . $row->id . "/1'>Remove to Request<a>";
            }
        }
    }
    $office_name = $this->Office->get_office_name($row->office_id);
    $pics = $row->pics;
    if ($pics == "" || !file_exists("pics/{$pics}")) {
        $pics = 'not_available.jpg';
    }
    $bg = $this->Helps->set_line_colors();
    ?>
<tr bgcolor="<?php 
示例#12
0
 function preview($employee_id)
 {
     $this->load->helper('settings');
     $this->load->library('fpdf');
     //define('FPDF_FONTPATH',$this->config->item('fonts_path'));
     $this->load->library('fpdi');
     //$pi = new Personal();
     //$pi->get_by_employee_id( $employee_id );
     //print_r($personal_info);
     // initiate FPDI
     $pdf = new FPDI('P', '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, "Employee's Service Record", '', 1, 'C', false);
     $pdf->Ln(4);
     $e = new Employee_m();
     $e->get_by_id($employee_id);
     $pdf->SetFont('Arial', '', 12);
     $pdf->Cell(0, 8, "Employee No.:" . $e->employee_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, "Date From Date To   Position                               Department                        Movement Status   Status", '1', 1, 'L', false);
     $pdf->Ln(4);
     $work = new Work();
     $work->where('govt_service', '1');
     $work->order_by('inclusive_date_from', 'DESC');
     $works = $work->get_by_employee_id($employee_id);
     $i = 1;
     $this->load->helper('text');
     foreach ($works as $work) {
         $pdf->SetFont('Arial', '', 8);
         $pdf->SetX(10);
         list($year, $month, $day) = explode('-', $work->inclusive_date_from);
         $inclusive_date_from = $month . '/' . $day . '/' . $year;
         $pdf->Write(0, $inclusive_date_from);
         list($year, $month, $day) = explode('-', $work->inclusive_date_to);
         $inclusive_date_to = $month . '/' . $day . '/' . $year;
         if ($work->inclusive_date_to == 'Present') {
             $inclusive_date_to = 'Present';
         }
         $pdf->SetX(29);
         $pdf->Write(0, $inclusive_date_to);
         $pdf->SetFont('Arial', '', 8);
         $pdf->SetX(50);
         $pdf->Write(0, str_replace('&#8230;', '..', character_limiter($work->position, 35)));
         $pdf->SetX(100);
         //$pdf->Write(0, $work->company);
         $pdf->Write(0, str_replace('&#8230;', '..', character_limiter($work->company, 35)));
         //$pdf->SetFont('Arial', '', 12);
         $pdf->SetX(160);
         $pdf->Write(0, $work->movement);
         //$pdf->SetX(150);
         //$pdf->Write(0, $work->salary_grade);
         $pdf->SetFont('Arial', '', 8);
         $pdf->SetX(185);
         $pdf->Write(0, $work->status);
         $work->govt_service = $work->govt_service == 1 ? 'Yes' : 'No';
         $pdf->SetX(190);
         //$pdf->Write(0, $work->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/service_record/archives/service_record_' . $employee_id . '.pdf', 'I');
 }
示例#13
0
      <th width="17%" bgcolor="#D6D6D6">NBI Clearance</th>
      <th width="17%" bgcolor="#D6D6D6">Oath of Office</th>
      <th width="17%" bgcolor="#D6D6D6">Med. Cert.</th>
      <th width="17%" bgcolor="#D6D6D6">SALN</th>
      <th width="17%" bgcolor="#D6D6D6">PES</th>
      <th width="17%" bgcolor="#D6D6D6">Remarks</th>
      <th width="14%" bgcolor="#D6D6D6"><strong>Action</strong></th>
    </tr>
    <?php 
$e = new Employee_m();
?>
    <?php 
foreach ($rows as $row) {
    ?>
    <?php 
    $e->get_by_id($row->employee_id);
    ?>
    <?php 
    $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;
    ?>
';">
示例#14
0
 function assets_other_info($employee_id = '')
 {
     $data['page_name'] = '<b>Assets and Liabilities</b>';
     $data['section_name'] = '<b>Other Info</b>';
     $data['msg'] = '';
     $e = new Employee_m();
     $data['employee'] = $e->get_by_id($employee_id);
     if (Input::get('op')) {
         $a = new Asset_info();
         $a->where('employee_id', $employee_id)->get();
         $a->employee_id = $employee_id;
         $a->s_tin = Input::get('s_tin');
         $a->s_cc_no = Input::get('s_cc_no');
         $a->s_issue_at = Input::get('s_issue_at');
         $a->s_issue_date = Input::get('s_issue_date');
         $a->tin = Input::get('tin');
         $a->cc_no = Input::get('cc_no');
         $a->issue_at = Input::get('issue_at');
         $a->issue_date = Input::get('issue_date');
         $a->save();
         $data['msg'] = $data['section_name'] . ' has been saved!';
     }
     $a = new Asset_info();
     $data['info'] = $a->get_by_employee_id($employee_id);
     $data['selected'] = $e->office_id;
     //Use for office listbox
     $data['options'] = $this->options->office_options();
     $data['employee_id'] = $employee_id;
     $data['main_content'] = 'assets_other_info';
     return View::make('includes/template', $data);
 }