本文整理汇总了PHP中Environment::getImagesPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Environment::getImagesPath方法的具体用法?PHP Environment::getImagesPath怎么用?PHP Environment::getImagesPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Environment
的用法示例。
在下文中一共展示了Environment::getImagesPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getROE
function getROE($rlf = NULL, $show_background = TRUE)
{
if (!is_object($rlf) and $this->getId() != '') {
$rlf = TTnew('ROEListFactory');
$rlf->getById($this->getId());
}
if (get_class($rlf) !== 'ROEListFactory') {
return FALSE;
}
$border = 0;
if ($rlf->getRecordCount() > 0) {
$ppsf = TTnew('PayPeriodScheduleListFactory');
$pay_period_type_options = $ppsf->getOptions('type');
$pdf = new TTPDF();
$pdf->setMargins(0, 0, 0, 0);
$pdf->SetAutoPageBreak(FALSE);
foreach ($rlf as $r_obj) {
$pdf->SetFont('freesans', '', 12);
//Get User information
$ulf = TTnew('UserListFactory');
$user_obj = $ulf->getById($r_obj->getUser())->getCurrent();
$ulf = TTnew('UserListFactory');
$created_user_obj = $ulf->getById($r_obj->getCreatedBy())->getCurrent();
//Get company information
$clf = TTnew('CompanyListFactory');
$company_obj = $clf->getById($user_obj->getCompany())->getCurrent();
$pdf->AddPage();
if ($show_background == TRUE) {
//Use this command to convert PDF to images: convert -density 600x600 -quality 00 $file
$pdf->Image(Environment::getImagesPath() . 'roe-template.jpg', 0, 0, 210, 300);
}
//Serial
$pdf->setXY(10, 17);
$pdf->Cell(55, 10, $r_obj->getSerial(), $border, 0, 'L');
//Employer Info
$pdf->setXY(10, 30);
$pdf->Cell(120, 10, $company_obj->getName(), $border, 0, 'L');
$pdf->setXY(10, 40);
$pdf->Cell(120, 10, $company_obj->getAddress1() . ' ' . $company_obj->getAddress2(), $border, 0, 'L');
$pdf->setXY(10, 50);
$pdf->Cell(90, 10, $company_obj->getCity() . ', ' . $company_obj->getProvince(), $border, 0, 'L');
$postal_code_a = substr($company_obj->getPostalCode(), 0, 3);
$postal_code_b = substr($company_obj->getPostalCode(), 3, 6);
$pdf->setXY(110, 50);
$pdf->Cell(10, 10, $postal_code_a, $border, 0, 'L');
$pdf->setXY(122, 50);
$pdf->Cell(10, 10, $postal_code_b, $border, 0, 'L');
//Business Number
$pdf->setXY(138, 28);
$pdf->Cell(120, 10, $company_obj->getBusinessNumber(), $border, 0, 'L');
//Pay Period Type
$pdf->setXY(138, 40);
$pdf->Cell(50, 10, $pay_period_type_options[$r_obj->getPayPeriodType()], $border, 0, 'L');
//SIN
$pdf->setXY(138, 50);
$pdf->Cell(50, 10, $user_obj->getSIN(), $border, 0, 'L');
//Employee info
$pdf->SetFontSize(10);
$pdf->setXY(10, 75);
$pdf->Cell(90, 5, $user_obj->getFullName(), $border, 0, 'L');
$pdf->setXY(10, 80);
$pdf->Cell(90, 5, $user_obj->getAddress1() . ' ' . $user_obj->getAddress2(), $border, 0, 'L');
$pdf->setXY(10, 85);
$pdf->Cell(90, 5, $user_obj->getCity() . ', ' . $user_obj->getProvince() . ' ' . $user_obj->getPostalCode(), $border, 0, 'L');
$pdf->SetFontSize(12);
//Employee Title
if (is_object($user_obj->getTitleObject())) {
$title = $user_obj->getTitleObject()->getName();
} else {
$title = NULL;
}
$pdf->setXY(10, 100);
$pdf->Cell(90, 10, $title, $border, 0, 'L');
//First Day Worked
$pdf->SetFontSize(10);
$first_date = getdate($r_obj->getFirstDate());
$pdf->setXY(175, 64);
$pdf->Cell(8, 10, $first_date['mday'], $border, 0, 'C');
$pdf->setXY(185, 64);
$pdf->Cell(8, 10, $first_date['mon'], $border, 0, 'C');
$pdf->setXY(196, 64);
$pdf->Cell(10, 10, $first_date['year'], $border, 0, 'C');
//Last day paid
$last_date = getdate($r_obj->getLastDate());
$pdf->setXY(175, 75);
$pdf->Cell(8, 10, $last_date['mday'], $border, 0, 'C');
$pdf->setXY(185, 75);
$pdf->Cell(8, 10, $last_date['mon'], $border, 0, 'C');
$pdf->setXY(196, 75);
$pdf->Cell(10, 10, $last_date['year'], $border, 0, 'C');
//Pay Period End Date
$pay_period_end_date = getdate($r_obj->getPayPeriodEndDate());
$pdf->setXY(175, 86);
$pdf->Cell(8, 10, $pay_period_end_date['mday'], $border, 0, 'C');
$pdf->setXY(185, 86);
$pdf->Cell(8, 10, $pay_period_end_date['mon'], $border, 0, 'C');
$pdf->setXY(196, 86);
$pdf->Cell(10, 10, $pay_period_end_date['year'], $border, 0, 'C');
//Insurable Hours
$pdf->SetFontSize(10);
//.........这里部分代码省略.........
示例2: getLogoFileName
function getLogoFileName($company_id = NULL, $include_default_logo = TRUE)
{
//Test for both jpg and png
$base_name = $this->getStoragePath($company_id) . DIRECTORY_SEPARATOR . 'logo';
if (file_exists($base_name . '.jpg')) {
$logo_file_name = $base_name . '.jpg';
} elseif (file_exists($base_name . '.png')) {
$logo_file_name = $base_name . '.png';
} else {
if ($include_default_logo == TRUE) {
$logo_file_name = Environment::getImagesPath() . 'timetrex_logo_wbg_small2.jpg';
} else {
return FALSE;
}
}
Debug::Text('Logo File Name: ' . $logo_file_name, __FILE__, __LINE__, __METHOD__, 10);
return $logo_file_name;
}
示例3: getPhotoFileName
function getPhotoFileName($company_id = NULL, $user_id = NULL, $include_default_photo = TRUE)
{
//Test for both jpg and png
$base_name = $this->getStoragePath($company_id) . DIRECTORY_SEPARATOR . $user_id;
if (file_exists($base_name . '.jpg')) {
$photo_file_name = $base_name . '.jpg';
} elseif (file_exists($base_name . '.png')) {
$photo_file_name = $base_name . '.png';
} else {
if ($include_default_photo == TRUE) {
//$photo_file_name = Environment::getImagesPath().'unknown_photo.png';
$photo_file_name = Environment::getImagesPath() . 's.gif';
} else {
return FALSE;
}
}
//Debug::Text('Logo File Name: '. $photo_file_name .' Base Name: '. $base_name .' User ID: '. $user_id .' Include Default: '. (int)$include_default_photo, __FILE__, __LINE__, __METHOD__,10);
return $photo_file_name;
}
示例4: getLogoFileName
function getLogoFileName($company_id = NULL, $include_default_logo = TRUE, $primary_company_logo = FALSE, $size = 'normal')
{
//Test for both jpg and png
$base_name = $this->getStoragePath($company_id) . DIRECTORY_SEPARATOR . 'logo';
if (file_exists($base_name . '.jpg')) {
$logo_file_name = $base_name . '.jpg';
} elseif (file_exists($base_name . '.png')) {
$logo_file_name = $base_name . '.png';
} else {
if ($include_default_logo == TRUE) {
//Check for primary company logo first, so branding gets carried over automatically.
if ($company_id != PRIMARY_COMPANY_ID) {
$logo_file_name = $this->getLogoFileName(PRIMARY_COMPANY_ID, $include_default_logo, $primary_company_logo, $size);
} else {
if ($primary_company_logo == TRUE and defined('TIMETREX_API') and TIMETREX_API === TRUE) {
//Only display login logo on the login page, not the top right logo once logged in, as its not the proper size.
$logo_file_name = Environment::getImagesPath() . 'timetrex_logo_flex_login.png';
} else {
if (strtolower($size) == 'large') {
$logo_file_name = Environment::getImagesPath() . 'timetrex_logo_wbg_large.png';
} else {
$logo_file_name = Environment::getImagesPath() . 'timetrex_logo_wbg_small2.png';
}
}
}
} else {
return FALSE;
}
}
Debug::Text('Logo File Name: ' . $logo_file_name . ' Include Default: ' . (int) $include_default_logo . ' Primary Company Logo: ' . (int) $primary_company_logo . ' Size: ' . $size, __FILE__, __LINE__, __METHOD__, 10);
return $logo_file_name;
}