本文整理汇总了PHP中FPDI::SetRightMargin方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDI::SetRightMargin方法的具体用法?PHP FPDI::SetRightMargin怎么用?PHP FPDI::SetRightMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPDI
的用法示例。
在下文中一共展示了FPDI::SetRightMargin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
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);
//.........这里部分代码省略.........
示例2: define
function leave_certification_quezon($vl = 0, $sl = 0, $employee_id = '1')
{
$this->load->library('fpdf');
define('FPDF_FONTPATH', $this->config->item('fonts_path'));
$this->load->library('fpdi');
// initiate FPDI
$pdf = new FPDI('P', 'mm', 'Letter');
// Margin
$pdf->SetRightMargin(22);
// add a page
$pdf->AddPage();
// set the sourcefile
$pdf->setSourceFile('dtr/template/certification/quezon_certification.pdf');
// select the first page
$tplIdx = $pdf->importPage(1);
// use the page we imported
$pdf->useTemplate($tplIdx);
$vacation_leave = $vl;
$sick_leave = $sl;
$name = $this->Employee->get_employee_info($employee_id);
$office_name = $this->Office->get_office_name($name['office_id']);
// set font, font style, font size.
$pdf->SetFont('Arial', '', 12);
// set initial placement
$pdf->SetXY(136, 50.5);
// line break
$last_earn = $this->Leave_card->get_last_earn($rows['employee_id']);
if ($last_earn != '') {
$last_earn = date('F d, Y', strtotime($last_earn));
} else {
$dt = new Carbon();
$dt->subMonth();
$date = new Carbon('last day of ' . $this->Helps->get_month_name($dt->month) . ' ' . $dt->year);
$last_earn = $this->Helps->get_month_name($date->month) . ' ' . $date->day . ', ' . $date->year;
}
//$pdf->Write(0, date('F').' '.date('d').', '.date('Y'));
$pdf->Ln(37);
// go to 25 X (indent)
$pdf->SetX(35);
$extension = '';
if ($name['extension'] != '') {
$extension = ', ' . $name['extension'];
}
$pdf->MultiCell(0, 6, " This is to certify that as per our office records, " . $name['salut'] . ' ' . ucwords(strtolower(utf8_decode($name['fname']))) . ' ' . ucwords(strtolower(utf8_decode($name['mname']))) . ' ' . ucwords(strtolower(utf8_decode($name['lname']))) . $extension . ', ' . $name['position'] . ' in the ' . utf8_decode($office_name) . ' has the following leave balances as of ' . $last_earn . '.', 0, 'J', false);
$pdf->Ln(5.5);
$pdf->SetX(35);
// set font, font style, font size.
$pdf->SetFont('Arial', '', 12);
//$pdf->Write(0, $name['position']);
$pdf->Ln(5.5);
$pdf->SetX(35);
//$pdf->Write(0, $office_name);
$pdf->Ln(5.5);
$pdf->SetX(35);
$pdf->Ln(4);
$pdf->SetX(35);
// set font, font style, font size.
$pdf->SetFont('Arial', '', 12);
//get the last month that earned leave credit
$last_month_last_day = date('Y-m-d', strtotime('-1 second', strtotime(date('m') . '/01/' . date('Y') . ' 00:00:00')));
//list($year, $month, $day) = split('[-.-]', $last_month_last_day);deprecated
list($year, $month, $day) = explode('-', $last_month_last_day);
$last_month_last_day = date("F d, Y", mktime(0, 0, 0, $month, $day, $year));
$pdf->SetX(136);
$pdf->SetXY(128, 119);
$pdf->Write(0, number_format($vacation_leave, 3));
//sick
$pdf->SetXY(128, 125);
$pdf->Write(0, number_format($sick_leave, 3));
//total
$pdf->SetXY(128, 131);
$pdf->Write(0, number_format($vacation_leave + $sick_leave, 3));
$pdf->Ln(5);
$pdf->SetX(35);
$pdf->MultiCell(0, 6, " This certification is being issued for whatever legal purpose it may serve.", 0, 'L', false);
$pdf->Ln(5);
$pdf->SetX(35);
$pdf->MultiCell(0, 6, " Issued this " . date('jS') . " day of " . date('F, Y') . ", in Lucena City.", 0, 'L', false);
$pdf->Ln(15);
$pdf->SetX(110);
$statement_prepared = Setting::getField('statement_prepared');
$statement_prepared_position = Setting::getField('statement_prepared_position');
$statement_certified = Setting::getField('statement_certified');
$statement_certified_position = Setting::getField('statement_certified_position');
$pdf->SetFont('Arial', 'B', 12);
//$pdf->Cell(90,5, $statement_prepared, '0', 0,'C',false); //4th param border
$pdf->Cell(90, 5, utf8_decode($statement_certified), '0', 1, 'C', false);
$pdf->SetFont('Arial', '', 12);
//$pdf->Cell(90,5, $statement_prepared_position, '0', 0,'C',false);
$pdf->SetX(110);
$pdf->Cell(90, 5, $statement_certified_position, '0', 1, 'C', false);
header('Cache-Control: maxage=3600');
//Adjust maxage appropriately
header('Pragma: public');
//$pdf->Output('dtr/reports/leave_certification_'.$employee_id.'.pdf', 'F');
$pdf->Output('dtr/reports/leave_certification_' . $employee_id . '.pdf', 'I');
//return Redirect::to('dtr/reports/leave_certification_'.$employee_id.'.pdf', 'refresh');
}