本文整理汇总了PHP中FPDI::SetFillColor方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDI::SetFillColor方法的具体用法?PHP FPDI::SetFillColor怎么用?PHP FPDI::SetFillColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPDI
的用法示例。
在下文中一共展示了FPDI::SetFillColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$_REQUEST["actual"] = $row["PRIMAANUALCOMPSINFORMATO"];
$_REQUEST["archivo"] = "W_".$_SESSION["usuario"]."_".date("YmdHis").".png";
$_REQUEST["provart"] = $row["PRIMAANUALSINFORMATO"];
require_once($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_cotizacion/generar_grafico_comparativo.php");
$graficoOk = true;
}
catch (Exception $e) {
$graficoOk = false;
}
// FIN - Generación de gráfico que va incrustado en el reporte..
if ($graficoOk) {
$pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_cotizacion/plantillas/analisis_comparativo_costos.pdf");
$pdf->SetDrawColor(255, 255, 255);
$pdf->SetFillColor(255, 255, 255);
$pdf->AddPage();
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx);
$pdf->SetFont("Arial", "B", 10);
$pdf->Ln(33);
$pdf->Cell(40);
$pdf->Cell(144, 0, $row["RAZONSOCIAL"]);
$pdf->Ln(6.6);
$pdf->Cell(28);
$pdf->Cell(36, 0, $row["CUIT"]);
$pdf->Cell(16);
示例2: save_ticket_data
/**
* Save post metadata when a post is saved.
*
* @param int $post_id The post ID.
* @param post $post The post object.
* @param bool $update Whether this is an existing post being updated or not.
*/
public function save_ticket_data($post_id, $post, $update)
{
global $product;
/*
* In production code, $slug should be set only once in the plugin,
* preferably as a class property, rather than in each function that needs it.
*/
$slug = 'product';
// If this isn't a 'product' post, don't update it.
if ($slug != $post->post_type) {
return;
}
$getprod = get_product($post_id);
//If it's not a ticket return aswell
if ($getprod->product_type != 'ticket') {
return;
}
$getmeta = get_post_meta($post_id, '_downloadable_files', true);
//Traverse the return array since we don't know the first key
foreach ($getmeta as $key => $value) {
$url = $value['file'];
}
$path = $_SERVER['DOCUMENT_ROOT'] . parse_url($url, PHP_URL_PATH);
//To get the dir, use: dirname($path)
require_once 'fpdf/fpdf.php';
require_once 'fpdi/fpdi.php';
//Get stuff to add to pdf :D
$getmetaall = get_post_meta($post_id);
$getcontent = get_post_meta($post_id, 'frs_woo_product_tabs', true);
$i = 1;
$pdf = new FPDI();
// $pdf->AddPage();
//Set the source PDF file
//$pagecount = $pdf->setSourceFile($path);
//Import the first page of the file
//$tpl = $pdf->importPage($i);
//Use this page as template
//$pdf->useTemplate($tpl);
#Print Hello World at the bottom of the page
//Clear all
$pdf->SetFillColor(255, 255, 255);
$pdf->SetY(1);
$pdf->SetFont('Arial', 'I', 19);
$pdf->Cell(0, $pdf->h - 2, ' ', 0, 0, 'C', true);
//Go to 1.5 cm from bottom
$pdf->SetY(1);
//Select Arial italic 8
$pdf->SetFont('Arial', 'I', 19);
//Print centered cell with a text in it
$pdf->Cell(0, 10, $post->post_title, 0, 0, 'C');
/*
$pdf->SetY(10);
$pdf->SetFont('Arial','I',16);
$pdf->Cell(0, 10, gmdate("Y-m-d", $getmetaall["wpcf-event-start-date"][0]), 0, 0, 'C');
$pdf->SetY(20);
$pdf->SetFont('Arial','I',16);
$pdf->Cell(0, 10, 'Start time: ' . $getmetaall["wpcf-event-start-time"][0], 0, 0, 'C');
$pdf->SetY(27);
$pdf->SetFont('Arial','I',16);
$pdf->Cell(0, 10, 'End time: ' . $getmetaall["wpcf-event-end-time"][0], 0, 0, 'C');
$pdf->SetY(1);
$pdf->Image('http://dancenergy.zenutech.com/production/wp-content/uploads/2014/06/Logo.png', 5, 0, 33.78);
*/
//Select Arial italic 8
$pdf->SetY(20);
$pdf->SetFont('Arial', 'I', 15);
$pdf->WriteHTML($getcontent[0]['ticket_content']);
$pdf->Output($path, "F");
/*
echo "<pre>";
var_dump( $getmetaall );
echo "</pre>";
*/
return;
}
示例3:
$pdf->Ln(4.4);
$pdf->Cell(9);
$pdf->Cell(128, 0, $row2["EMAIL"]);
$pdf->Cell(14);
$pdf->Cell(41, 0, $row2["TELEFONO"]);
$pdf->Ln(4.4);
$pdf->Cell(40);
$pdf->Cell(16, 0, $row2["ESTABLECIMIENTOS"]);
$pdf->Ln(2.4);
$pdf->SetFont("Arial", "", 7);
$pdf->SetDrawColor(255, 255, 255);
$pdf->SetFillColor(0, 135, 196);
switch ($row2["SA_NIVEL"]) {
case 1:
$pdf->Cell(66);
$pdf->Rect($pdf->GetX(), $pdf->GetY(), 4.2, 3.4, "F");
$pdf->Ln(2);
$pdf->Cell(66.6);
$pdf->Cell(0, 0, "I");
$pdf->Ln(-2);
break;
case 2:
$pdf->Cell(72.4);
$pdf->Rect($pdf->GetX(), $pdf->GetY(), 4, 3.4, "F");
$pdf->Ln(2);
$pdf->Cell(72.6);
$pdf->Cell(0, 0, "II");
示例4: generatePatientTrendReport
function generatePatientTrendReport($conn)
{
global $gTEXT;
$CountryName = $_POST['CountryName'];
require_once 'tcpdf/tcpdf.php';
require_once 'fpdf/fpdi.php';
$pdf = new FPDI();
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->AddPage();
$pdf->SetFillColor(255, 255, 255);
$StartMonthId = $_POST['StartMonthId'];
$StartYearId = $_POST['StartYearId'];
$EndMonthId = $_POST['EndMonthId'];
$EndYearId = $_POST['EndYearId'];
$frequencyId = 1;
if ($_POST['MonthNumber'] != 0) {
$months = $_POST['MonthNumber'];
$monthIndex = date("m");
$yearIndex = date("Y");
settype($yearIndex, "integer");
if ($monthIndex == 1) {
$monthIndex = 12;
$yearIndex = $yearIndex - 1;
} else {
$monthIndex = $monthIndex - 1;
}
$months = $months - 1;
$d = cal_days_in_month(CAL_GREGORIAN, $monthIndex, $yearIndex);
$EndYearMonth = $yearIndex . "-" . str_pad($monthIndex, 2, "0", STR_PAD_LEFT) . "-" . $d;
$EndYearMonth = date('Y-m-d', strtotime($EndYearMonth));
$StartYearMonth = $yearIndex . "-" . str_pad($monthIndex, 2, "0", STR_PAD_LEFT) . "-" . "01";
$StartYearMonth = date('Y-m-d', strtotime($StartYearMonth));
$StartYearMonth = date("Y-m-d", strtotime(date("Y-m-d", strtotime($StartYearMonth)) . "-" . $months . " month"));
} else {
$startDate = $StartYearId . "-" . $StartMonthId . "-" . "01";
$StartYearMonth = date('Y-m-d', strtotime($startDate));
$d = cal_days_in_month(CAL_GREGORIAN, $EndMonthId, $EndYearId);
$endDate = $EndYearId . "-" . $EndMonthId . "-" . $d;
$EndYearMonth = date('Y-m-d', strtotime($endDate));
}
$monthListShort = array(1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr', 5 => 'May', 6 => 'Jun', 7 => 'Jul', 8 => 'Aug', 9 => 'Sep', 10 => 'Oct', 11 => 'Nov', 12 => 'Dec');
$quarterList = array(3 => 'Jan-Mar', 6 => 'Apr-Jun', 9 => 'Jul-Sep', 12 => 'Oct-Dec');
$output = array('aaData' => array());
$aData = array();
$output2 = array();
if ($frequencyId == 1) {
$monthQuarterList = $monthListShort;
} else {
$monthQuarterList = $quarterList;
}
$month_list = array();
$startDate = strtotime($StartYearMonth);
$endDate = strtotime($EndYearMonth);
$index = 0;
// while ($endDate >= $startDate) {
// $month_list[$index] = date('M Y',$startDate);
// $index++;
// $startDate = strtotime( date('Y/m/d',$startDate).' 1 month');
// }
while ($endDate >= $startDate) {
if ($frequencyId == 1) {
$monthid = date('m', $startDate);
settype($monthid, "integer");
$ym = $monthListShort[$monthid] . ' ' . date('Y', $startDate);
$month_list[$index] = $ym;
$output['Categories'][] = $ym;
$index++;
} else {
$monthid = date('m', $startDate);
settype($monthid, "integer");
if ($monthid == 3 || $monthid == 6 || $monthid == 9 || $monthid == 12) {
$ym = $quarterList[$monthid] . ' ' . date('Y', $startDate);
$month_list[$index] = $ym;
$output['Categories'][] = $ym;
$index++;
}
}
$startDate = strtotime(date('Y/m/d', $startDate) . ' 1 month');
}
$html = '
<!-- EXAMPLE OF CSS STYLE -->
<style>
</style>
<body>
<h4 style="text-align:left;"><b>' . $gTEXT['Patient Trend Time Series Report of'] . ' ' . $CountryName . ' ' . $gTEXT['from'] . ' ' . date('M,Y', strtotime($StartYearMonth)) . ' ' . $gTEXT['to'] . ' ' . date('M,Y', strtotime($EndYearMonth)) . '</b></h4>
</body>';
$pdf->writeHTMLCell(0, 0, 17, '', $html, '', 1, 1, false, 'L', true, $spacing = 0);
$pdf->setSourceFile("pdfslice/PatientTrendChart.pdf");
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx, 0, 0, 200);
//=====================================================Patient Trend Time Series Table=======================================================
$lan = $_REQUEST['lan'];
$countryId = $_POST['Country'];
$itemGroupId = $_POST['ItemGroupId'];
//$frequencyId = 1;// $_POST['FrequencyId'];
if ($lan == 'en-GB') {
$serviceTypeName = 'ServiceTypeName';
} else {
$serviceTypeName = 'ServiceTypeNameFrench';
//.........这里部分代码省略.........
示例5: generateFundingStatusReport
function generateFundingStatusReport($conn)
{
global $gTEXT;
global $pdf;
$ItemGroup = $_POST['ItemGroup'];
$lan = $_POST['lan'];
if ($lan == 'en-GB') {
$SITETITLE = SITETITLEENG;
} else {
$SITETITLE = SITETITLEFRN;
}
$CountryName = $_POST['CountryName'];
$Year = $_POST['Year'];
require_once 'tcpdf/tcpdf.php';
require_once 'fpdf/fpdi.php';
$pdf = new FPDI();
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->AddPage($orientation = L, $format = 'Letter', $keepmargins = false, $tocpage = false);
$pdf->SetFillColor(255, 255, 255);
$html_head = "<span style='text-align:center;font-size:10px;'><b>" . $SITETITLE . "</b></span><br>\n\t<span style='text-align:center;font-size:10px;'><b>" . $gTEXT['Funding Status Report of'] . " " . $CountryName . " " . $gTEXT['on'] . " " . $Year . "</b></span><br>\n\t<span style='text-align:center;font-size:10px;'><b>" . $gTEXT['Product Group'] . ": " . $ItemGroup . "</b></span>";
$html = '
<!-- EXAMPLE OF CSS STYLE -->
<style>
</style>
<body>
</body>';
$pdf->writeHTMLCell(0, 0, 15, '', $html_head, '', 1, 1, false, 'C', true, $spacing = 0);
$pdf->setSourceFile("pdfslice/FundingStatusChart.pdf");
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx, 0, 0, 500);
}
示例6: 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);
//.........这里部分代码省略.........
示例7: array
///////////////////////////////////////////////////////////////PAGE 3/////////////////////////////////////////////////////////////////////
if ($pageNo = 3) {
// import a page
$templateId = $pdf->importPage($pageNo);
// get the size of the imported page
$size = $pdf->getTemplateSize($templateId);
// create a page (landscape or portrait depending on the imported page size)
if ($size['w'] > $size['h']) {
$pdf->AddPage('L', array($size['w'], $size['h']));
} else {
$pdf->AddPage('P', array($size['w'], $size['h']));
}
// use the imported page
$pdf->useTemplate($templateId);
$pdf->SetAutoPageBreak(false);
$pdf->SetFillColor(255, 242, 0);
//$db = new SQLite3('/home1/columch7/public_html/Columbia.db');
$db = new SQLite3($columbiaDB);
$ID = $_GET["ID"];
$AUTH = $_GET["AUTH"];
$results = $db->query('SELECT * FROM benton_new_patients where ID =' . $ID . ' and AUTH = ' . $AUTH);
//$results = $db->query('SELECT * FROM Pasco_new_patients where ID=24');
$row = $results->fetchArray();
//print var_dump($row);
//exit();
//Name
$pdf->SetFont('Helvetica');
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFontSize(10);
$pdf->SetXY(17, 10.7);
$pdf->Write(10, $row["FIRST_NAME"] . " " . $row["LAST_NAME"]);
示例8: render
/**
* Render a certificate
*
* @param object $user User
* @param string $path Path to store rendered file to
* @return boolean True on success, false on error
*/
public function render($user = null, $path = null)
{
if (!$user) {
$user = \User::getRoot();
}
if (!class_exists('\\Components\\Courses\\Models\\Course')) {
require_once __DIR__ . DS . 'course.php';
}
$course = Course::getInstance($this->get('course_id'));
require_once PATH_CORE . DS . 'libraries' . DS . 'fpdf16' . DS . 'fpdf.php';
require_once PATH_CORE . DS . 'libraries' . DS . 'fpdi' . DS . 'fpdi.php';
// Get the pdf and draw on top of it
$pdf = new \FPDI();
$pageCount = $pdf->setSourceFile($this->path('system') . DS . 'certificate.pdf');
$tplIdx = $pdf->importPage(1);
$size = $pdf->getTemplateSize($tplIdx);
$pdf->AddPage('L', array($size['h'], $size['w']));
$pdf->useTemplate($tplIdx, 0, 0, 0, 0, true);
$pdf->SetFillColor(0, 0, 0);
foreach ($this->properties()->elements as $element) {
// Convert pixel values to percents
$element->x = $element->x / $this->properties()->width;
$element->y = $element->y / $this->properties()->height;
$element->w = $element->w / $this->properties()->width;
$element->h = $element->h / $this->properties()->height;
$val = '';
switch ($element->id) {
case 'name':
case 'email':
case 'username':
$val = $user->get($element->id);
break;
case 'course':
$val = $course->get('title');
break;
case 'offering':
$val = $course->offering()->get('title');
break;
case 'section':
$val = $course->offering()->section()->get('title');
break;
case 'date':
$val = \Date::of('now')->format(Lang::txt('d M Y'));
break;
}
$pdf->SetFont('Arial', '', 30);
//($element->h * $size['h']));
$pdf->setXY($element->x * $size['w'], $element->y * $size['h']);
// - ($element->h * $size['h'])
$pdf->Cell($element->w * $size['w'], $element->h * $size['h'], $val, '', 1, 'C');
}
if (!$path) {
$pdf->Output();
die;
}
$pdf->Output($path, 'F');
return true;
}
示例9: define
//.........这里部分代码省略.........
$days = 'days';
}
$pdf->Write(0, $rows['days'] . ' ' . $days);
$date_leave = $this->Helps->get_month_name($rows['month']) . ' ' . $rows['multiple'] . ', ' . $rows['year'];
if ($rows['multiple5'] != '') {
$date_leave .= ' - ' . $this->Helps->get_month_name($rows['month5']) . ' ' . $rows['multiple5'] . ', ' . $rows['year5'];
}
$pdf->Ln(4);
$pdf->SetX(60);
$pdf->Write(0, $date_leave);
$last_earn = $this->Leave_card->get_last_earn($rows['employee_id']);
//$last_earn = date('F d, Y', strtotime($last_earn));
if ($last_earn != '') {
$record_limit_date = $last_earn;
$last_earn = date('F d, Y', strtotime($last_earn));
} else {
$dt = new Carbon();
$dt->subMonth();
//echo 'last day of '. $this->Helps->get_month_name($dt->month).' '.$dt->year;
$date = new Carbon('last day of ' . $this->Helps->get_month_name($dt->month) . ' ' . $dt->year);
//return;
$last_earn = $this->Helps->get_month_name($date->month) . ' ' . $date->day . ', ' . $date->year;
$record_limit_date = $date->year . '-' . $date->month . '-' . $date->day;
//$last_earn = date('F d, Y');
}
$credits = $this->Leave_card->get_total_leave_credits($rows['employee_id'], $record_limit_date);
$pdf->Ln(39);
$pdf->SetX(35);
$pdf->Write(0, $last_earn);
//balances
$pdf->Ln(18);
$pdf->SetX(25);
//$pdf->Write(0, $vbalance);
$pdf->Write(0, number_format($credits['vacation'], 3));
$pdf->SetX(54);
//$pdf->Write(0, $sbalance);
$pdf->Write(0, number_format($credits['sick'], 3));
$total_leave_balance = $credits['vacation'] + $credits['sick'];
$pdf->SetX(80);
$pdf->Write(0, number_format($total_leave_balance, 3));
// set font, font style, font size.
$pdf->SetFont('Arial', 'B', 12);
$pdf->Ln(9);
$pdf->SetX(136);
//credits
//vaation
$pdf->Ln(23);
$pdf->SetX(52);
//$pdf->Write(0, number_format($vacation_leave, 3));
//sick
//$pdf->Ln(9);
$pdf->SetX(108);
//$pdf->Write(0, number_format($sick_leave, 3));
//total
//$pdf->Ln(7);
$pdf->SetX(160);
//$pdf->Write(0, number_format($vacation_leave + $sick_leave, 3));
//date for the day
$pdf->Ln(21);
$pdf->SetX(67);
//day
//$pdf->Write(0, date('jS'));
$pdf->SetX(104);
//$pdf->Write(0, date('F'));
//year
$pdf->SetX(138);
//$pdf->Write(0, date('Y'));
//MR or MS. request
$pdf->Ln(7);
//$pdf->Image('white.png',10,10,-300);
$pdf->SetX(32);
$statement_certified = Setting::getField('statement_certified');
$statement_certified_position = Setting::getField('statement_certified_position');
$pdf->SetXY(35, 205);
$pdf->SetFillColor(255, 255, 255);
$pdf->Cell(65, 5, strtoupper(utf8_decode($statement_certified)), '', 0, 'C', 1);
$pdf->SetXY(35, 211);
$pdf->SetFont('Arial', 'I', 11);
$pdf->Cell(65, 5, $statement_certified_position, '', 0, 'C', 1);
$pdf->SetXY(129, 139);
$pdf->Cell(65, 5, utf8_decode($name['fname'] . ' ' . $name['mname'] . ' ' . $name['lname']), '', 0, 'C', 1);
//$pdf->SetXY(129, 200);
//$pdf->Cell(65,5, $office['office_head'],'',0,'C',1);
$pdf->SetXY(129, 206);
//$pdf->Cell(65,5, utf8_decode($office['office_head']),'',0,'C',1);
//$pdf->Cell(65,5, $office['position'],'',0,'C',1);
//$pdf->Cell(65,5, $office['office_head'],'',0,'C',1);
// For quezon province
$final_approval_leave_application = Setting::getField('final_approval_leave_application');
$final_approval_leave_application_designation = Setting::getField('final_approval_leave_application_designation');
$pdf->SetXY(70, 255);
$pdf->Cell(65, 5, utf8_decode($final_approval_leave_application), '', 0, 'C', 1);
$pdf->SetXY(70, 260);
$pdf->Cell(65, 5, $final_approval_leave_application_designation, '', 0, 'C', 1);
//$pdf->Write(0, 'hahaha');
header('Cache-Control: maxage=3600');
//Adjust maxage appropriately
header('Pragma: public');
$pdf->Output('dtr/reports/leave-apps-' . $rows['employee_id'] . '.pdf', 'I');
}
示例10: generateNationalSummaryReport
function generateNationalSummaryReport($conn)
{
global $gTEXT;
$Year = $_POST['Year'];
$MonthName = $_POST['MonthName'];
$CountryName = $_POST['CountryName'];
require_once 'tcpdf/tcpdf.php';
require_once 'fpdf/fpdi.php';
$pdf = new FPDI();
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->AddPage();
$pdf->SetFillColor(255, 255, 255);
$html_head = "<span style='text-align:center;'><b>" . $gTEXT['National Stock Summary Report of'] . " " . $CountryName . " On " . $MonthName . ", " . $Year . "</b></span>";
$html = '
<!-- EXAMPLE OF CSS STYLE -->
<style>
</style>
<body>
<h4 style="text-align:center;"><b>' . $gTEXT['National Stock Summary Report of'] . ' ' . $CountryName . ' On ' . $MonthName . ',' . $Year . '</b></h4>
</body>';
$pdf->writeHTMLCell(0, 0, 30, '', $html_head, '', 1, 1, false, 'C', true, $spacing = 0);
$pdf->setSourceFile("pdfslice/NationalSummaryChart.pdf");
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx, 6, 0, 200);
//=====================================================Summary List Table=======================================================
if ($Month == '1') {
$MonthName = "January";
} elseif ($Month == '2') {
$MonthName = "February";
} elseif ($Month == '3') {
$MonthName = "March";
} elseif ($Month == '4') {
$MonthName = "April";
} elseif ($Month == '5') {
$MonthName = "May";
} elseif ($Month == '6') {
$MonthName = "June";
} elseif ($Month == '7') {
$MonthName = "July";
} elseif ($Month == '8') {
$MonthName = "August";
} elseif ($Month == '9') {
$MonthName = "September";
} elseif ($Month == '10') {
$MonthName = "October";
} elseif ($Month == '11') {
$MonthName = "November";
} elseif ($Month == '12') {
$MonthName = "December";
}
$Year = $_POST['Year'];
$ItemGroupId = $_POST['ItemGroupId'];
$Month = $_POST['Month'];
$MonthName = $_POST['MonthName'];
$CountryId = $_POST['Country'];
$CountryName = $_POST['CountryName'];
$sql = " SELECT a.ItemNo, b.ItemName, SUM(DispenseQty) ReportedConsumption, SUM(ClStock) ReportedClosingBalance, SUM(AMC) AMC, IFNULL(((SUM(ClStock))/(SUM(AMC))),0) MOS \n \tFROM t_cnm_stockstatus a \n INNER JOIN t_itemlist b ON a.ItemNo = b.ItemNo AND b.bKeyItem = 1 AND b.ItemGroupId = " . $ItemGroupId . "\n \tINNER JOIN t_cnm_masterstockstatus c ON a.CNMStockId = c.CNMStockId AND a.CountryId = c.CountryId AND c.StatusId = 5 AND c.ItemGroupId = " . $ItemGroupId . "\n \t\tWHERE a.MonthId = " . $Month . " AND a.Year = " . $Year . "\n AND (a.CountryId = " . $CountryId . " OR " . $CountryId . " = 0) \t\n \tGROUP BY ItemNo, ItemName \n \tHAVING IFNULL(((SUM(ClStock))/(SUM(AMC))),0)>0";
$result = mysql_query($sql, $conn);
$total = mysql_num_rows($result);
if ($total > 0) {
$data = array();
$f = 0;
$tblHTML = '';
while ($rec = mysql_fetch_array($result)) {
$data['SL'][$f] = $f;
$data['ItemName'][$f] = $rec['ItemName'];
//$data['ReportedConsumption'][$f]=number_format($rec['ReportedConsumption']);
$data['ReportedClosingBalance'][$f] = number_format($rec['ReportedClosingBalance']);
$data['AMC'][$f] = number_format($rec['AMC']);
$data['MOS'][$f] = number_format($rec['MOS'], 1);
$tblHTML .= '<tr style="page-break-inside:avoid;">
<td align="center" width="30" valign="middle">' . ($data['SL'][$f] + 1) . '</td>
<td align="left" width="200" valign="middle">' . $data['ItemName'][$f] . '</td>
<td align="right" width="90" valign="middle">' . $data['ReportedClosingBalance'][$f] . '</td>
<td align="right" width="120" valign="middle">' . $data['AMC'][$f] . '</td>
<td align="right" width="60" valign="middle">' . $data['MOS'][$f] . '</td>
</tr>';
$f++;
//<td align="right" width="90" valign="middle">'.$data['ReportedConsumption'][$f].'</td>
}
$html_head = "<span><b>" . $gTEXT['National Stock Summary List'] . "</b></span>";
$pdf->SetFont('dejavusans', '', 10);
$pdf->writeHTMLCell(0, 0, 10, 160, $html_head, '', 0, 0, false, 'C', true);
$html = '
<!-- EXAMPLE OF CSS STYLE -->
<style>
td{
height: 6px;
line-height:3px;
}
</style>
<body>
<table width="450px" border="0.5" style="margin:0 auto;">
<tr>
<th width="30" align="center"><b>SL</b></th>
<th width="200" align="left"><b>' . $gTEXT['Products'] . '</b></th>
<th width="90" align="right"><b>' . $gTEXT['Reported Closing Balance'] . '</b></th>
<th width="120" align="right"><b>' . $gTEXT['Average Monthly Consumption'] . '</b></th>
<th width="60" align="right"><b>' . $gTEXT['MOS'] . '</b></th>
//.........这里部分代码省略.........
示例11: generateStockStatusReport
function generateStockStatusReport($conn)
{
global $gTEXT;
$MonthName = $_POST['MonthName'];
$CountryName = $_POST['CountryName'];
require_once 'tcpdf/tcpdf.php';
require_once 'fpdf/fpdi.php';
$pdf = new FPDI();
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
//$pdf->SetAutoPageBreak(true, 1);
//$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->AddPage();
$pdf->SetFillColor(255, 255, 255);
$html_head = "<span style='text-align:center;font-size:10px;'><b>" . $gTEXT['Stock Status at Different Level Report of'] . " " . $CountryName . " on " . $MonthName . ", " . $Year . "</b></span>";
$html = <<<EOF
<!-- EXAMPLE OF CSS STYLE -->
<style>
</style>
<body>
</body>
EOF;
$pdf->writeHTMLCell(0, 0, 40, '', $html_head, '', 1, 1, false, 'L', true);
$pdf->setSourceFile("pdfslice/StockStatusChart.pdf");
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx, 6, 20, 200, 300);
$pdf->endPage();
//=====================================================Stock List Table=======================================================
$Year = $_POST['Year'];
$ItemGroupId = $_POST['ItemGroup'];
$Month = $_POST['Month'];
$CountryId = $_POST['Country'];
$ownnerTypeId = $_POST['OwnnerTypeId'];
$lan = $_REQUEST['lan'];
if ($lan == 'en-GB') {
$fLevelName = 'FLevelName';
} else {
$fLevelName = 'FLevelNameFrench';
}
if ($CountryId) {
$CountryId = " AND a.CountryId = " . $CountryId . " ";
}
$columnList = array();
$productName = 'Product Name';
$aData = array();
if ($ownnerTypeId == 1 || $ownnerTypeId == 2) {
$sQuery = "SELECT f.FLevelId, {$fLevelName} FLevelName, a.ItemNo, b.ItemName, f.ColorCode, IFNULL(SUM(ClStock),0) FacilitySOH, IFNULL(SUM(AMC),0) FacilityAMC\n\t\t\t, IFNULL(((SUM(ClStock))/(SUM(AMC))),0) MOS \n FROM t_cfm_stockstatus a \n INNER JOIN t_itemlist b ON a.ItemNo = b.ItemNo AND b.bKeyItem = 1 AND b.ItemGroupId = " . $ItemGroupId . "\n INNER JOIN t_cfm_masterstockstatus c ON a.CFMStockId = c.CFMStockId and c.StatusId = 5 AND c.ItemGroupId = " . $ItemGroupId . "\n INNER JOIN t_facility d ON a.FacilityId = d.FacilityId\n INNER JOIN t_facility_group_map e ON d.FacilityId = e.FacilityId AND e.ItemGroupId = " . $ItemGroupId . "\n INNER JOIN t_facility_level f ON d.FLevelId = f.FLevelId\n WHERE a.MonthId = " . $Month . " AND a.Year = '" . $Year . "' " . $CountryId . "\n\t\t\tAND d.OwnerTypeId = " . $ownnerTypeId . "\n GROUP BY f.FLevelId, {$fLevelName}, ItemNo, ItemName, f.ColorCode\n HAVING IFNULL(((SUM(ClStock))/(SUM(AMC))),0)>0\n\t\t\torder by ItemName,f.FLevelId;";
} else {
$sQuery = "SELECT f.FLevelId, {$fLevelName} FLevelName, a.ItemNo, b.ItemName, f.ColorCode, IFNULL(SUM(ClStock),0) FacilitySOH, IFNULL(SUM(AMC),0) FacilityAMC\n\t\t\t\t, IFNULL(((SUM(ClStock))/(SUM(AMC))),0) MOS \n\t\t\t\tFROM t_cfm_stockstatus a \n\t\t\t\tINNER JOIN t_itemlist b ON a.ItemNo = b.ItemNo AND b.bKeyItem = 1 AND b.ItemGroupId = " . $ItemGroupId . "\n\t\t\t\tINNER JOIN t_cfm_masterstockstatus c ON a.CFMStockId = c.CFMStockId and c.StatusId = 5 AND c.ItemGroupId = " . $ItemGroupId . "\n\t\t\t\tINNER JOIN t_facility d ON a.FacilityId = d.FacilityId\n\t\t\t\tINNER JOIN t_facility_group_map e ON d.FacilityId = e.FacilityId AND e.ItemGroupId = " . $ItemGroupId . "\n\t\t\t\tINNER JOIN t_facility_level f ON d.FLevelId = f.FLevelId\n\t\t\t\tWHERE a.MonthId = " . $Month . " AND a.Year = '" . $Year . "' " . $CountryId . "\n\t\t\t\tAND d.AgentType = " . $ownnerTypeId . "\n\t\t\t\tGROUP BY f.FLevelId, {$fLevelName}, ItemNo, ItemName, f.ColorCode\n\t\t\t\tHAVING IFNULL(((SUM(ClStock))/(SUM(AMC))),0)>0\n\t\t\t\torder by ItemName,f.FLevelId;";
}
//echo $sQuery;
$rResult = safe_query($sQuery);
$total = mysql_num_rows($rResult);
$tmpItemName = '';
$sl = 1;
$count = 0;
$preItemName = '';
//echo 'Rubel';
if ($total > 0) {
$data = array();
$headerList = array();
while ($row = mysql_fetch_assoc($rResult)) {
$data[] = $row;
}
foreach ($data as $row) {
////Duplicate value not push in array
//if (!in_array($row['FLevelName'], $headerList)) {
// $headerList[] = $row['FLevelName'];
//}
$headerList[$row['FLevelId']] = $row['FLevelName'];
}
//array_push($headerList,'National');
$headerList[999] = 'National';
foreach ($headerList as $key => $value) {
$columnList[] = $value;
//.' Level AMC';
$columnList[] = $value;
//.' Level SOH';
$columnList[] = $value;
//.' Level MOS';
}
$fetchDataList = array();
foreach ($data as $row) {
if ($tmpItemName != $row['ItemName']) {
if ($count > 0) {
$fetchDataList['999' . '2'] = number_format($fetchDataList['999' . '2']);
$fetchDataList['999' . '3'] = number_format($fetchDataList['999' . '3'], 1);
array_unshift($fetchDataList, $sl, $preItemName);
$aData[] = $fetchDataList;
$sl++;
}
$count++;
$preItemName = $row['ItemName'];
unset($fetchDataList);
foreach ($headerList as $key => $value) {
$fetchDataList[$key . '1'] = NULL;
$fetchDataList[$key . '2'] = NULL;
$fetchDataList[$key . '3'] = NULL;
}
//.........这里部分代码省略.........
示例12: generatesExternalReport
public function generatesExternalReport($id = -1)
{
/*
* Loading libraries and helpers
*/
$this->load->library(array('rb', 'fpdf_gen'));
$this->load->helper(array('date', 'utility'));
/*
* The request id is not set
*/
if ($id == -1) {
echo "Parece que não foi especificado qual o id da Solicitação.";
exit;
}
/*
* Loading request
*/
$request = R::findOne('request', 'id=?', array($id));
/*
* Request exists
*/
if ($request == null) {
echo 'Parece que a solicitação não existe.';
exit;
}
/*
* Creating PDF
*/
$pdf = new FPDI();
$pdf->addPage('L');
/* *********************************************************
* BEGIN - HEADER
********************************************************* */
$pdf->image(public_url('img/' . $this->config->item('system_report_logo')), 140, 5);
$pdf->ln(14);
$pdf->SetFont('Courier', 'B', 9);
$pdf->Cell(0, 0, utf8_decode($this->config->item('system_name')), 0, 0, 'C');
$pdf->Ln(5);
$pdf->SetFont('Courier', '', 9);
$pdf->Cell(0, 0, utf8_decode("SOLICITAÇÃO DE INFORMAÇÃO"), 0, 0, 'C');
/* *********************************************************
* END - HEADER
********************************************************* */
$pdf->Ln(10);
$pdf->SetFont('Courier', 'B', 9);
$pdf->SetDrawColor(217, 217, 217);
$pdf->SetFillColor(217, 217, 217);
$pdf->Cell(0, 10, utf8_decode(' DADOS DA SOLICITAÇÃO'), 'LRTB', 0, 'L', true);
$pdf->Ln(10);
$pdf->Cell(24, 10, utf8_decode(' PROTOCOLO: '), 'LTB', 0, 'L', false);
$pdf->SetFont('Courier', '', 9);
$pdf->Cell(110, 10, utf8_decode($request->protocol), 'TBR', 0, 'L', false);
$pdf->SetFont('Courier', 'B', 9);
$pdf->Cell(32, 10, utf8_decode(' SOLICITADA EM: '), 'TB', 0, 'L', false);
$pdf->SetFont('Courier', '', 9);
$pdf->Cell(111, 10, utf8_decode(mdate('%d/%m/%Y', strtotime($request->createdAt))), 'TBR', 0, 'L', false);
$pdf->Ln(10);
$pdf->SetFont('Courier', 'B', 9);
$pdf->Cell(24, 10, utf8_decode(' SITUAÇÃO: '), 'LB', 0, 'L', false);
$pdf->SetFont('Courier', '', 9);
$pdf->Cell(253, 10, utf8_decode(status_text($request->status)), 'TBR', 0, 'L', false);
$pdf->Ln(10);
$pdf->SetFont('Courier', 'B', 9);
$pdf->Cell(0, 10, utf8_decode(' SOLICITAÇÃO: '), 'LR', 0, 'L', false);
$pdf->Ln(8);
$pdf->SetFont('Courier', '', 9);
$pdf->MultiCell(0, 5, utf8_decode(' ' . $request->request), 'LR', 'L', false);
$pdf->Cell(0, 4, '', 'LR', 0, 'L', false);
$pdf->Ln(4);
$pdf->SetFont('Courier', 'B', 9);
$pdf->Cell(0, 10, utf8_decode(' TRÂMITAÇÃO'), 'LRTB', 0, 'L', true);
$pdf->Ln(10);
$pdf->SetFont('Courier', '', 9);
$statuses = R::find('status', ' request_id = ? ORDER BY created_at ASC ', array($request->id));
if (!count($statuses)) {
$pdf->Cell(0, 10, utf8_decode(' Nenhuma trâmitação ainda'), 'LRB', 0, 'L', false);
} else {
foreach ($statuses as $s) {
$pdf->SetFont('Courier', 'B', 9);
$pdf->Cell(0, 10, utf8_decode(' ' . status_text($s->type) . ' [' . date('d/m/Y', strtotime($s->createdAt)) . ']'), 'LR', 0, 'L', false);
$pdf->Ln(10);
$pdf->SetFont('Courier', '', 9);
$pdf->MultiCell(0, 5, utf8_decode(' ' . $s->response), 'LRB', 'L', false);
}
}
$pdf->Ln(10);
$pdf->Output();
}
示例13: generateStockoutTrendReport
function generateStockoutTrendReport($conn)
{
global $gTEXT;
$CountryId = $_POST['Country'];
$months = $_POST['MonthNumber'];
$StartMonthId = $_POST['StartMonthId'];
$EndMonthId = $_POST['EndMonthId'];
$StartYearId = $_POST['StartYearId'];
$EndYearId = $_POST['EndYearId'];
$CountryName = $_POST['CountryName'];
$MonthName = $_GET['MonthName'];
if ($_POST['MonthNumber'] != 0) {
$months = $_POST['MonthNumber'];
$monthIndex = date("m");
$yearIndex = date("Y");
if ($monthIndex == 1) {
$monthIndex = 12;
$yearIndex = $yearIndex - 1;
} else {
$monthIndex = $monthIndex - 1;
$endDate = $yearIndex . "-" . $monthIndex . "-" . "01";
$startDate = date("Y-m-d", strtotime(date("Y-m-d", strtotime($endDate)) . "+" . -($months - 1) . " month"));
}
} else {
$startDate = $StartYearId . "-" . $StartMonthId . "-" . "01";
$endDate = $EndYearId . "-" . $EndMonthId . "-" . "01";
$months = getMonthsBtnTwoDate($startDate, $endDate) + 1;
$monthIndex = $EndMonthId;
$yearIndex = $EndYearId;
}
settype($yearIndex, "integer");
$month_name = array();
$Tdetails = array();
$sumRiskCount = array();
$sumTR = 0;
require_once 'tcpdf/tcpdf.php';
require_once 'fpdf/fpdi.php';
$pdf = new FPDI();
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->AddPage();
$pdf->SetFillColor(255, 255, 255);
$html_head = '
<!-- EXAMPLE OF CSS STYLE -->
<style>
</style>
<body>
<h4 style="text-align:left;"><b>' . $gTEXT['Stockout trend Report of '] . ' ' . $CountryName . ' ' . $gTEXT['from'] . ' ' . date('M,Y', strtotime($startDate)) . ' ' . $gTEXT['to'] . ' ' . date('M,Y', strtotime($endDate)) . '</b></h4>
</body>';
$pdf->writeHTMLCell(0, 0, 12, '', $html_head, '', 1, 1, false, 'L', true, $spacing = 0);
$pdf->setSourceFile("pdfslice/StockoutTrendChart.pdf");
print_r();
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx, -5, 0, 200);
//=====================================================Stockout Trend Table=======================================================
for ($i = 1; $i <= $months; $i++) {
$sql = " SELECT v.MosTypeId, MosTypeName, ColorCode, IFNULL(RiskCount,0) RiskCount FROM\n \t\t (SELECT p.MosTypeId, COUNT(*) RiskCount FROM (\n SELECT a.ItemNo, a.MOS,(SELECT MosTypeId FROM t_mostype x WHERE a.MOS >= x.MinMos AND a.MOS < x.MaxMos) MosTypeId\n\t\t\t\t FROM t_cnm_stockstatus a\n\t\t\t\t WHERE a.MOS IS NOT NULL AND a.MonthId = " . $monthIndex . " AND Year = " . $yearIndex . " AND (CountryId = " . $CountryId . " OR " . $CountryId . " = 0)) p \n\t\t\t\t GROUP BY p.MosTypeId) u\n\t\t\t\t RIGHT JOIN t_mostype v ON u.MosTypeId = v.MosTypeId\n\t\t\t\t GROUP BY v.MosTypeId";
mysql_query("SET character_set_results=utf8");
$result = mysql_query($sql);
$total = mysql_num_rows($result);
$Pdetails = array();
if ($total > 0) {
while ($aRow = mysql_fetch_array($result)) {
$Pdetails['MosTypeId'] = $aRow['MosTypeId'];
$Pdetails['MonthIndex'] = $monthIndex;
$Pdetails['MosTypeName'] = $aRow['MosTypeName'];
$Pdetails['RiskCount'] = $aRow['RiskCount'];
array_push($Tdetails, $Pdetails);
}
$mn = date("M", mktime(0, 0, 0, $monthIndex, 1, 0));
$mn = $mn . " " . $yearIndex;
array_push($month_name, $mn);
}
$monthIndex--;
if ($monthIndex == 0) {
$monthIndex = 12;
$yearIndex = $yearIndex - 1;
}
}
$veryHighRisk = array();
$highRisk = array();
$mediumRisk = array();
$lowRisk = array();
$noRisk = array();
$areaName = array();
$rmonth_name = array_reverse($month_name);
$RTdetails = array_reverse($Tdetails);
foreach ($RTdetails as $key => $value) {
$MosTypeId = $value['MosTypeId'];
$MonthIndex = $value['MonthIndex'];
$MosTypeName = $value['MosTypeName'];
$RiskCount = $value['RiskCount'];
if ($MosTypeId == 1) {
array_push($veryHighRisk, $RiskCount);
array_push($areaName, $MosTypeName);
} else {
if ($MosTypeId == 2) {
array_push($highRisk, $RiskCount);
array_push($areaName, $MosTypeName);
} else {
//.........这里部分代码省略.........
示例14: generatePipelineReport
function generatePipelineReport($conn)
{
global $gTEXT;
$year = $_POST['YearId'];
$MonthName = $_POST['MonthName'];
$CountryName = $_POST['CountryName'];
require_once 'tcpdf/tcpdf.php';
require_once 'fpdf/fpdi.php';
$pdf = new FPDI();
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->AddPage();
$pdf->SetFillColor(255, 255, 255);
$html_head = "<span style='text-align:center;'><b>" . $gTEXT['National Stock Pipeline Information Report of'] . " " . $CountryName . " On " . $MonthName . ", " . $year . "</b></span>";
$html = '
<!-- EXAMPLE OF CSS STYLE -->
<style>
</style>
<body>
<h4 style="text-align:center;"><b>' . $gTEXT['National Stock Pipeline Information Report of'] . ' ' . $CountryName . ' ' . $gTEXT['on'] . ' ' . $MonthName . ',' . $year . '</b></h4>
</body>';
$pdf->writeHTMLCell(0, 0, 20, '', $html_head, '', 1, 1, false, 'C', true, $spacing = 0);
$pdf->setSourceFile("pdfslice/PipelineInfoChart.pdf");
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx, 3, 0, 200, 400);
$pdf->endPage();
//=====================================================Pipeline Info List Table=======================================================
$monthId = $_POST['MonthId'];
$year = $_POST['YearId'];
$countryId = $_POST['CountryId'];
$itemGroupId = $_POST['ItemGroupId'];
$currentYearMonth = $_POST['YearId'] . "-" . $_POST['MonthId'] . "-" . "01";
$monthList = array('1' => 'January', '2' => 'February', '3' => 'March', '4' => 'April', '5' => 'May', '6' => 'June', '7' => 'July', '8' => 'August', '9' => 'September', '10' => 'October', '11' => 'November', '12' => 'December');
$sWhere = "";
if ($_POST['sSearch'] != "") {
$sWhere = " WHERE (a.ItemName LIKE '%" . mysql_real_escape_string($_POST['sSearch']) . "%'\n OR " . " a.AMC LIKE '%" . mysql_real_escape_string($_POST['sSearch']) . "%'\n OR " . " a.ClStock LIKE '%" . mysql_real_escape_string($_POST['sSearch']) . "%' \n OR " . " a.MOS LIKE '%" . mysql_real_escape_string($_POST['sSearch']) . "%'\n OR " . " b.Qty LIKE '%" . mysql_real_escape_string($_POST['sSearch']) . "%' \n )";
}
$sLimit = "";
if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') {
$sLimit = "LIMIT " . intval($_GET['iDisplayStart']) . ", " . intval($_GET['iDisplayLength']);
}
$sOrder = "";
if (isset($_POST['iSortCol_0'])) {
$sOrder = " ORDER BY ";
for ($i = 0; $i < mysql_real_escape_string($_POST['iSortingCols']); $i++) {
$sOrder .= fnColumnToField_Item(mysql_real_escape_string($_POST['iSortCol_' . $i])) . "\n\t\t\t\t\t\t\t\t" . mysql_real_escape_string($_POST['sSortDir_' . $i]) . ", ";
}
$sOrder = substr_replace($sOrder, "", -2);
}
$sql = " SELECT ItemName, IFNULL(AMC,0) AMC, IFNULL(ClStock,0) ClStock, IFNULL(MOS,0) MOS, IFNULL(Qty,0) StockOnOrder \n FROM (SELECT\n t_cnm_masterstockstatus.CountryId,\n t_itemlist.ItemNo,\n t_itemlist.ItemName,\n SUM(t_cnm_stockstatus.AMC) AMC,\n SUM(t_cnm_stockstatus.ClStock) ClStock,\n SUM(t_cnm_stockstatus.MOS) MOS\n FROM t_cnm_stockstatus\n INNER JOIN t_cnm_masterstockstatus\n ON (t_cnm_stockstatus.CNMStockId = t_cnm_masterstockstatus.CNMStockId)\n INNER JOIN t_itemlist\n ON (t_cnm_stockstatus.ItemNo = t_itemlist.ItemNo)\n WHERE (t_cnm_masterstockstatus.Year = '{$year}'\n AND t_cnm_masterstockstatus.MonthId = {$monthId}\n AND t_cnm_masterstockstatus.CountryId = {$countryId}\n AND t_cnm_masterstockstatus.ItemGroupId = {$itemGroupId}\n AND t_cnm_masterstockstatus.StatusId = 5)\n GROUP BY t_cnm_masterstockstatus.CountryId, t_itemlist.ItemNo, t_itemlist.ItemName) a \n LEFT JOIN (SELECT\n CountryId, ItemNo, SUM(Qty) Qty\n FROM t_agencyshipment\n WHERE (ShipmentDate > CAST('{$currentYearMonth}' AS DATETIME) AND ShipmentStatusId = 2)\n GROUP BY CountryId, ItemNo) b\n ON a.CountryId = b.CountryId AND a.ItemNo = b.ItemNo\n " . $sWhere . "\n HAVING AMC>0 OR MOS>0 OR ClStock>0 OR StockOnOrder>0\n ORDER BY ItemName\n {$sLimit}";
//
$result = mysql_query($sql, $conn);
$total = mysql_num_rows($result);
if ($total > 0) {
$data = array();
$f = 0;
$tblHTML = '';
while ($rec = mysql_fetch_array($result)) {
$data['SL'][$f] = $f;
$data['ItemName'][$f] = $rec['ItemName'];
$data['AMC'][$f] = number_format($rec['AMC']);
$data['ClStock'][$f] = number_format($rec['ClStock']);
$data['MOS'][$f] = number_format($rec['MOS'], 1);
$data['StockOnOrder'][$f] = $rec['StockOnOrder'] == 0 ? '' : $rec['StockOnOrder'];
$amc = $rec['AMC'] == 0 ? 1 : $rec['AMC'];
$stockOnOrderMOS = $rec['StockOnOrder'] / $amc;
$stockOnOrderMOS = $stockOnOrderMOS == 0 ? '' : number_format($stockOnOrderMOS, 1);
$totalMOS = number_format(number_format($rec['MOS'], 1) + $stockOnOrderMOS, 1);
$totalMOS = $totalMOS == 0 ? '' : $totalMOS;
//$data['StockOnOrderMOS'][$f] = $rec['StockOnOrderMOS']== 0? '' : $rec['StockOnOrderMOS'];
//$data['TotalMOS'][$f] = $rec['TotalMOS']== 0? '' : $rec['TotalMOS'];
$tblHTML .= '<tr style="page-break-inside:avoid;">
<td align="center" width="20" valign="middle">' . ($data['SL'][$f] + 1) . '</td>
<td align="left" width="150" valign="middle">' . $data['ItemName'][$f] . '</td>
<td align="right" width="50" valign="middle">' . $data['AMC'][$f] . '</td>
<td align="right" width="70" valign="middle">' . $data['ClStock'][$f] . '</td>
<td align="right" width="74" valign="middle">' . $data['MOS'][$f] . '</td>
<td align="right" width="50" valign="middle">' . $data['StockOnOrder'][$f] . '</td>
<td align="right" width="70" valign="middle">' . $stockOnOrderMOS . '</td>
<td align="right" width="50" valign="middle">' . $totalMOS . '</td>
</tr>';
$f++;
}
$pdf->startPage();
$html_head = "<span><b>" . $gTEXT['National Stock Pipeline Information List'] . "</b></span>";
$pdf->SetFont('dejavusans', '', 10);
$pdf->writeHTMLCell(0, 0, 10, 15, $html_head, '', 0, 0, false, 'C', true);
$html = '
<!-- EXAMPLE OF CSS STYLE -->
<style>
td{
height: 6px;
line-height:3px;
}
</style>
<body>
<table width="600px" border="0.5" style="margin:0 auto;">
<tr>
<th width="20" align="center"><b>SL</b></th>
<th width="150" align="left"><b>' . $gTEXT['Products'] . '</b></th>
//.........这里部分代码省略.........
示例15: ucwords
$pdf->SetX(140);
$pdf->Write(0, ucwords(strtolower($_POST['precioPlanPrimario32'])));
break;
case 4:
$pdf->SetX(70);
$pdf->Write(0, utf8_decode(ucwords(strtolower($_POST['otroPlanTelefono']))));
break;
default:
break;
}
$pdf->Ln(8);
$pdf->SetX(80);
// $pdf->SetFillColor(232,232,232);
$pdf->SetFont('Arial', 'B', 8);
$pdf->Cell(70, 4, 'Costos Minutos Adicionales', 'TRLB', 0, 'C');
$pdf->SetFillColor(0, 0, 0);
// establece el color del fondo de la celda (en este caso es AZUL
$pdf->SetTextColor(255, 255, 255);
$pdf->Cell(21, 4, 'Precio (sin IGV)', 'TRLB', 0, 'C', True);
$pdf->Ln(4);
$pdf->SetX(80);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('Arial', '', 8);
$pdf->SetFillColor(229, 229, 229);
// establece el color del fondo de la celda (en este caso es AZUL
$pdf->Cell(70, 4, utf8_decode('Descripción'), 'TLR', 0, 'Q', True);
$pdf->Cell(21, 4, 'P.Unit S/', 'TRL', 0, 'Q', True);
$pdf->Ln(4);
$pdf->SetX(80);
$pdf->SetFont('Arial', '', 8);
$pdf->Cell(70, 4, 'Costo por minuto local Offnet', 'TLR', 0, 'Q');