本文整理汇总了PHP中TTi18n::setMasterLocale方法的典型用法代码示例。如果您正苦于以下问题:PHP TTi18n::setMasterLocale方法的具体用法?PHP TTi18n::setMasterLocale怎么用?PHP TTi18n::setMasterLocale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTi18n
的用法示例。
在下文中一共展示了TTi18n::setMasterLocale方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPayStub
//.........这里部分代码省略.........
//
//Descriptions
//
if (isset($pay_stub_entry_descriptions) and count($pay_stub_entry_descriptions) > 0) {
//Description Header
$block_adjust_y = $block_adjust_y + 5;
$pdf->SetFont('', 'B', 10);
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y, $adjust_y));
$pdf->Cell(175, 5, TTi18n::gettext('Notes'), $border, 0, 'L');
$block_adjust_y = $block_adjust_y + 5;
$pdf->SetFont('', '', 8);
$x = 0;
foreach ($pay_stub_entry_descriptions as $pay_stub_entry_description) {
if ($x % 2 == 0) {
$pdf->setXY(Misc::AdjustXY(2, $adjust_x), Misc::AdjustXY($block_adjust_y, $adjust_y));
} else {
$pdf->setXY(Misc::AdjustXY(90, $adjust_x), Misc::AdjustXY($block_adjust_y, $adjust_y));
}
//$pdf->Cell(173,5, '['.$pay_stub_entry_description['subscript'].'] '.$pay_stub_entry_description['description'], $border, 0, 'L');
$pdf->Cell(85, 5, '[' . $pay_stub_entry_description['subscript'] . '] ' . $pay_stub_entry_description['description'], $border, 0, 'L');
if ($x % 2 != 0) {
$block_adjust_y = $block_adjust_y + 5;
}
$x++;
}
}
unset($x, $pay_stub_entry_descriptions, $pay_stub_entry_description);
//
// Pay Stub Footer
//
$block_adjust_y = 215;
//Line
$pdf->setLineWidth(1);
$pdf->Line(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y, $adjust_y), Misc::AdjustXY(185, $adjust_y), Misc::AdjustXY($block_adjust_y, $adjust_y));
//Non Negotiable
$pdf->SetFont('', 'B', 14);
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 3, $adjust_y));
$pdf->Cell(175, 5, TTi18n::gettext('NON NEGOTIABLE'), $border, 0, 'C', 0);
//Employee Address
$pdf->SetFont('', 'B', 12);
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 9, $adjust_y));
$pdf->Cell(60, 5, TTi18n::gettext('CONFIDENTIAL'), $border, 0, 'C', 0);
$pdf->SetFont('', '', 10);
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 14, $adjust_y));
$pdf->Cell(60, 5, $user_obj->getFullName(), $border, 0, 'C', 0);
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 19, $adjust_y));
$pdf->Cell(60, 5, $user_obj->getAddress1(), $border, 0, 'C', 0);
$address2_adjust_y = 0;
if ($user_obj->getAddress2() != '') {
$address2_adjust_y = 5;
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 24, $adjust_y));
$pdf->Cell(60, 5, $user_obj->getAddress2(), $border, 0, 'C', 0);
}
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 24 + $address2_adjust_y, $adjust_y));
$pdf->Cell(60, 5, $user_obj->getCity() . ', ' . $user_obj->getProvince() . ' ' . $user_obj->getPostalCode(), $border, 1, 'C', 0);
//Pay Period - Balance - ID
$net_pay_amount = 0;
if (isset($pay_stub_entries[40][0])) {
$net_pay_amount = $pay_stub_entries[40][0]['amount'];
}
if (isset($pay_stub_entries[65]) and count($pay_stub_entries[65]) > 0) {
$net_pay_label = TTi18n::gettext('Balance');
} else {
$net_pay_label = TTi18n::gettext('Net Pay');
}
/*
if ( $pay_period_schedule_obj->getType() != 5 AND $pay_period_number > 0 AND $pay_period_schedule_obj->getAnnualPayPeriods() > 0 ) {
$pdf->setXY( Misc::AdjustXY(125, $adjust_x), Misc::AdjustXY($block_adjust_y+10, $adjust_y) );
$pdf->Cell(50, 5, TTi18n::gettext('Pay Period').' '. $pay_period_number .' '. TTi18n::gettext('of') .' '. $pay_period_schedule_obj->getAnnualPayPeriods(), $border, 1, 'L', 0);
}
*/
$pdf->SetFont('', 'B', 12);
$pdf->setXY(Misc::AdjustXY(125, $adjust_x), Misc::AdjustXY($block_adjust_y + 17, $adjust_y));
$pdf->Cell(50, 5, $net_pay_label . ': ' . $pay_stub_obj->getCurrencyObject()->getSymbol() . $net_pay_amount . ' ' . $pay_stub_obj->getCurrencyObject()->getISOCode(), $border, 1, 'L', 0);
if ($pay_stub_obj->getTainted() == TRUE) {
$tainted_flag = 'T';
} else {
$tainted_flag = '';
}
$pdf->SetFont('', '', 8);
$pdf->setXY(Misc::AdjustXY(125, $adjust_x), Misc::AdjustXY($block_adjust_y + 30, $adjust_y));
$pdf->Cell(50, 5, TTi18n::gettext('Identification #:') . ' ' . str_pad($pay_stub_obj->getId(), 12, 0, STR_PAD_LEFT) . $tainted_flag, $border, 1, 'L', 0);
unset($net_pay_amount, $tainted_flag);
//Line
$pdf->setLineWidth(1);
$pdf->Line(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 35, $adjust_y), Misc::AdjustXY(185, $adjust_y), Misc::AdjustXY($block_adjust_y + 35, $adjust_y));
$pdf->SetFont('', '', 6);
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 38, $adjust_y));
$pdf->Cell(175, 1, TTi18n::gettext('Pay Stub Generated by') . ' ' . APPLICATION_NAME, $border, 0, 'C', 0);
unset($pay_period_schedule_obj, $pay_stub_entries, $pay_period_number);
$i++;
}
$output = $pdf->Output('', 'S');
}
TTi18n::setMasterLocale();
if (isset($output)) {
return $output;
}
return FALSE;
}
示例2: getPayStub
//.........这里部分代码省略.........
unset($balance);
}
$pdf->Rect($accrual_time_header_start_x, $accrual_time_header_start_y, 95, $box_height);
unset($accrual_time_header_start_x, $accrual_time_header_start_y, $box_height);
}
//
//Descriptions
//
if (isset($pay_stub_entry_descriptions) and count($pay_stub_entry_descriptions) > 0) {
//Description Header
$block_adjust_y = $block_adjust_y + 5;
$pdf->SetFont('', 'B', 10);
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y, $adjust_y));
$pdf->Cell(175, 5, TTi18n::gettext('Notes'), $border, 0, 'L', FALSE, '', 1);
$block_adjust_y = $block_adjust_y + 5;
$pdf->SetFont('', '', 8);
$x = 0;
foreach ($pay_stub_entry_descriptions as $pay_stub_entry_description) {
if ($x % 2 == 0) {
$pdf->setXY(Misc::AdjustXY(2, $adjust_x), Misc::AdjustXY($block_adjust_y, $adjust_y));
} else {
$pdf->setXY(Misc::AdjustXY(90, $adjust_x), Misc::AdjustXY($block_adjust_y, $adjust_y));
}
$pdf->Cell(85, 5, '[' . $pay_stub_entry_description['subscript'] . '] ' . html_entity_decode($pay_stub_entry_description['description']), $border, 0, 'L', FALSE, '', 1);
if ($x % 2 != 0) {
$block_adjust_y = $block_adjust_y + 5;
}
$x++;
}
}
unset($x, $pay_stub_entry_descriptions, $pay_stub_entry_description);
//
// Pay Stub Footer
//
$block_adjust_y = 215;
//Line
$pdf->setLineWidth(1);
$pdf->Line(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y, $adjust_y), Misc::AdjustXY(185, $adjust_y), Misc::AdjustXY($block_adjust_y, $adjust_y));
//Non Negotiable
$pdf->SetFont('', 'B', 14);
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 3, $adjust_y));
$pdf->Cell(175, 5, TTi18n::gettext('NON NEGOTIABLE'), $border, 0, 'C', FALSE, '', 1);
//Employee Address
$pdf->SetFont('', 'B', 12);
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 9, $adjust_y));
$pdf->Cell(60, 5, TTi18n::gettext('CONFIDENTIAL'), $border, 0, 'C', FALSE, '', 1);
$pdf->SetFont('', '', 10);
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 14, $adjust_y));
$pdf->Cell(60, 5, $user_obj->getFullName() . ' (#' . $user_obj->getEmployeeNumber() . ')', $border, 0, 'C', FALSE, '', 1);
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 19, $adjust_y));
$pdf->Cell(60, 5, $user_obj->getAddress1(), $border, 0, 'C', FALSE, '', 1);
$address2_adjust_y = 0;
if ($user_obj->getAddress2() != '') {
$address2_adjust_y = 5;
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 24, $adjust_y));
$pdf->Cell(60, 5, $user_obj->getAddress2(), $border, 0, 'C', FALSE, '', 1);
}
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 24 + $address2_adjust_y, $adjust_y));
$pdf->Cell(60, 5, $user_obj->getCity() . ', ' . $user_obj->getProvince() . ' ' . $user_obj->getPostalCode(), $border, 1, 'C', FALSE, '', 1);
//Pay Period - Balance - ID
$net_pay_amount = 0;
if (isset($pay_stub_entries[40][0])) {
$net_pay_amount = TTi18n::formatNumber($pay_stub_entries[40][0]['amount'], TRUE, $pay_stub_obj->getCurrencyObject()->getRoundDecimalPlaces());
}
if (isset($pay_stub_entries[65]) and count($pay_stub_entries[65]) > 0) {
$net_pay_label = TTi18n::gettext('Balance');
} else {
$net_pay_label = TTi18n::gettext('Net Pay');
}
$pdf->SetFont('', 'B', 12);
$pdf->setXY(Misc::AdjustXY(75, $adjust_x), Misc::AdjustXY($block_adjust_y + 17, $adjust_y));
$pdf->Cell(100, 5, $net_pay_label . ': ' . $pay_stub_obj->getCurrencyObject()->getSymbol() . $net_pay_amount . ' ' . $pay_stub_obj->getCurrencyObject()->getISOCode(), $border, 1, 'R', FALSE, '', 1);
if ($pay_stub_obj->getTainted() == TRUE) {
$tainted_flag = 'T';
} else {
$tainted_flag = '';
}
$pdf->SetFont('', '', 8);
$pdf->setXY(Misc::AdjustXY(125, $adjust_x), Misc::AdjustXY($block_adjust_y + 30, $adjust_y));
$pdf->Cell(50, 5, TTi18n::gettext('Identification #:') . ' ' . str_pad($pay_stub_obj->getId(), 12, 0, STR_PAD_LEFT) . $tainted_flag, $border, 1, 'R', FALSE, '', 1);
unset($net_pay_amount, $tainted_flag);
//Line
$pdf->setLineWidth(1);
$pdf->Line(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 35, $adjust_y), Misc::AdjustXY(185, $adjust_y), Misc::AdjustXY($block_adjust_y + 35, $adjust_y));
$pdf->SetFont('', '', 6);
$pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY($block_adjust_y + 38, $adjust_y));
$pdf->Cell(175, 1, TTi18n::getText('Pay Stub Generated by') . ' ' . APPLICATION_NAME . ' @ ' . TTDate::getDate('DATE+TIME', $pay_stub_obj->getCreatedDate()), $border, 0, 'C', FALSE, '', 1);
unset($pay_stub_entries, $pay_period_number);
$this->getProgressBarObject()->set(NULL, $pslf->getCurrentRow());
$i++;
}
Debug::Text('Generating PDF...', __FILE__, __LINE__, __METHOD__, 10);
$output = $pdf->Output('', 'S');
}
TTi18n::setMasterLocale();
if (isset($output)) {
return $output;
}
return FALSE;
}