当前位置: 首页>>代码示例>>PHP>>正文


PHP Misc::getBeforeDecimal方法代码示例

本文整理汇总了PHP中Misc::getBeforeDecimal方法的典型用法代码示例。如果您正苦于以下问题:PHP Misc::getBeforeDecimal方法的具体用法?PHP Misc::getBeforeDecimal怎么用?PHP Misc::getBeforeDecimal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Misc的用法示例。


在下文中一共展示了Misc::getBeforeDecimal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getROE


//.........这里部分代码省略.........
             } 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);
             $pdf->setXY(75, 113);
             $pdf->Cell(25, 10, Misc::getBeforeDecimal($r_obj->getInsurableHours()), $border, 0, 'R');
             $pdf->setXY(101, 113);
             $pdf->Cell(10, 10, Misc::getAfterDecimal(Misc::MoneyFormat($r_obj->getInsurableHours(), FALSE)), $border, 0, 'L');
             //Enter Code
             $pdf->setXY(185, 113);
             $pdf->Cell(10, 10, $r_obj->getCode(), $border, 0, 'C');
             //Further Information Contact Name
             $pdf->setXY(130, 126);
             $pdf->Cell(75, 5, $created_user_obj->getFullName(), $border, 0, 'R');
             $pdf->setXY(130, 132);
             $pdf->Cell(75, 10, $created_user_obj->getWorkPhone(), $border, 0, 'R');
             //Insurable Earnings
             $pdf->setXY(75, 131);
             $pdf->Cell(25, 10, Misc::getBeforeDecimal($r_obj->getInsurableEarnings()), $border, 0, 'R');
             $pdf->setXY(101, 131);
             $pdf->Cell(10, 10, Misc::getAfterDecimal(Misc::MoneyFormat($r_obj->getInsurableEarnings(), FALSE)), $border, 0, 'L');
             //Check to see if a pay period didn't have earnings.
             if ($r_obj->isPayPeriodWithNoEarnings() == TRUE) {
                 $pay_period_earnings = $r_obj->getInsurableEarningsByPayPeriod();
                 if (is_array($pay_period_earnings)) {
                     //Add additional entries for testing alignment purposes.
                     /*
                     for( $y=0; $y < 14; $y++ ) {
                     	$pay_period_earnings[] = array('amount' => rand(1,10) );
                     }
                     */
                     $top_left_x = $x = Misc::AdjustXY(30, 0);
                     $top_left_y = $y = Misc::AdjustXY(157, 0);
                     $col = 1;
                     $i = 1;
                     foreach ($pay_period_earnings as $pay_period_earning) {
                         Debug::Text('I: ' . $i . ' X: ' . $x . ' Y: ' . $y . ' Col: ' . $col . ' Amount: ' . (double) $pay_period_earning['amount'], __FILE__, __LINE__, __METHOD__, 10);
                         $pdf->setXY($x, $y);
开发者ID:alachaum,项目名称:timetrex,代码行数:67,代码来源:ROEFactory.class.php

示例2: isLengthBeforeDecimal

 function isLengthBeforeDecimal($label, $value, $msg = NULL, $min = 1, $max = 255)
 {
     $len = strlen(Misc::getBeforeDecimal($value));
     //Debug::text('Value: '. $value .' Length: '. $len .' Min: '. $min .' Max: '. $max, __FILE__, __LINE__, __METHOD__, $this->verbosity);
     if ($len < $min or $len > $max) {
         $this->Error($label, $msg, $value);
         return FALSE;
     }
     return TRUE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:10,代码来源:Validator.class.php

示例3: strlen

                 //Voucher
                 $ein = @explode('-', $current_company->getBusinessNumber());
                 if (isset($ein[0]) and isset($ein[1])) {
                     $pdf->setXY(15, 236);
                     $pdf->Cell(13, 6, $ein[0], $border, 0, 'R');
                     $pdf->setXY(29, 236);
                     $pdf->Cell(40, 6, $ein[1], $border, 0, 'L');
                 }
                 $pdf->setXY(82, 244);
                 $pdf->Cell(75, 6, $current_company->getName(), $border, 0, 'L');
                 $pdf->setXY(82, 253);
                 $pdf->Cell(45, 6, $current_company->getAddress1() . ' ' . $current_company->getAddress2(), $border, 0, 'L');
                 $pdf->setXY(82, 261);
                 $pdf->Cell(45, 6, $current_company->getCity() . ', ' . $current_company->getProvince() . ' ' . $current_company->getPostalCode(), $border, 0, 'L');
                 $pdf->setXY(157, 234);
                 $pdf->Cell(35, 6, Misc::getBeforeDecimal(Misc::MoneyFormat($lines_arr['total']['p1_6'], FALSE)), $border, 0, 'R');
                 $pdf->setXY(193, 234);
                 $pdf->Cell(6, 6, Misc::getAfterDecimal(Misc::MoneyFormat($lines_arr['total']['p1_6'], FALSE)), $border, 0, 'L');
             }
             $output = $pdf->Output('', 'S');
             if (Debug::getVerbosity() == 11) {
                 Debug::Display();
             } else {
                 Misc::FileDownloadHeader('f940ez.pdf', 'application/pdf', strlen($output));
                 echo $output;
             }
             exit;
         }
     }
     break;
 case 'delete':
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:31,代码来源:Form940ez.php

示例4: drawCell

 function drawCell($data, $field_layout_data, $additional_x_offset = 0, $additional_y_offset = 0)
 {
     if (isset($data) and $data !== NULL or $this->getShowBorder() == TRUE) {
         Debug::Text('&nbsp;&nbsp;Data: ' . $data, __FILE__, __LINE__, __METHOD__, 10);
         if (isset($field_layout_data['x']) and $field_layout_data['y']) {
             $this->getPDFObject()->setXY(Misc::AdjustXY($field_layout_data['x'], $this->getXOffset() + $additional_x_offset), Misc::AdjustXY($field_layout_data['y'], $this->getYOffset() + $additional_y_offset));
         }
         if (!isset($field_layout_data['ln'])) {
             $field_layout_data['ln'] = 0;
         }
         if (isset($field_layout_data['fontsize'])) {
             if (!isset($field_layout_data['fontstyle'])) {
                 $field_layout_data['fontstyle'] = $this->getDefaultFontStyle();
             }
             $this->getPDFObject()->SetFont($this->getDefaultFont(), $field_layout_data['fontstyle'], $field_layout_data['fontsize']);
         }
         if (isset($field_layout_data['w']) and isset($field_layout_data['h']) and isset($field_layout_data['align'])) {
             if (isset($field_layout_data['multicell'])) {
                 $this->getPDFObject()->MultiCell($field_layout_data['w'], $field_layout_data['h'], $data, $this->getShowBorder(), $field_layout_data['align']);
             } else {
                 if (isset($field_layout_data['split_decimal'])) {
                     $this->getPDFObject()->Cell($field_layout_data['w'] - $this->getDecimalFieldSize(), $field_layout_data['h'], Misc::getBeforeDecimal($data), $this->getShowBorder(), 0, $field_layout_data['align']);
                     $this->getPDFObject()->Cell($this->getDecimalFieldSize(), $field_layout_data['h'], Misc::getAfterDecimal($data), $this->getShowBorder(), $field_layout_data['ln'], $field_layout_data['align']);
                 } else {
                     $this->getPDFObject()->Cell($field_layout_data['w'], $field_layout_data['h'], $data, $this->getShowBorder(), $field_layout_data['ln'], $field_layout_data['align']);
                 }
             }
         }
         if (isset($field_layout_data['fontsize'])) {
             $this->SetFont();
             //Return to default font
         }
     }
     return TRUE;
 }
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:35,代码来源:TaxForms.class.php


注:本文中的Misc::getBeforeDecimal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。