예제 #1
0
		$pdf->Text(105, 73, $rowCabecera["DESCRIPCION"]);
		$pdf->Text(170, 73, $rowCabecera["MONTOREEMP"]);
//---------------------------------------------------------------------------				
		$i = 1;
		$netoAPagar = 0;
		$posX = 0;
		
		$stmt = DBExecSql($conn, $sqlMain, $paramsMain);
		while ($row = DBGetQuery($stmt, 1, false)) {
			if ($i == 1 && $netoAPagar > 0) {	$pdf->AddPage();}
			
			$posX = (93 + ($i*4));
			$pdf->SetXY(20, $posX);			
			$pdf->Cell(20, 0, $row["DESCRIPTION"], 0, 0, 'L' );
			
			$pdf->SetX(40);			
			$pdf->Cell(50, 0, $row["BANK_NAME"], 0, 0, 'L' );
			
			$pdf->SetX(88);			
			$pdf->Cell(20, 0, $row["BANK_ACCOUNT_NUM"], 0, 0, 'L' );
			
			$pdf->SetX(120);			
			$pdf->Cell(20, 0, $row["CHEQUE"], 0, 0, 'L' );
			
			$pdf->SetX(146);			
			$pdf->Cell(20, 0, $row["FECHA_OP"], 0, 0, 'L' );
			
			$pdf->SetX(170);			
			$pdf->Cell(20, 0, $row["MONTO"], 0, 0, 'R' );
			
			$i++;
예제 #2
0
 public function executeBatchPrintBadge(sfWebRequest $request)
 {
     $ids = $request->getParameter('ids');
     // initiate FPDI
     $pdf = new FPDI('P', 'pt');
     // set the sourcefile
     $pdf->setSourceFile(sfConfig::get('sf_upload_dir') . '/badges/ID_new.pdf');
     foreach ($ids as $id) {
         $this->employee = EmployeePeer::retrieveByPk($id);
         // import page 1
         $tplIdx = $pdf->importPage(1);
         // add a new page based on size of the badge
         $s = $pdf->getTemplatesize($tplIdx);
         $pdf->AddPage('P', array($s['w'], $s['h']));
         $pdf->useTemplate($tplIdx);
         $pdf->setMargins(0, 0, 0, 0);
         $pdf->SetAutoPageBreak(false);
         if ($this->employee->getPicture()) {
             $pdf->Image(sfConfig::get('sf_upload_dir') . '/' . sfConfig::get('app_employee_images_dir') . '/' . $this->employee->getPicture(), 29.5, 25.5, 60.3, 74.3);
         } else {
             $pdf->Image(sfConfig::get('sf_upload_dir') . '/badges/picture_missing.jpg', 29.5, 25.5, 60.3, 74.3);
         }
         // now write some text above the imported page
         $pdf->SetFont('freesans', 'B', 12);
         $pdf->SetTextColor(82, 78, 134);
         $pdf->SetXY(22, 110);
         $pdf->Cell(0, 12, $this->employee->getFullName());
         $pdf->Ln();
         $pdf->SetX(22);
         $pdf->SetFont('freesans', 'BI', 10);
         $pdf->Cell(0, 14, $this->employee->getJob());
         $pdf->SetDisplayMode('real');
     }
     return $pdf->Output('newpdf.pdf', 'D');
 }
예제 #3
0
 function back_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/back-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);
     // now write some text above the imported page
     $pdf->SetTextColor(0, 0, 0);
     $pdf->SetFont('Arial', '', 7);
     $n = 1;
     foreach ($results as $result) {
         $s = new Personal_m();
         $row = $s->get_by_employee_id($result->employee_id);
         //======================== START Column 1 | Right to Left ==============================
         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;
         }
         $bday = $row->birth_date;
         $address = $row->res_address;
         $blood_type = '"' . $row->blood_type . '"';
         $gsis = $row->gsis;
         $pagibig = $row->pagibig;
         $philhealth = $row->philhealth;
         $tin = $row->tin;
         $emergency = '';
         $contact = $row->cp;
         //----------------------------- Row 1 ----------------------------------
         ///Birthday
         if ($n == 1) {
             //Birthday
             if ($bday != '0000-00-00') {
                 $pdf->SetXY(247, 23);
                 $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false);
             }
             //Address
             $pdf->SetXY(257, 15);
             $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28);
             $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false);
             //display text overflow
             if ($addr[1]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(257);
                 $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false);
             }
             if ($addr[2]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(257);
                 $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false);
             }
             if ($addr[3]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(257);
                 $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false);
             }
             //Blood Type
             $pdf->SetXY(247, 28.3);
             $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false);
             //GSIS
             $pdf->SetXY(247, 33);
             $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false);
             //PAGIBIG
             $pdf->SetXY(247, 38);
             $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(247, 43.5);
             $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(247, 48.5);
             $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false);
             //in case of emergency
             $pdf->SetXY(235, 75.5);
             $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false);
             //CP No.
             $pdf->SetXY(250, 78);
             $cpno = splitstroverflow($contact, 13);
             $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false);
             if ($cpno[1]) {
                 $pdf->Ln(3);
                 $pdf->SetX(250);
                 $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false);
             }
         }
         //----------------------------- Row 2 ----------------------------------
         if ($n == 2) {
             //Birthday
             if ($bday != '0000-00-00') {
                 $pdf->SetXY(189, 23);
                 $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false);
             }
             //Address
             $pdf->SetXY(199, 15);
             $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28);
             $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false);
             //display text overflow
             if ($addr[1]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(199);
                 $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false);
             }
             if ($addr[2]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(199);
                 $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false);
             }
             if ($addr[3]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(199);
                 $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false);
             }
             //Blood Type
             $pdf->SetXY(189, 28.3);
             $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false);
             //GSIS
             $pdf->SetXY(189, 33);
             $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false);
             //PAGIBIG
             $pdf->SetXY(189, 38);
             $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(189, 43.5);
             $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(189, 48.5);
             $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false);
             //in case of emergency
             $pdf->SetXY(177, 75.5);
             $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false);
             //CP No.
             $pdf->SetXY(192, 78);
             $cpno = splitstroverflow($contact, 13);
             $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false);
             if ($cpno[1]) {
                 $pdf->Ln(3);
                 $pdf->SetX(192);
                 $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false);
             }
         }
         //----------------------------- Row 3 ----------------------------------
         if ($n == 3) {
             //Birthday
             if ($bday != '0000-00-00') {
                 $pdf->SetXY(131, 23);
                 $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false);
             }
             //Address
             $pdf->SetXY(141, 15);
             $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28);
             $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false);
             //display text overflow
             if ($addr[1]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(141);
                 $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false);
             }
             if ($addr[2]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(141);
                 $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false);
             }
             if ($addr[3]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(141);
                 $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false);
             }
             //Blood Type
             $pdf->SetXY(131, 28.3);
             $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false);
             //GSIS
             $pdf->SetXY(131, 33);
             $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false);
             //PAGIBIG
             $pdf->SetXY(131, 38);
             $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(131, 43.5);
             $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(131, 48.5);
             $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false);
             //in case of emergency
             $pdf->SetXY(119, 75.5);
             $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false);
             //CP No.
             $pdf->SetXY(134, 78);
             $cpno = splitstroverflow($contact, 13);
             $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false);
             if ($cpno[1]) {
                 $pdf->Ln(3);
                 $pdf->SetX(134);
                 $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false);
             }
         }
         //----------------------------- Row 4 ----------------------------------
         if ($n == 4) {
             //Birthday
             if ($bday != '0000-00-00') {
                 $pdf->SetXY(73, 23);
                 $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false);
             }
             //Address
             $pdf->SetXY(83, 15);
             $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28);
             $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false);
             //display text overflow
             if ($addr[1]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(83);
                 $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false);
             }
             if ($addr[2]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(83);
                 $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false);
             }
             if ($addr[3]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(3);
                 $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false);
             }
             //Blood Type
             $pdf->SetXY(73, 28.3);
             $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false);
             //GSIS
             $pdf->SetXY(73, 33);
             $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false);
             //PAGIBIG
             $pdf->SetXY(73, 38);
             $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(73, 43.5);
             $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(73, 48.5);
             $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false);
             //in case of emergency
             $pdf->SetXY(61, 75.5);
             $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false);
             //CP No.
             $pdf->SetXY(76, 78);
             $cpno = splitstroverflow($contact, 13);
             $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false);
             if ($cpno[1]) {
                 $pdf->Ln(3);
                 $pdf->SetX(76);
                 $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false);
             }
         }
         //----------------------------- Row 5 ----------------------------------
         if ($n == 5) {
             //Birthday
             if ($bday != '0000-00-00') {
                 $pdf->SetXY(15, 23);
                 $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false);
             }
             //Address
             $pdf->SetXY(25, 15);
             $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28);
             $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false);
             //display text overflow
             if ($addr[1]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(25);
                 $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false);
             }
             if ($addr[2]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(25);
                 $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false);
             }
             if ($addr[3]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(25);
                 $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false);
             }
             //Blood Type
             $pdf->SetXY(15, 28.3);
             $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false);
             //GSIS
             $pdf->SetXY(15, 33);
             $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false);
             //PAGIBIG
             $pdf->SetXY(15, 38);
             $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(15, 43.5);
             $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(15, 48.5);
             $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false);
             //in case of emergency
             $pdf->SetXY(3, 75.5);
             $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false);
             //CP No.
             $pdf->SetXY(18, 78);
             $cpno = splitstroverflow($contact, 13);
             $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false);
             if ($cpno[1]) {
                 $pdf->Ln(3);
                 $pdf->SetX(18);
                 $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false);
             }
         }
         //======================== END Column 1 | Right to Left ==============================
         //======================== START Column 2 | Right to Left ==============================
         //----------------------------- Row 1 ----------------------------------
         ///Birthday
         if ($n == 6) {
             //Birthday
             if ($bday != '0000-00-00') {
                 $pdf->SetXY(247, 123.5);
                 $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false);
             }
             //Address
             $pdf->SetXY(257, 115);
             $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28);
             $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false);
             //display text overflow
             if ($addr[1]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(257);
                 $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false);
             }
             if ($addr[2]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(257);
                 $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false);
             }
             if ($addr[3]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(257);
                 $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false);
             }
             //Blood Type
             $pdf->SetXY(247, 128.5);
             $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false);
             //GSIS
             $pdf->SetXY(247, 133.5);
             $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false);
             //PAGIBIG
             $pdf->SetXY(247, 138.5);
             $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(247, 144);
             $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false);
             //TIN
             $pdf->SetXY(247, 149);
             $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false);
             //in case of emergency
             $pdf->SetXY(235, 176.3);
             $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false);
             //CP No.
             $pdf->SetXY(250, 178.5);
             $cpno = splitstroverflow($contact, 13);
             $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false);
             if ($cpno[1]) {
                 $pdf->Ln(3);
                 $pdf->SetX(250);
                 $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false);
             }
         }
         //----------------------------- Row 2 ----------------------------------
         //----------------------------- Row 2 ----------------------------------
         if ($n == 7) {
             //Birthday
             if ($bday != '0000-00-00') {
                 $pdf->SetXY(189, 123.5);
                 $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false);
             }
             //Address
             $pdf->SetXY(199, 115);
             $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28);
             $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false);
             //display text overflow
             if ($addr[1]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(199);
                 $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false);
             }
             if ($addr[2]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(199);
                 $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false);
             }
             if ($addr[3]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(199);
                 $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false);
             }
             //Blood Type
             $pdf->SetXY(189, 128.5);
             $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false);
             //GSIS
             $pdf->SetXY(189, 133.5);
             $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false);
             //PAGIBIG
             $pdf->SetXY(189, 138.5);
             $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(189, 144);
             $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false);
             //tin
             $pdf->SetXY(189, 149);
             $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false);
             //in case of emergency
             $pdf->SetXY(177, 176.3);
             $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false);
             //CP No.
             $pdf->SetXY(192, 178.5);
             $cpno = splitstroverflow($contact, 13);
             $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false);
             if ($cpno[1]) {
                 $pdf->Ln(3);
                 $pdf->SetX(192);
                 $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false);
             }
         }
         //----------------------------- Row 3 ----------------------------------
         if ($n == 8) {
             //Birthday
             if ($bday != '0000-00-00') {
                 $pdf->SetXY(131, 123.5);
                 $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false);
             }
             //Address
             $pdf->SetXY(141, 115);
             $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28);
             $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false);
             //display text overflow
             if ($addr[1]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(141);
                 $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false);
             }
             if ($addr[2]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(141);
                 $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false);
             }
             if ($addr[3]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(141);
                 $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false);
             }
             //Blood Type
             $pdf->SetXY(131, 128.5);
             $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false);
             //GSIS
             $pdf->SetXY(131, 133.5);
             $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false);
             //PAGIBIG
             $pdf->SetXY(131, 138.5);
             $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(131, 144);
             $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(131, 149);
             $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false);
             //in case of emergency
             $pdf->SetXY(119, 176.3);
             $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false);
             //CP No.
             $pdf->SetXY(134, 178.5);
             $cpno = splitstroverflow($contact, 13);
             $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false);
             if ($cpno[1]) {
                 $pdf->Ln(3);
                 $pdf->SetX(134);
                 $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false);
             }
         }
         //----------------------------- Row 4 ----------------------------------
         if ($n == 9) {
             //Birthday
             if ($bday != '0000-00-00') {
                 $pdf->SetXY(73, 123.5);
                 $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false);
             }
             //Address
             $pdf->SetXY(83, 115);
             $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28);
             $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false);
             //display text overflow
             if ($addr[1]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(83);
                 $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false);
             }
             if ($addr[2]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(83);
                 $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false);
             }
             if ($addr[3]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(3);
                 $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false);
             }
             //Blood Type
             $pdf->SetXY(73, 128.5);
             $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false);
             //GSIS
             $pdf->SetXY(73, 133.5);
             $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false);
             //PAGIBIG
             $pdf->SetXY(73, 138.5);
             $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(73, 144);
             $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(73, 149);
             $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false);
             //in case of emergency
             $pdf->SetXY(61, 176.3);
             $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false);
             //CP No.
             $pdf->SetXY(76, 178.5);
             $cpno = splitstroverflow($contact, 13);
             $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false);
             if ($cpno[1]) {
                 $pdf->Ln(3);
                 $pdf->SetX(76);
                 $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false);
             }
         }
         //----------------------------- Row 5 ----------------------------------
         if ($n == 10) {
             //Birthday
             if ($bday != '0000-00-00') {
                 $pdf->SetXY(15, 123.5);
                 $pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false);
             }
             //Address
             $pdf->SetXY(25, 115);
             $addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28);
             $pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false);
             //display text overflow
             if ($addr[1]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(25);
                 $pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false);
             }
             if ($addr[2]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(25);
                 $pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false);
             }
             if ($addr[3]) {
                 $pdf->Ln(2.5);
                 $pdf->SetX(25);
                 $pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false);
             }
             //Blood Type
             $pdf->SetXY(15, 128.5);
             $pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false);
             //GSIS
             $pdf->SetXY(15, 133.5);
             $pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false);
             //PAGIBIG
             $pdf->SetXY(15, 138.5);
             $pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false);
             //PHILHEALTH
             $pdf->SetXY(15, 144);
             $pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false);
             //tin
             $pdf->SetXY(15, 149);
             $pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false);
             //in case of emergency
             $pdf->SetXY(3, 176.3);
             $pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false);
             //CP No.
             $pdf->SetXY(18, 178.5);
             $cpno = splitstroverflow($contact, 13);
             $pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false);
             if ($cpno[1]) {
                 $pdf->Ln(3);
                 $pdf->SetX(18);
                 $pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false);
             }
         }
         //======================== END Column 2 | Right to Left ==============================
         $n++;
     }
     // Output
     $pdf->Output('pdf-report/back-id.pdf', 'F');
     return 'pdf-report/back-id.pdf';
 }
예제 #4
0
 function ten_tardiness_second($second_offenders = array())
 {
     $this->load->library('fpdf');
     define('FPDF_FONTPATH', $this->config->item('fonts_path'));
     $this->load->library('fpdi');
     // initiate FPDI
     $pdf = new FPDI('P', 'mm', 'Legal');
     $pdf->SetLeftMargin(20);
     $pdf->SetRightMargin(15);
     // add a page
     $pdf->AddPage();
     // set the sourcefile
     $pdf->setSourceFile('dtr/template/notice2nd.pdf');
     // select the first page
     $tplIdx = $pdf->importPage(1);
     // use the page we imported
     $pdf->useTemplate($tplIdx);
     $offices = Input::get('offices');
     $office_id = $offices[0];
     $m1 = 'Jul';
     $m2 = 'Aug';
     $m3 = 'Sep';
     $m4 = 'Oct';
     $m5 = 'Nov';
     $m6 = 'Dec';
     $mo1 = '07';
     $mo2 = '08';
     $mo3 = '09';
     $mo4 = '10';
     $mo5 = '11';
     $mo6 = '12';
     $pdf->SetFont('Arial', '', '12');
     $pdf->SetXY(155, 50);
     $pdf->Write(0, date('F d, Y'));
     $pdf->SetX(35);
     $pdf->SetFont('Arial', 'B', '');
     $pdf->Cell(0, 6, "HON. EDWARD S. HAGEDORN ", '', 1, 'L', FALSE);
     $pdf->SetFont('Arial', '', '');
     $pdf->SetX(35);
     $pdf->Cell(0, 6, "City Mayor", '', 1, 'L', FALSE);
     $pdf->SetX(35);
     $pdf->Cell(0, 6, "Puerto Princesa City", '', 1, 'L', FALSE);
     $pdf->Cell(0, 6, "", '', 1, 'C', FALSE);
     $pdf->Cell(0, 6, "Thru: ATTY. SHIRLEY R. DAGANTA", '', 1, 'C', FALSE);
     $pdf->Cell(0, 6, "CG Assistant Dept. Head II", '', 1, 'C', FALSE);
     $pdf->Cell(0, 6, "Assistant City Legal Officer II", '', 1, 'C', FALSE);
     $pdf->Ln(12);
     $pdf->SetX(35);
     $pdf->SetFont('Arial', 'B', '');
     $pdf->Write(0, 'Madam:');
     $pdf->SetFont('Arial', '', '');
     $pdf->Ln(6);
     $pdf->SetX(35);
     $pdf->MultiCell(0, 6, "                Please be informed that despite the first notice issued to him/her as per records in this office, it has been observed that the he/she has continuously incurred the following tardiness and undertime, viz:", 0, 'L', false);
     //$pdf->SetX(35);
     //$pdf->Cell(0,6," $number of your employees has incurred the following, viz:",'',0,'L',false);
     $pdf->SetFont('Arial', 'BI', 10);
     $pdf->Ln(2);
     $pdf->SetFillColor(210, 210, 210);
     //$pdf->SetX(20);
     //header
     $pdf->Cell(50, 8, "Name", 'RLTB', 0, 'C', 1);
     $pdf->Cell(20, 4, $m1, '1', 0, 'C', 1);
     $pdf->Cell(20, 4, $m2, '1', 0, 'C', 1);
     $pdf->Cell(20, 4, $m3, '1', 0, 'C', 1);
     $pdf->Cell(20, 4, $m4, '1', 0, 'C', 1);
     $pdf->Cell(20, 4, $m5, '1', 0, 'C', 1);
     $pdf->Cell(20, 4, $m6, '1', 1, 'C', 1);
     $pdf->SetFont('Arial', '', 9);
     $pdf->SetFillColor(240, 240, 240);
     $pdf->Cell(50, 4, "", 'RLB', 0, 'C', false);
     $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "UT", '1', 1, 'C', 1);
     $pdf->SetFillColor(215, 255, 215);
     $year1 = Input::get('year');
     $tardis = $second_offenders;
     if (is_array($tardis)) {
         foreach ($tardis as $tardi) {
             $name = $this->Employee->get_employee_info($tardi, $field = '');
             $late1 = $this->Tardiness->count_late($name['employee_id'], $mo1, $year1, 1, 3);
             $late2 = $this->Tardiness->count_late($name['employee_id'], $mo2, $year1, 1, 3);
             $late3 = $this->Tardiness->count_late($name['employee_id'], $mo3, $year1, 1, 3);
             $late4 = $this->Tardiness->count_late($name['employee_id'], $mo4, $year1, 1, 3);
             $late5 = $this->Tardiness->count_late($name['employee_id'], $mo5, $year1, 1, 3);
             $late6 = $this->Tardiness->count_late($name['employee_id'], $mo6, $year1, 1, 3);
             $under_time1 = $this->Tardiness->count_late($name['employee_id'], $mo1, $year1, 2, 4);
             $under_time2 = $this->Tardiness->count_late($name['employee_id'], $mo2, $year1, 2, 4);
             $under_time3 = $this->Tardiness->count_late($name['employee_id'], $mo3, $year1, 2, 4);
             $under_time4 = $this->Tardiness->count_late($name['employee_id'], $mo4, $year1, 2, 4);
             $under_time5 = $this->Tardiness->count_late($name['employee_id'], $mo5, $year1, 2, 4);
             $under_time6 = $this->Tardiness->count_late($name['employee_id'], $mo6, $year1, 2, 4);
             $late1['tardi_count'] = $this->Tardiness->is_tardy_zero($late1['tardi_count']);
             $late2['tardi_count'] = $this->Tardiness->is_tardy_zero($late2['tardi_count']);
             $late3['tardi_count'] = $this->Tardiness->is_tardy_zero($late3['tardi_count']);
             $late4['tardi_count'] = $this->Tardiness->is_tardy_zero($late4['tardi_count']);
             $late5['tardi_count'] = $this->Tardiness->is_tardy_zero($late5['tardi_count']);
             $late6['tardi_count'] = $this->Tardiness->is_tardy_zero($late6['tardi_count']);
             $under_time1['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time1['tardi_count']);
             $under_time2['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time2['tardi_count']);
             $under_time3['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time3['tardi_count']);
             $under_time4['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time4['tardi_count']);
             $under_time5['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time5['tardi_count']);
             $under_time6['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time6['tardi_count']);
             //start employee tardy
             $pdf->Cell(50, 4, ucwords(strtolower(utf8_decode($name['fname'] . ' ' . $name['mname'] . ' ' . $name['lname']))), 'RLTB', 0, 'L', false);
             $pdf->Cell(10, 4, $late1['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $under_time1['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $late2['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $under_time2['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $late3['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $under_time3['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $late4['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $under_time4['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $late5['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $under_time5['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $late6['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $under_time6['tardi_count'], '1', 1, 'C', FALSE);
         }
     }
     $pdf->Cell(50, 4, "", 'RLTB', 0, 'L', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 1, 'C', FALSE);
     // line break
     $pdf->Ln(5);
     $pdf->SetFont('Arial', '', '12');
     $pdf->SetX(35);
     $pdf->MultiCell(0, 6, "             Section 8, Rule XVII of the Omnibus Rules Implementing Book V of Executive Order No. 292, states that: \n\t\t\t\t   'Officers and employees who have incurred tardiness and undertime, regardless of the number of minutes per day, ten (10) times a month for at least two (2) consecutive months during the year or for at least two (2) months in a semester shall be subject to disciplinary action.'\n\t\t\t\t   Violation of the said rule carries the following penalties:\n\t\t\n\t\t\t\t   1.\tFirst Offense - Reprimand;\n\t\t\t\t   2.\tSecond Offense - Suspension for one (1) day to thirty (30) days; and\n\t\t\t\t   3.\tThird Offense - Dismissal.\n\t\t\n\t\t\t\t   For your appropriate action.\n\t\t", '', 1, 'L', false);
     $pdf->Cell(0, 6, " Very truly yours,              ", 0, 'R', FALSE);
     $pdf->Cell(0, 6, "              ", '', 1, 'R', FALSE);
     $pdf->Cell(0, 6, "               ", '', 1, 'R', FALSE);
     $pdf->SetFont('Arial', 'B', '');
     $pdf->Cell(0, 6, " FELIMON R. SABAS              ", '', 1, 'R', FALSE);
     $pdf->SetFont('Arial', '', '');
     $pdf->Cell(0, 6, " CG Department Head II              ", '', 1, 'R', FALSE);
     $pdf->Cell(0, 6, " (City Personnel Officer)              ", '', 1, 'R', FALSE);
     $pdf->MultiCell(0, 6, "\n\t\tNOTED:\n\t\t\n\t\tBY AUTHORITY OF THE CITY MAYOR:", 0, 'L', FALSE);
     $pdf->SetFont('Arial', 'B', '');
     $pdf->Cell(0, 6, "    ATTY. AGUSTIN M. ROCAMORA", '', 1, 'L', FALSE);
     $pdf->SetFont('Arial', '', '');
     $pdf->Cell(0, 6, "       City Administrator II", '', 1, 'L', FALSE);
     header('Cache-Control: maxage=3600');
     //Adjust maxage appropriately
     header('Pragma: public');
     //If the parameter is D = download F = save as file
     $pdf->Output('dtr/reports/ten_tardiness_second.pdf', 'F');
 }
    function preview($rows, $report_name = '')
    {
        $html = '
		
		<table width="100%" border="0">
	  <tr>
		<td colspan="3" align="center">' . $report_name . '</td>
	  </tr>
	  <tr>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td>&nbsp;</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>';
        $office = new Orm_office();
        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 = '';
            }
            $html .= '
	<tr>
		<td>' . $row->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>';
        }
        $html .= '
<tr><td><p>&nbsp;</p></td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td><td>&nbsp;</td></tr>
</tbody></table>';
        // Signatories
        $sr_prepared = $this->Settings->get_selected_field('sr_prepared');
        $sr_prepared_position = $this->Settings->get_selected_field('sr_prepared_position');
        $sr_certified = $this->Settings->get_selected_field('sr_certified');
        $sr_certified_position = $this->Settings->get_selected_field('sr_certified_position');
        $html .= '
	<table width="100%" border="0">
	  <tr>
		<td width="38%">&nbsp;</td>
		<td width="23%">&nbsp;</td>
		<td width="39%">&nbsp;</td>
	  </tr>
	  <tr>
		<td align="center">PREPARED BY:</td>
		<td>&nbsp;</td>
		<td align="center">CERTIFIED CORRECT:</td>
	  </tr>
	  <tr>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
		<td align="center">&nbsp;</td>
	  </tr>
	  <tr>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
		<td align="center">&nbsp;</td>
	  </tr>
	  <tr>
		<td align="center">' . $sr_prepared . '</td>
		<td>&nbsp;</td>
		<td align="center">' . $sr_certified . '</td>
	  </tr>
	  <tr>
		<td align="center">' . $sr_prepared_position . '</td>
		<td>&nbsp;</td>
		<td align="center">' . $sr_certified_position . '</td>
	  </tr>
	</table>
	';
        $this->load->library('MPDF52/mpdf');
        //$this->mpdf->WriteHTML('<p>Hello There hahahaha</p>');
        //$this->mpdf->Output('mpdf.pdf','I');
        // 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);
        $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 = $this->Settings->get_selected_field('sr_prepared');
        $sr_prepared_position = $this->Settings->get_selected_field('sr_prepared_position');
        $sr_certified = $this->Settings->get_selected_field('sr_certified');
        $sr_certified_position = $this->Settings->get_selected_field('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';
    }
예제 #6
0
$pdf->Text($repstr[x], $repstr[y], utf8_decode($firma["street"]));
$pdf->Text($report[x], $report[y], $firma["zipcode"] . " " . utf8_decode($firma["city"]));
$pdf->Text($repphone[x], $repphone[y], $firma["phone"]);
$pdf->Text($repaid[x], $repaid[y], $_GET["aid"]);
$pdf->SetFont($repfont, '', $repsizeN);
$pdf->Text($repwvnr[x], $repwvnr[y], $masch['contractnumber']);
$pdf->Text($repkdnr[x], $repkdnr[y], $firma["customernumber"]);
$pdf->Text($repdate[x], $repdate[y], date("d.m.Y"));
$pdf->Text($repmasch[x], $repmasch[y], utf8_decode($masch["description"]));
$pdf->Text($repser[x], $repser[y], $masch["serialnumber"]);
$pdf->Text($repsort[x], $repsort[y], utf8_decode($masch["standort"]));
$pdf->Text($repcnt[x], $repcnt[y], $masch["counter"]);
$pdf->Text($repinsp[x], $repinsp[y], db2date($masch["inspdatum"]));
$pdf->Text($repkurz[x], $repkurz[y], utf8_decode($rep["cause"]));
$pdf->SetY($replang[x]);
$pdf->SetX($replang[y]);
$pdf->MultiCell(0, 6, utf8_decode($rep["schaden"]), 0);
$pdf->addPage();
$history = "Die letzten Ereignisse:\n";
$history .= db2date($hist[0]["datum"]);
$history .= "     " . $hist[0]["art"] . "    ";
if ($hist[0]["art"] == "RepAuftr") {
    preg_match("/^[0-9]+\\|(.+)/", utf8_decode($hist[0]["beschreibung"]), $treffer);
    $history .= $treffer[1] . "\n";
} else {
    $history .= $hist[0]["beschreibung"] . "\n";
}
$history .= db2date($hist[1]["datum"]);
$history .= "     " . $hist[1]["art"] . "    ";
if ($hist[1]["art"] == "RepAuftr") {
    preg_match("/^[0-9]+\\|(.+)/", utf8_decode($hist[1]["beschreibung"]), $treffer);
예제 #7
0
$hdl = $pdf->ImportPage(1);
$pdf->addPage();
$pdf->useTemplate($hdl);
$pdf->SetFont($wvfont, '', $wvsize);
$pdf->Text($wvname[x], $wvname[y], utf8_decode($firma["name"]));
$pdf->Text($wvstr[x], $wvstr[y], utf8_decode($firma["street"]));
$pdf->Text($wvort[x], $wvort[y], $firma["zipcode"] . " " . utf8_decode($firma["city"]));
$pdf->Text($wvkdnr[x], $wvkdnr[y], $firma["customernumber"]);
$pdf->Text($wvwvnr[x], $wvwvnr[y], $rep['contractnumber']);
$pdf->Text($wvstart[x], $wvstart[y], db2date($rep["anfangdatum"]));
$pdf->Text($wvende[x], $wvende[y], $ende);
$pdf->Text($wvbetrag[x], $wvbetrag[y], sprintf("%0.2f", $rep["betrag"]));
$pdf->SetFont('Helvetica', '', 10);
$bem = $rep["bemerkung"] ? utf8_decode($rep["bemerkung"]) : "Es werden keine Sondervereinbarungen getroffen";
$pdf->SetY($wvbem[y]);
$pdf->SetX($wvbem[x]);
$pdf->MultiCell(0, 6, $bem, 0);
for ($j = 2; $j <= $seiten; $j++) {
    $hdl = @$pdf->ImportPage($j);
    $pdf->addPage();
    $pdf->useTemplate($hdl);
}
$pdf->SetFont($wvfont, '', $wvsize);
$i = 300;
$p = 1;
foreach ($masch as $row) {
    if ($i > 270) {
        $pdf->addPage();
        $pdf->Text($wvkopf[x], $wvkopf[y], "Anhang A (Seite {$p}) zum Wartungsvertrag  " . $rep['contractnumber'] . "  vom  " . db2date($rep["anfangdatum"]));
        $i = 40;
        $p++;
예제 #8
0
 public function generatepdfAction(command $commande)
 {
     $request = $this->get('request');
     $tools = $this->get('tools.utils');
     $session = $request->getSession();
     if ($session->has('tpl')) {
         $tpl = $commande->getToprint();
         $pdffile = "";
         foreach ($tpl as $key => $elemnt) {
             foreach ($elemnt as $val) {
                 $prod = $this->getDoctrine()->getRepository('MainFrontBundle:paramtpl')->find($val['id']);
                 $template = $prod->getTpl();
                 $tplpdf = str_replace("../", "", $template->getPdf());
                 $pdffile = $this->get('kernel')->getRootDir() . '/../web/' . $tplpdf;
             }
         }
         $custom_layout = array(85, 55);
         $orientation = 'L';
         $pdf = new \FPDI($orientation, 'mm', $custom_layout, true, 'UTF-8', false);
         $pdf->setPageOrientation($orientation);
         $pdf->SetMargins(0, 0, 0);
         $pdf->SetAutoPageBreak(true, 0);
         $pdf->setFontSubsetting(false);
         $pdf->AddPage($orientation);
         //   echo "<pre>";print_r($pdf->getMargins());exit;
         $pdf->setSourceFile($pdffile);
         $_tplIdx = $pdf->importPage(1);
         $size = $pdf->useTemplate($_tplIdx, 0, 0, 85, 55, true);
         $idd = "";
         $i = 0;
         $oldx = 0;
         $oldy = 0;
         foreach ($elemnt as $value) {
             //if($i==0)
             if ($idd != $value['id'] && $value['value'] != "") {
                 $pdf->SetPageMark();
                 if (substr($value['value'], 0, 4) != "/tmp") {
                     //$tools->dump($value);
                     $align = strtoupper(substr($value['align'], 0, 1));
                     $color = $this->hex2rgb($value['color']);
                     $pdf->SetTextColor($color[0], $color[1], $color[2]);
                     $param = $this->getDoctrine()->getRepository('MainFrontBundle:paramtpl')->find($value['id']);
                     $y2 = $param->getX1() / 5;
                     $x1 = $param->getY1() / 5;
                     //$x1 = 10;$y2 = 8;
                     $w = $param->getX2() / 5;
                     $h = $param->getY2() / 5;
                     $oldx = $x1;
                     $oldy = $y2;
                     $pdf->SetX($x1, false);
                     $pdf->SetY($y2, false);
                     //$pdf->SetXY($x1, $y2,true);
                     $pdf->SetFont(null, '', $param->getSize() * 0.6);
                     //$param->getPolice()
                     // echo $opt->getFontsize()."\n";
                     $pdf->Cell($w, $h, $value["value"], 0, 0, $align);
                 } else {
                     $param = $this->getDoctrine()->getRepository('MainFrontBundle:paramtpl')->find($value['id']);
                     $img = $this->getParameter('base_url') . $value['value'];
                     $pdf->Image($img, $param->getX1() / 4.5, $param->getY1() / 4.55, $param->getX2() / 4.55, $param->getY2() / 4.5, '', '', '', true);
                 }
             }
             $idd = $value['id'];
             $i++;
         }
         //$pdf->Cell(0, $size['h'], 'TCPDF and FPDI');
         // echo $template->getId();
         $pdf->Output($this->get('kernel')->getRootDir() . '/../web/pdf.pdf');
     }
     return new Response("");
 }
	$pdf->Cell(120, 0, $row2["PR_MAIL"]);

	// Muestro el texto de arriba de las firmas..
	$pdf->SetFont("Arial", "", 9);
	$pdf->Ln(4);
	$texto = explode("\n", "Por medio de la presente ".$row2["RAZON_SOCIAL"]." autoriza a Provincia ART S.A. a entregar a Provincia Seguros S.A. la información sobre la nómina (datos de Empleados, Masa Salarial, C.U.I.L., Nombre, etc.) e información complementaria que a criterio de la aseguradora permita tener un conocimiento de la actividad y del comportamiento del riesgo inherente a la cobertura.");
	for ($i=0; $i<count($texto); $i++) {
		$str = trim($texto[$i]);

		$pdf->WordWrap($str, 188);
		$pdf->Write(4, $str);

		$pdf->Ln(2);
	}

	$pdf->SetX(8);
	$pdf->SetY(250);
	$pdf->Cell(120, 0, "Buenos Aires, ".date("d")." de ".GetMonthName(date("m"))." de ".date("Y"));

	updateFechaImpresion((isset($idFormulario)?$idFormulario:0));
}
else {
	$pdf->AddPage();
	$pdf->SetTextColor(255, 0, 0);
	$pdf->SetFont("Arial", "B", 14);

	$pdf->Ln(30);
	$pdf->Cell(0, 0, $msgSqlVacio, 0, 0, "C");
}

if ($autoPrint)
예제 #10
0
// select the first page
$tplIdx = $pdf->importPage(1);
// use the page we imported
$pdf->useTemplate($tplIdx);
//====================================================================
// Write to the document
//====================================================================
// set font, font style, font size.
$pdf->SetFont('Arial', '', 6);
$pdf->SetTextColor(0, 51, 102);
// set initial placement
$pdf->SetXY(27, 15);
// line break
//$pdf->Ln(5);
// go to 25 X (indent)
$pdf->SetX(27);
// write
$pdf->SetFont('Arial', '', 10);
$pdf->Write(0, utf8_decode($ObtenerCabeceraFacturacion[0]['nombreCliente']));
// move to next line
$pdf->Ln(5);
$pdf->SetFont('Arial', '', 7);
// The following section is basically a repetition of the previous for inserting more text.
// repeat for more text:
$pdf->SetX(27);
$pdf->Write(0, $ObtenerCabeceraFacturacion[0]['DocumentoIdentidad']);
$pdf->Ln(4);
$pdf->SetX(27);
$pdf->Write(0, utf8_decode(ucwords(strtolower($ObtenerCabeceraFacturacion[0]['direccionCliente']))));
$pdf->Ln(4);
$pdf->SetX(27);
예제 #11
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');
 }
// select the first page
$tplIdx = $pdf->importPage(1);
// use the page we imported
$pdf->useTemplate($tplIdx);
//====================================================================
// Write to the document
//====================================================================
// set font, font style, font size.
$pdf->SetFont('Arial', '', 6);
$pdf->SetTextColor(0, 0, 0);
// set initial placement
$pdf->SetXY(29, 35);
// line break
//$pdf->Ln(5);
// go to 25 X (indent)
$pdf->SetX(62);
//================================INICIO DE DATOS DEL CLIENTE====================================//
$pdf->SetFont('Arial', '', 10);
$pdf->Write(0, utf8_decode($_POST['razonSocial']));
$pdf->SetFont('Arial', '', 10);
$pdf->SetX(157);
$pdf->Write(0, $_POST['fechaPropuesta']);
$pdf->Ln(5);
$pdf->SetX(62);
$pdf->Write(0, utf8_decode(ucwords(strtolower($_POST['numeroRUC']))));
$pdf->Ln(5);
$pdf->SetX(62);
$pdf->Write(0, ucwords(strtolower($_POST['nombreContacto'])));
$pdf->Ln(6);
$pdf->SetX(62);
$pdf->Write(0, utf8_decode($_POST['telefono']));
예제 #13
0
file_put_contents('img.png', $unencodedData);
//Show the image
//echo '<img src="'.$_POST['img_val'].'" />';
$pdf = new FPDI();
$pdf->setSourceFile('TemplateReporte.pdf');
// seteamos la fuente, el estilo y el tamano
$pdf->SetFont('Times', 'B', 10);
// seteamos la posicion inicial
$pdf->SetXY(25, 80);
date_default_timezone_set('America/Bogota');
setlocale(LC_ALL, "es_ES");
$dias = array("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sábado");
$meses = array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
//agregamos una pagina
$pdf->AddPage();
$pdf->SetFont('Arial');
// seleccionamos la primera pagina del docuemnto importado
$tplIdx = $pdf->importPage(1);
// usamos la pagina importado como template
$pdf->useTemplate($tplIdx);
//seteamos la posicion X
$pdf->SetX(25);
//salto de linea
$pdf->Ln(55.2);
$pdf->SetFontSize(9);
$pdf->Write(0, utf8_decode("                                   " . $dias[date('w')] . " " . date('d') . " de " . $meses[date('n') - 1] . " del " . date('Y')));
$pdf->Image('img.png', 50, 110, 200);
unlink('img.png');
$pdf->Ln(155);
$pdf->Write(0, utf8_decode("                    Relación de costos anuales sobre proyectos ejecutados con éxito."));
$pdf->Output();
예제 #14
0
 function cto_apps($id = '')
 {
     $c = CompensatoryTimeoff::find($id);
     $name = $this->Employee->get_employee_info($c->employee_id);
     $office_name = $this->Office->get_office_name($name['office_id']);
     $this->load->library('fpdf');
     define('FPDF_FONTPATH', $this->config->item('fonts_path'));
     $this->load->library('fpdi');
     $pdf = new FPDI('P', 'mm', 'Legal');
     // add a page
     $pdf->AddPage();
     // set the sourcefile
     $pdf->setSourceFile('dtr/template/app_for_offset.pdf');
     // select the first page
     $tplIdx = $pdf->importPage(1);
     // use the page we imported
     $pdf->useTemplate($tplIdx);
     // set font, font style, font size.
     $pdf->SetFont('Arial', 'B', 12);
     // set initial placement
     $pdf->SetXY(158, 10.5);
     $pdf->Write(0, 'Tracking no: ' . $id);
     $pdf->Ln(9);
     $pdf->SetX(158);
     $pdf->Ln(20);
     // go to 25 X (indent)
     $pdf->SetX(12);
     $this->Office->fields = array('office_code');
     $office = $this->Office->get_office_info($name['office_id']);
     // write office
     $pdf->SetFont('Arial', 'B', 10);
     $pdf->Write(0, $office['office_name']);
     $pdf->SetFont('Arial', 'B', 12);
     //lname
     $pdf->SetX(99);
     $pdf->Write(0, $name['lname']);
     //fname
     $pdf->SetX(145);
     $pdf->Write(0, $name['fname']);
     //mname
     $pdf->SetX(187);
     $pdf->Write(0, $name['mname'][0] . '.');
     $pdf->Ln(10);
     //date of file
     $pdf->SetX(20);
     $pdf->Write(0, $c->date_file);
     //position
     $pdf->SetFont('Arial', 'B', 10);
     $pdf->SetX(63);
     $pdf->Write(0, $name['position']);
     $pdf->SetFont('Arial', 'B', 12);
     // We need to check what salary grade the office use
     if ($office['salary_grade_type'] == 'hospital') {
         $this->Salary_grade->salary_grade_type = 'hospital';
     }
     //monthly salary
     $pdf->SetX(140);
     $pdf->Write(0, 'P ' . number_format($this->Salary_grade->get_monthly_salary($name['salary_grade'], $name['step']), 2));
     $days = 'day';
     if ($c->days > 1) {
         $days = 'days';
     }
     $pdf->Ln(13);
     $pdf->SetX(30);
     $pdf->Write(0, $c->days . ' ' . $days);
     $pdf->SetX(140);
     //$pdf->Write(0, 'daily rate here');
     $pdf->Ln(13);
     $pdf->SetX(50);
     $pdf->Write(0, $this->Helps->get_month_name($c->month) . ' ' . $c->dates . ', ' . $c->year);
     $cto_balances_as_of = date("F d, Y", strtotime($c->date_file . "-1 day"));
     $pdf->SetXY(30, 106);
     $pdf->Write(0, $cto_balances_as_of);
     // Compute balances
     // (balance + earn) - spent
     $cto = CompensatoryTimeoff::getBalance($c->employee_id);
     //$balance = $cto->days;
     $balance = $cto;
     $cto = CompensatoryTimeoff::getEarnedSpent($c->employee_id);
     //$earn = $cto->days;
     $earn = $cto;
     $cto = CompensatoryTimeoff::getEarnedSpent($c->employee_id, 'spent');
     //$spent = $cto->days;
     $spent = $cto;
     $total_balance = $balance + $earn - $spent;
     $pdf->SetXY(35, 116);
     $pdf->Write(0, $total_balance);
     $pdf->SetX(87);
     $pdf->Write(0, '');
     // hours here
     // Get office head
     $office = $this->Office->get_office_info($name['office_id']);
     // If detailed
     if ($name['detailed_office_id'] != 0) {
         $detailed_office = $this->Office->get_office_info($name['detailed_office_id']);
         $office['office_head'] = $detailed_office['office_head'];
         $office['position'] = $detailed_office['position'];
     }
     // If Employee is Department head
     $o = new Office_m();
     $o->get_by_employee_id($c->employee_id);
     if ($o->exists()) {
         $office['office_head'] = 'CARMENCITA O. REYES';
         $office['position'] = 'Governor';
     }
     // We need to work out for this as exception
     if ($c->employee_id == '61') {
         $office['office_head'] = 'ANTONIO L. UY, JR. M.D.';
         $office['position'] = 'Vice Governor';
     }
     $pdf->Ln(6);
     $pdf->SetX(120);
     $pdf->Cell(73, 4, strtoupper($office['office_head']), '0', 0, 'C', FALSE);
     $pdf->Ln(5);
     $pdf->SetFont('Arial', '', 10);
     $pdf->SetX(120);
     $pdf->Cell(73, 4, $office['position'], '0', 0, 'C', FALSE);
     $pdf->SetFont('Arial', 'B', 12);
     // Statement of CTO signatory
     $statement_certified = Setting::getField('cto_certification');
     $statement_certified_position = Setting::getField('cto_certification_position');
     $pdf->Ln(5);
     $pdf->SetX(22);
     $pdf->Cell(73, 4, strtoupper($statement_certified), '0', 0, 'C', FALSE);
     $pdf->Ln(5);
     $pdf->SetFont('Arial', '', 10);
     $pdf->SetX(22);
     $pdf->Cell(73, 4, $statement_certified_position, '0', 0, 'C', FALSE);
     $pdf->SetFont('Arial', 'B', 12);
     // ====================Second Form =============
     $pdf->Ln(44);
     $pdf->SetX(12);
     // write office
     $pdf->SetFont('Arial', 'B', 10);
     $pdf->Write(0, $office['office_name']);
     $pdf->SetFont('Arial', 'B', 12);
     //lname
     $pdf->SetX(99);
     $pdf->Write(0, $name['lname']);
     //fname
     $pdf->SetX(145);
     $pdf->Write(0, $name['fname']);
     //mname
     $pdf->SetX(187);
     $pdf->Write(0, $name['mname'][0] . '.');
     $pdf->Ln(10);
     //date of file
     $pdf->SetX(20);
     $pdf->Write(0, $c->date_file);
     //position
     $pdf->SetFont('Arial', 'B', 10);
     $pdf->SetX(63);
     $pdf->Write(0, $name['position']);
     $pdf->SetFont('Arial', 'B', 12);
     //monthly salary
     $pdf->SetX(140);
     $pdf->Write(0, 'P ' . number_format($this->Salary_grade->get_monthly_salary($name['salary_grade'], $name['step']), 2));
     $pdf->Ln(13);
     $pdf->SetX(30);
     $pdf->Write(0, $c->days . ' ' . $days);
     $pdf->SetX(140);
     //$pdf->Write(0, 'daily rate here');
     $pdf->Ln(13);
     $pdf->SetX(50);
     $pdf->Write(0, $this->Helps->get_month_name($c->month) . ' ' . $c->dates . ', ' . $c->year);
     $cto_balances_as_of = date("F d, Y", strtotime($c->date_file . "-1 day"));
     $pdf->Ln(30);
     $pdf->SetX(30);
     //$pdf->Write(0, $cto_balances_as_of);
     $pdf->Ln(10);
     $pdf->SetX(35);
     //$pdf->Write(0, $total_balance);
     $pdf->Ln(6);
     $pdf->SetX(120);
     $pdf->Cell(73, 4, strtoupper($office['office_head']), '0', 0, 'C', FALSE);
     $pdf->Ln(5);
     $pdf->SetFont('Arial', '', 10);
     $pdf->SetX(120);
     $pdf->Cell(73, 4, $office['position'], '0', 0, 'C', FALSE);
     $pdf->SetFont('Arial', 'B', 12);
     $pdf->Ln(5);
     $pdf->SetX(22);
     $pdf->Cell(73, 4, strtoupper($statement_certified), '0', 0, 'C', FALSE);
     $pdf->Ln(5);
     $pdf->SetFont('Arial', '', 10);
     $pdf->SetX(22);
     $pdf->Cell(73, 4, $statement_certified_position, '0', 0, 'C', FALSE);
     $pdf->SetFont('Arial', 'B', 12);
     header('Cache-Control: maxage=3600');
     //Adjust maxage appropriately
     header('Pragma: public');
     $pdf->Output('dtr/reports/cto-apps-' . intval($c->employee_id) . '.pdf', 'I');
     //return Redirect::to('dtr/reports/leave-apps-'.$rows['employee_id'].'.pdf', 'refresh');
 }
$texto = $row2["SA_OBSERVACIONES"];
$pdf->WordWrap($texto, 176);
$texto = explode("\n", $texto);
for ($i=0; $i<count($texto); $i++) {
	if ($i > 1)
		break;

	$str = trim($texto[$i]);

	$pdf->Cell(1);
	$pdf->Cell(0, 0, $str);
	$pdf->Ln(4.2);
}

$pdf->SetY(235.4);
$pdf->SetX(76);
$pdf->Cell(44, 0, $row2["SA_LUGARSUSCRIPCION"]);

$pdf->Cell(10);
$pdf->Cell(8, 0, $row2["DIASUSCRIPCION"]);

$pdf->Cell(22);
$pdf->Cell(27, 0, $row2["MESSUSCRIPCION"], 0, 0, "C");

$pdf->Cell(6);
$pdf->Cell(10, 0, $row2["ANOSUSCRIPCION"]);

$pdf->Ln(9.4);
$pdf->Cell(24);
$pdf->Cell(71, 0, $row2["NOMBRECOMERCIALIZADOR"]);
예제 #16
0
 /**
  * we redifine the original SetX method, because we don't want the automatic treatment.
  * It is HTML2PDF that make the treatment
  *
  * @param float   $x
  * @param boolean $rtloff NOT USED
  * @access public
  */
 public function SetX($x, $rtloff = false)
 {
     if (!$rtloff and $this->rtl) {
         parent::SetX($x, $rtloff);
     } else {
         $this->x = $x;
     }
 }
예제 #17
-2
 function page4($employee_id)
 {
     $this->load->helper('settings');
     $this->load->library('fpdf');
     //define('FPDF_FONTPATH',$this->config->item('fonts_path'));
     $this->load->library('fpdi');
     //print_r($personal_info);
     // initiate FPDI
     $pdf = new FPDI('P', 'mm', 'Legal');
     // add a page
     $pdf->AddPage();
     // set the sourcefile
     $pdf->setSourceFile('dtr/template/pds/page4.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(8, 14);
     $q = new Question();
     $q->order_by('question_no');
     $questions = $q->get_by_employee_id($employee_id);
     foreach ($questions as $question) {
         if ($question->question_no == 1) {
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 2) {
             $pdf->Ln(21);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 3) {
             $pdf->Ln(26);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 4) {
             $pdf->Ln(21);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 5) {
             $pdf->Ln(26);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 6) {
             $pdf->Ln(26);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 7) {
             $pdf->Ln(21);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 8) {
             $pdf->Ln(35);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 9) {
             $pdf->Ln(12);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 10) {
             $pdf->Ln(13);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
     }
     $pdf->SetXY(8, 233);
     //$pdf->Write(0, 'X');
     $r = new Reference();
     $references = $r->get_by_employee_id($employee_id);
     foreach ($references as $reference) {
         $pdf->SetX(8);
         $pdf->Write(0, $reference->name);
         $pdf->SetX(72);
         $pdf->Write(0, $reference->address);
         $pdf->SetX(134);
         $pdf->Write(0, $reference->tel_no);
         $pdf->Ln(4);
     }
     // CTC NO
     $pdf->SetXY(15, 275);
     $pdf->Write(0, $reference->ctc_no);
     $pdf->Ln(13);
     $pdf->SetX(15);
     $pdf->Write(0, $reference->issue_at);
     $pdf->Ln(13);
     $pdf->SetX(15);
     $pdf->Write(0, $reference->issue_on);
     $pdf->SetX(90);
     $pdf->Write(0, date('F d, Y'));
     // Output
     $pdf->Output('dtr/template/pds/page4_' . $employee_id . '.pdf', 'F');
     //header("location:".base_url()."resources/pdfs/archives/page4_".$employee_id.'.pdf');
     $this->pds[] = 'dtr/template/pds/page4_' . $employee_id . '.pdf';
 }