本文整理汇总了PHP中FPDI::Cell方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDI::Cell方法的具体用法?PHP FPDI::Cell怎么用?PHP FPDI::Cell使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPDI
的用法示例。
在下文中一共展示了FPDI::Cell方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
protected function execute(InputInterface $input, OutputInterface $output)
{
$id = $input->getArgument('id');
$pdffile = $input->getArgument('pdf');
$em = $this->getContainer()->get('doctrine');
$tab = $this->csv($pdffile);
$template = $em->getRepository('PrintBundle:Template')->find($id);
$path = $this->getContainer()->get('kernel')->getRootDir() . '/../web/uploads/pdf/' . $template->getPdffile();
$width = $template->getWidth();
$height = $template->getHeight();
$orientation = $height > $width ? 'P' : 'L';
$custom_layout = array($width, $height);
$i = 1;
foreach ($tab as $key => $value) {
$pdf = new \FPDI($orientation, 'mm', $custom_layout, true, 'UTF-8', false);
$pdf->setPageOrientation($orientation);
$pdf->SetMargins(PDF_MARGIN_LEFT, 40, PDF_MARGIN_RIGHT);
$pdf->SetAutoPageBreak(true, 40);
$pdf->setFontSubsetting(false);
// add a page
$pdf->AddPage($orientation);
$pdf->setSourceFile($path);
$_tplIdx = $pdf->importPage(1);
$size = $pdf->useTemplate($_tplIdx, 0, 0, $width, true);
foreach ($template->getChildactivity() as $opt) {
$pdf->SetXY($opt->getX(), $opt->getY());
$pdf->SetFont($opt->getFont(), '', $opt->getFontsize() * 2);
// echo $opt->getFontsize()."\n";
$pdf->Cell($opt->getWidth(), $opt->getHeight(), $value[$opt->getName()]);
}
//$pdf->Cell(0, $size['h'], 'TCPDF and FPDI');
// echo $template->getId();
$pdf->Output($this->getContainer()->get('kernel')->getRootDir() . '/../web/folder/pdf' . $template->getId() . "-{$i}.pdf", 'F');
$i++;
}
}
示例2: FPDI
$pdf = new FPDI();
$pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/usuarios_registrados/agentes_comerciales/comisiones/templates/orden_pago.pdf");
define("MAX_REGISTROS_POR_HOJA", 52);
dibujarCabecera($rowCabecera);
$i = 1;
$netoAPagar = 0;
while ($row = DBGetQuery($stmt)) {
if (($i % MAX_REGISTROS_POR_HOJA) == 0)
dibujarCabecera();
$pdf->Ln(4);
$pdf->Cell(-5);
$pdf->Cell(32, 0, $row["TIPO"], 0, 0, "C");
$pdf->Cell(20, 0, $row["FECHA"], 0, 0, "C");
$pdf->Cell(32, 0, $row["NUMERO"], 0, 0, "C");
$pdf->Cell(84, 0, $row["DESCRIPCION"], 0, 0, "C");
$pdf->Cell(32, 0, $row["MONTOFORMATEADO"], 0, 0, "R");
$netoAPagar+= str_replace(",", ".", $row["MONTO"]);
$i++;
}
$pdf->SetY(272);
$pdf->Ln(1);
$pdf->Rect($pdf->GetX() - 5, $pdf->GetY(), 200, 0.2, "F");
$sql = "SELECT TO_CHAR(".$netoAPagar.", '$9,999,999,990.00') montoformateado FROM DUAL";
示例3: FPDI
if ($autoPrint)
$pdf = new PDF_AutoPrint();
else
$pdf = new FPDI();
$pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_afiliacion/templates/solicitud_afiliacion.pdf");
//Página 1..
$pdf->AddPage();
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx);
$pdf->SetFont("Arial", "", 8);
if (($row2["SA_MOTIVOALTA"] == "03") or ($row2["SA_MOTIVOALTA"] == "04") or ($row2["SA_MOTIVOALTA"] == "05")) {
$pdf->Ln(6);
$pdf->Cell(-0.4);
$pdf->Cell(0, 0, "X");
$pdf->Ln(8.2);
$pdf->Cell(1);
}
else {
$pdf->Ln(10.2);
$pdf->Cell(-0.4);
$pdf->Cell(0, 0, "X");
$pdf->SetFont("Arial", "B", 8);
$pdf->Ln(4);
$pdf->Cell(1);
$pdf->Cell(45, 0, $row2["AR_NOMBRE"]);
}
示例4: DBExecSql
$sql =
"SELECT art.utiles.armar_cuit(sa_cuit) cuit, sa_nombre
FROM asa_solicitudafiliacion
WHERE sa_idformulario = :idformulario";
$stmt = DBExecSql($conn, $sql, $params);
$row2 = DBGetQuery($stmt, 1, false);
if ($autoPrint)
$pdf = new PDF_AutoPrint();
else
$pdf = new FPDI();
$pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_afiliacion/templates/nomina_personal_expuesto.pdf");
$pdf->AddPage("L");
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx, null, null, 0, 0, true);
$pdf->SetFont("Arial", "B", 9);
$pdf->Ln(17);
$pdf->Cell(14);
$pdf->Cell(226, 0, $row2["SA_NOMBRE"]);
$pdf->Cell(16);
$pdf->Cell(0, 0, $row2["CUIT"]);
if ($autoPrint)
$pdf->AutoPrint(false);
$pdf->Output();
?>
示例5: FPDI
$pdf = new FPDI("P", "mm", array(216, 320));
$pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_afiliacion/templates/rgrl.pdf");
$pdf->AddPage();
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx);
$pagina = 1;
dibujarPie($pagina);
// Cabecera..
setNumeroSolicitud($row["CUIT"], $row["FO_FORMULARIO"]);
$pdf->SetFont("Arial", "B", 8);
$pdf->Ln(-7.2);
$pdf->Cell(4);
$pdf->Cell(0, 0, date("d/m/Y"));
$pdf->SetFont("Arial", "B", 9);
$pdf->Ln(3);
$pdf->Cell(192, 0, $row["TITULO"], 0, 0, "C");
$pdf->SetFont("Arial", "B", 8);
$pdf->Ln(34.6);
$pdf->Cell(26);
$pdf->Cell(100, 0, $row["NOMBRE"]);
$pdf->Cell(26);
$pdf->Cell(0, 0, ponerGuiones($row["CUIT"]));
$pdf->Ln(5.2);
示例6: 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;
}
示例7: view_sign_pce
public function view_sign_pce(){
require_once('./assets/fpdf17/fpdf.php');
require_once('./assets/fpdf17/fpdi.php');
$pce_id=$this->uri->segment(3,'');
// init pce data
$pce_dat=$this->m_pce->get_pce_by_id($pce_id);
$project=$this->m_project->get_project_by_id($pce_dat->project_id);
//init sign pic
$ae_sign_user_dat=$this->m_user->get_user_by_login_name($project->project_cs);
$ae_sign_filename="no";
if (isset($ae_sign_user_dat->sign_filename)) {
$ae_sign_filename=$ae_sign_user_dat->sign_filename;
}
$client_service_sign_dat=$this->m_user->get_user_by_login_name($pce_dat->csd_sign);
$client_service_sign_filename="no";
if (isset($client_service_sign_dat->sign_filename)) {
$client_service_sign_filename=$client_service_sign_dat->sign_filename;
}
$finance_sign_dat=$this->m_user->get_user_by_login_name($pce_dat->fc_sign);
$finance_sign_filename="no";
if (isset($finance_sign_dat->sign_filename)) {
$finance_sign_filename=$finance_sign_dat->sign_filename;
}
// initiate FPDI
$pdf = new FPDI();
// เพิ่มฟอนต์ภาษาไทยเข้ามา ตัวธรรมดา กำหนด ชื่อ เป็น angsana
$pdf->AddFont('angsana','','angsa.php');
// เพิ่มฟอนต์ภาษาไทยเข้ามา ตัวหนา กำหนด ชื่อ เป็น angsana
$pdf->AddFont('angsana','B','angsab.php');
// เพิ่มฟอนต์ภาษาไทยเข้ามา ตัวหนา กำหนด ชื่อ เป็น angsana
$pdf->AddFont('angsana','I','angsai.php');
// เพิ่มฟอนต์ภาษาไทยเข้ามา ตัวหนา กำหนด ชื่อ เป็น angsana
$pdf->AddFont('angsana','BI','angsaz.php');
// get the page count
$pageCount = $pdf->setSourceFile("./media/real_pdf/".$pce_dat->filename);
// iterate through all pages
for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
// 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->SetTextColor(0,0,0);
$pdf->SetFont('angsana','B',14);
$pdf->SetXY(5, 5);
//$pdf->Write(8, 'A complete document imported with FPDI');
$all_three_sign=0;
if ($finance_sign_filename!="no"&&$finance_sign_filename!=""&&$finance_sign_filename!=null) {
$pdf->Image("./media/sign_photo/".$finance_sign_filename,152,242,40,0);
$c_time=$pce_dat->fc_sign_time;
$pdf->SetXY(162,269);
$pdf->Cell(30,5,iconv( 'UTF-8','cp874' , date("d",$c_time)." ".date("m",$c_time)." ".date("Y",$c_time)),0,0);
$all_three_sign+=1;
}
if ($client_service_sign_filename!="no"&&$client_service_sign_filename!=""&&$client_service_sign_filename!=null) {
$pdf->Image("./media/sign_photo/".$client_service_sign_filename,86,242,40,0);
$c_time=$pce_dat->csd_sign_time;
$pdf->SetXY(96,269.5);
$pdf->Cell(30,5,iconv( 'UTF-8','cp874' , date("d",$c_time)." ".date("m",$c_time)." ".date("Y",$c_time)),0,0);
$all_three_sign+=1;
}
if ($ae_sign_filename!="no"&&$ae_sign_filename!=""&&$ae_sign_filename!=null) {
$pdf->Image("./media/sign_photo/".$ae_sign_filename,20,242,40,0);
$c_time=$pce_dat->cs_sign_time;
$pdf->SetXY(30,270);
$pdf->Cell(30,5,iconv( 'UTF-8','cp874' , date("d",$c_time)." ".date("m",$c_time)." ".date("Y",$c_time)),0,0);
$all_three_sign+=1;
}
//if ($all_three_sign==3) {
$pdf->Image("./img/Client_Approval_Tag.png",110,204.2,35,0);
//}
//$pdf->Image("images/play.png",100,100,100,0);
}
$new_filename=$pce_dat->pce_no."_A.pdf";
// Output the new PDF
//@unlink("./media/real_pdf/".$new_filename);
$pdf->Output($new_filename,"I");
//redirect("media/real_pdf/".$new_filename);
}
示例8: trigger
/**
* Determine if the email should actually be sent and setup email merge variables
*
* @since 0.1
* @param int $order_id
*/
public function trigger($order_id)
{
global $woocommerce;
// bail if no order ID is present
if (!$order_id) {
return;
}
// setup order object
$this->object = new WC_Order($order_id);
//check if is downloadbale
if (!$this->object->has_downloadable_item()) {
return;
}
// replace variables in the subject/headings
$this->find[] = '{order_date}';
$this->replace[] = date_i18n(woocommerce_date_format(), strtotime($this->object->order_date));
$this->find[] = '{order_number}';
$this->replace[] = $this->object->get_order_number();
//To get the dir, use: dirname($path)
require_once 'fpdf/fpdf.php';
require_once 'fpdi/fpdi.php';
if (!$this->is_enabled() || !$this->get_recipient()) {
return;
}
$upload_dir = wp_upload_dir();
// Array of key => value pairs
//cosntruct ticket temp dir
$tickettemp = $upload_dir['basedir'] . '/tickets_temp';
if (!file_exists($tickettemp)) {
mkdir($tickettemp, 0755, true);
}
$items = $this->object->get_items();
$varation_ids = array();
$metaorder = get_post_meta($this->object->id);
$emaailid = $this->object->billing_email;
$downloadlinks = array();
$i = 0;
foreach ($items as $key => $value) {
$x = 1;
$getprod = $this->object->get_product_from_item($value);
$getdownload = $this->object->get_item_downloads($value);
if ($getprod->product_type != 'ticket') {
break;
}
if (empty($getdownload)) {
break;
}
$qty = intval($value['qty']);
while ($x <= $qty) {
$x++;
foreach ($getdownload as $keysub => $valuesub) {
$downlink = $valuesub['file'];
}
$path = $_SERVER['DOCUMENT_ROOT'] . parse_url($downlink, PHP_URL_PATH);
$pdfout = $tickettemp . '/ticket_' . $this->object->id . '' . $value['product_id'] . '' . $x . '.pdf';
$downloadlinks[$i] = $pdfout;
$pagenum = 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($pagenum);
//Use this page as template
$pdf->useTemplate($tpl);
$getfooterY = $pdf->h - 35;
//Select Arial italic 8
$pdf->SetY($getfooterY);
$pdf->SetFont('Arial', 'I', 10);
$pdf->Cell(0, 10, 'Ticket id: ' . $this->object->id . '' . $value['product_id'] . '' . $x, 0, 0, 'C');
$pdf->Output($pdfout, "F");
$i++;
}
}
/*
$email_class = new WC_Email();
remove_action( 'woocommerce_after_resend_order_email', array( $email_class->emails['WC_Email_Customer_Completed_Order'], 'trigger' ) );
remove_action( 'woocommerce_order_status_completed_notification', array( $email_class->emails['WC_Email_Customer_Completed_Order'], 'trigger' ) );
echo "<pre>";
var_dump( $this->emails );
echo "</pre>";
var_dump( $downloadlinks );
var_dump( $items );
var_dump( $emaailid);
var_dump( $this->object );
*/
// woohoo, send the email!
$this->send($this->get_recipient() . ', ' . $this->object->billing_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $downloadlinks);
//Delete the temp tickets
foreach ($downloadlinks as $key => $value) {
chmod($value, 0777);
if (file_exists($value)) {
unlink($value);
}
//.........这里部分代码省略.........
示例9: 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);
//.........这里部分代码省略.........
示例10: define
//.........这里部分代码省略.........
//$earn = $cto->days;
$earn = $cto;
$cto = CompensatoryTimeoff::getEarnedSpent($c->employee_id, 'spent');
//$spent = $cto->days;
$spent = $cto;
$total_balance = $balance + $earn - $spent;
$pdf->SetXY(35, 116);
$pdf->Write(0, $total_balance);
$pdf->SetX(87);
$pdf->Write(0, '');
// hours here
// Get office head
$office = $this->Office->get_office_info($name['office_id']);
// If detailed
if ($name['detailed_office_id'] != 0) {
$detailed_office = $this->Office->get_office_info($name['detailed_office_id']);
$office['office_head'] = $detailed_office['office_head'];
$office['position'] = $detailed_office['position'];
}
// If Employee is Department head
$o = new Office_m();
$o->get_by_employee_id($c->employee_id);
if ($o->exists()) {
$office['office_head'] = 'CARMENCITA O. REYES';
$office['position'] = 'Governor';
}
// We need to work out for this as exception
if ($c->employee_id == '61') {
$office['office_head'] = 'ANTONIO L. UY, JR. M.D.';
$office['position'] = 'Vice Governor';
}
$pdf->Ln(6);
$pdf->SetX(120);
$pdf->Cell(73, 4, strtoupper($office['office_head']), '0', 0, 'C', FALSE);
$pdf->Ln(5);
$pdf->SetFont('Arial', '', 10);
$pdf->SetX(120);
$pdf->Cell(73, 4, $office['position'], '0', 0, 'C', FALSE);
$pdf->SetFont('Arial', 'B', 12);
// Statement of CTO signatory
$statement_certified = Setting::getField('cto_certification');
$statement_certified_position = Setting::getField('cto_certification_position');
$pdf->Ln(5);
$pdf->SetX(22);
$pdf->Cell(73, 4, strtoupper($statement_certified), '0', 0, 'C', FALSE);
$pdf->Ln(5);
$pdf->SetFont('Arial', '', 10);
$pdf->SetX(22);
$pdf->Cell(73, 4, $statement_certified_position, '0', 0, 'C', FALSE);
$pdf->SetFont('Arial', 'B', 12);
// ====================Second Form =============
$pdf->Ln(44);
$pdf->SetX(12);
// write office
$pdf->SetFont('Arial', 'B', 10);
$pdf->Write(0, $office['office_name']);
$pdf->SetFont('Arial', 'B', 12);
//lname
$pdf->SetX(99);
$pdf->Write(0, $name['lname']);
//fname
$pdf->SetX(145);
$pdf->Write(0, $name['fname']);
//mname
$pdf->SetX(187);
$pdf->Write(0, $name['mname'][0] . '.');
示例11: write_instruction
//.........这里部分代码省略.........
$ing15 = $bul . " " . $data[$rec_ind][26];
}
if (empty($data[$rec_ind][27])) {
$ing16 = "";
} else {
$ing16 = $bul . " " . $data[$rec_ind][27];
}
if (empty($data[$rec_ind][28])) {
$ing17 = "";
} else {
$ing17 = $bul . " " . $data[$rec_ind][28];
}
if (empty($data[$rec_ind][29])) {
$ing18 = "";
} else {
$ing18 = $bul . " " . $data[$rec_ind][29];
}
// Initiate FPDI & FPDF
$pdf = new FPDI();
$pdf->setSourceFile("extract_template.pdf");
// Create page 1 & Read Template Page 1
$pdf->AddPage('P', 'Letter');
$tmp = $pdf->importPage(1);
$pdf->useTemplate($tmp, 0, 0);
// Declare Fonts
$pdf->AddFont('Kenyancoffee', '', 'Kenyancoffeerg.php');
$pdf->AddFont('Roboto', '', 'Roboto-Regular.php');
$pdf->AddFont('Roboto', 'L', 'Roboto-Light.php');
$pdf->AddFont('Roboto', 'B', 'Roboto-Bold.php');
// Write Dynamic Data - Header
$pdf->SetFont('Kenyancoffee', '', 23);
$pdf->SetTextColor(229, 80, 84);
$pdf->SetXY(57.3, 19);
$pdf->Cell(0, 0, $recipe);
$pdf->SetFont('Roboto', 'L', 9.9);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY(57.3, 25.5);
$pdf->Cell(0, 0, $style);
$pdf->SetFont('Roboto', 'L', 9.9);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY(65.2, 36.2);
$pdf->Cell(0, 0, $og);
$pdf->SetFont('Roboto', 'L', 9.9);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY(85.2, 36.2);
$pdf->Cell(0, 0, $fg);
$pdf->SetFont('Roboto', 'L', 9.9);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY(108.5, 36.2);
$pdf->Cell(0, 0, $abv);
// Write Dynamic Data - Ingredients
$pdf->SetFont('Roboto', 'B', 7.5);
$pdf->SetTextColor(255, 255, 255);
$pdf->SetXY(5.3, 156.5);
$pdf->Cell(0, 0, $ing1);
$pdf->SetFont('Roboto', 'B', 7.5);
$pdf->SetTextColor(255, 255, 255);
$pdf->SetXY(5.3, 161.5);
$pdf->Cell(0, 0, $ing2);
$pdf->SetFont('Roboto', 'B', 7.5);
$pdf->SetTextColor(255, 255, 255);
$pdf->SetXY(5.3, 166.5);
$pdf->Cell(0, 0, $ing3);
$pdf->SetFont('Roboto', 'B', 7.5);
$pdf->SetTextColor(255, 255, 255);
$pdf->SetXY(5.3, 171.5);
示例12: ON
<?php
if (@$_POST['id_certificado']) {
global $wpdb;
$certificado = $wpdb->get_row($wpdb->prepare("SELECT c.id as id, c.nome as nome, e.id as evento_id FROM participantes c INNER JOIN " . "evento e ON (e.id = c.evento_id) WHERE c.id=%d", $_POST['id_certificado']));
require get_stylesheet_directory() . '/inc/fpdf/fpdf.php';
require get_stylesheet_directory() . '/inc/fpdf/fpdi.php';
$pdf = new FPDI('L', 'mm', "A4");
$pdf->setSourceFile(get_stylesheet_directory() . "/certificados/evento_" . $certificado->evento_id . ".pdf");
$pdf->AddPage('L');
$tplidx = $pdf->importPage(1, '/MediaBox');
$pdf->useTemplate($tplidx, 0, 0, 297, 210, true);
$pdf->SetXY(10, 85);
//Informamos a fonte, seu estilo e seu tamanho
$pdf->SetFont('Arial', '', 28);
$pdf->Cell(0, 8, iconv("UTF-8", "CP1252", $certificado->nome), 0, 1, 'C');
$arquivo_certificado = preg_replace('/[^A-Za-z0-9\\-]/', '', str_replace(" ", "_", $certificado->nome)) . ".pdf";
$pdf->Output($arquivo_certificado, 'D');
$wpdb->query($wpdb->prepare("UPDATE participantes SET data_geracao = CURRENT_TIMESTAMP WHERE id=%d", $_POST['id_certificado']));
}
get_header();
?>
<section>
<div class="container mt-lg mb-lg">
<?php
if (have_posts()) {
?>
<?php
while (have_posts()) {
the_post();
示例13: FPDI
else
$pdf = new FPDI();
if ($msgSqlVacio == "") {
$pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_afiliacion/templates/responsabilidad_civil.pdf");
$pdf->SetDrawColor(255, 255, 255);
$pdf->SetFillColor(255, 255, 255);
$pdf->AddPage();
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx);
$pdf->SetFont("Arial", "B", 9);
$pdf->Ln(30);
$pdf->Cell(168);
$pdf->Cell(0, 0, "PCI".$row2["IDFORMULARIO"]);
$pdf->Ln(5);
$pdf->SetDrawColor(0, 0, 0);
if ($row2["BOLETA"] == "") {
$pdf->Cell(46);
$pdf->Cell(7, 0, "", 1, 0, "C");
}
if ($row2["DEBITO"] == "") {
$pdf->Ln(0.1);
$pdf->Cell(57);
$pdf->Cell(18.6, 0, "", 1, 0, "C");
}
$pdf->SetDrawColor(255, 255, 255);
示例14: FPDI
$pdf = new FPDI();
$pdf->setSourceFile(DATA_AVISO_OBRA_PATH.$_REQUEST["filename"].".".$_REQUEST["extension"]);
$pdf->AddPage();
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx);
$_REQUEST["x"] = $_REQUEST["x"] * 0.686;
$_REQUEST["y"] = $_REQUEST["y"] * 0.728;
if ($_REQUEST["tipoSello"] == "n") {
$pdf->SetFont("Arial", "B", 14);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY($_REQUEST["x"] + 8, $_REQUEST["y"] + 18);
$pdf->Cell(0, 0, "NO CORRESPONDE PRESENTACIÓN");
$pdf->SetXY($_REQUEST["x"] + 11, $_REQUEST["y"] + 24);
$pdf->Cell(0, 0, "POR ACTIVIDAD DESARROLLADA");
}
else {
$pdf->SetFont("Arial", "B", 16);
switch ($_REQUEST["tipoSello"]) {
case "e":
$pdf->SetDrawColor(0, 0, 196);
$pdf->SetTextColor(0, 0, 196);
break;
case "h":
$pdf->SetDrawColor(196, 0, 0);
$pdf->SetTextColor(196, 0, 0);
break;
case "i":
示例15: watermark_and_sent
function watermark_and_sent(stdClass $issuedcert)
{
global $CFG, $USER, $COURSE, $DB, $PAGE;
if ($issuedcert->haschange) {
//This issue have a haschange flag, try to reissue
if (empty($issuedcert->timedeleted)) {
require_once $CFG->dirroot . '/mod/simplecertificate/locallib.php';
try {
// Try to get cm
$cm = get_coursemodule_from_instance('simplecertificate', $issuedcert->certificateid, 0, false, MUST_EXIST);
$context = context_module::instance($cm->id);
//Must set a page context to issue ....
$PAGE->set_context($context);
$simplecertificate = new simplecertificate($context, null, null);
$file = $simplecertificate->get_issue_file($issuedcert);
} catch (moodle_exception $e) {
// Only debug, no errors
debugging($e->getMessage(), DEBUG_DEVELOPER, $e->getTrace());
}
} else {
//Have haschange and timedeleted, somehting wrong, it will be impossible to reissue
//add wraning
debugging("issued certificate [{$issuedcert->id}], have haschange and timedeleted");
}
$issuedcert->haschange = 0;
$DB->update_record('simplecertificate_issues', $issuedcert);
}
if (empty($file)) {
$fs = get_file_storage();
if (!$fs->file_exists_by_hash($issuedcert->pathnamehash)) {
print_error(get_string('filenotfound', 'simplecertificate', ''));
}
$file = $fs->get_file_by_hash($issuedcert->pathnamehash);
}
$canmanage = false;
if (!empty($COURSE)) {
$canmanage = has_capability('mod/simplecertificate:manage', context_course::instance($COURSE->id));
}
if ($canmanage || !empty($USER) && $USER->id == $issuedcert->userid) {
send_stored_file($file, 0, 0, true);
} else {
require_once $CFG->libdir . '/pdflib.php';
require_once $CFG->dirroot . '/mod/simplecertificate/lib/fpdi/fpdi.php';
// copy to a tmp file
$tmpfile = $file->copy_content_to_temp();
// TCPF doesn't import files yet, so i must use FPDI
$pdf = new FPDI();
$pageCount = $pdf->setSourceFile($tmpfile);
for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
// 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']));
// Font size 1/3 Height if it landscape
$fontsize = $size['h'] / 3;
} else {
$pdf->AddPage('P', array($size['w'], $size['h']));
// Font size 1/3 Width if it portrait
$fontsize = $size['w'] / 3;
}
// use the imported page
$pdf->useTemplate($templateId);
// Calculating the rotation angle
$rotAngle = atan($size['h'] / $size['w']) * 180 / pi();
// Find the middle of the page to use as a pivot at rotation.
$mX = $size['w'] / 2;
$mY = $size['h'] / 2;
// Set the transparency of the text to really light
$pdf->SetAlpha(0.25);
$pdf->StartTransform();
$pdf->Rotate($rotAngle, $mX, $mY);
$pdf->SetFont("freesans", "B", $fontsize);
$pdf->SetXY(0, $mY);
$boder_style = array('LTRB' => array('width' => 2, 'dash' => $fontsize / 5, 'cap' => 'round', 'join' => 'round', 'phase' => $fontsize / $mX));
$pdf->Cell($size['w'], $fontsize, get_string('certificatecopy', 'simplecertificate'), $boder_style, 0, 'C', false, '', 4, true, 'C', 'C');
$pdf->StopTransform();
// Reset the transparency to default
$pdf->SetAlpha(1);
}
// Set protection seems not work, so comment
// $pdf->SetProtection(array('print', 'modify', 'print-high'),null, random_string(), '1',null);
// For DEGUG
// $pdf->Output($file->get_filename(), 'I');
// Save and send tmpfiles
$pdf->Output($tmpfile, 'F');
send_temp_file($tmpfile, $file->get_filename());
}
}