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


PHP TCPDF::SetPrintFooter方法代码示例

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


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

示例1: student_kolizijapdf


//.........这里部分代码省略.........
    if ($tipstudija == 3) {
        $mscfile = "-msc";
    } else {
        if ($tipstudija == 2) {
            $mscfile = "";
        }
    }
    // Ako čovjek upisuje prvu godinu nečeka (mastera), broj indexa je netačan!
    if ($godina == 1) {
        $brindexa = "";
    }
    // ----- Pravljenje PDF dokumenta
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    // set document information
    $pdf->SetCreator("Zamger");
    $pdf->SetTitle('Domestic Learning Agreement / Ugovor o ucenju');
    // set default monospaced font
    $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
    //set margins
    $pdf->SetMargins(0, 0, 0);
    //set auto page breaks
    $pdf->SetAutoPageBreak(false);
    //set image scale factor
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    //$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO*2.083333);
    $pdf->setJPEGQuality(100);
    //set some language-dependent strings
    $pdf->setLanguageArray($l);
    // ---------------------------------------------------------
    // set font
    $pdf->SetFont('freesans', 'B', 9);
    $pdf->SetHeaderData("", 0, "", "");
    $pdf->SetPrintHeader(false);
    $pdf->SetPrintFooter(false);
    // add a page
    $pdf->AddPage();
    //	$pdf->Image("images/content/150dpi/ETF-Domestic-contract-PGS-ALL-0.png",210,297,0,0,'','','',true,150);
    $pdf->Image("images/content/150dpi/domestic-contract{$mscfile}-0.png", 0, 0, 210, 0, '', '', '', true, 150);
    $pdf->SetXY(175, 34);
    $pdf->Cell(23, 0, $agnaziv, 0, 0, 'C');
    $pdf->SetXY(175, 42);
    $pdf->Cell(23, 0, $godina . ".", 0, 0, 'C');
    $pdf->SetXY(175, 50);
    $pdf->Cell(23, 0, $sem1 . ". & " . $sem2, 0, 0, 'C');
    $pdf->SetXY(70, 48);
    $pdf->Cell(100, 0, $studijeng, 0, 0);
    $pdf->SetXY(70, 52);
    $pdf->Cell(100, 0, $studijbos, 0, 0);
    $pdf->SetXY(70, 62);
    $pdf->Cell(100, 0, $imeprezime);
    $pdf->SetXY(70, 69);
    $pdf->Cell(100, 0, $brindexa);
    // PRVI SEMESTAR
    $pdf->AddPage();
    $pdf->Image("images/content/150dpi/domestic-contract{$mscfile}-1.png", 0, 0, 210);
    $pdf->SetXY(175, 34);
    $pdf->Cell(23, 0, $agnaziv, 0, 0, 'C');
    $pdf->SetXY(175, 42);
    $pdf->Cell(23, 0, $godina . ".", 0, 0, 'C');
    $pdf->SetXY(175, 50);
    $pdf->Cell(23, 0, $sem1 . ".", 0, 0, 'C');
    $pdf->SetXY(70, 48);
    $pdf->Cell(100, 0, $studijeng, 0, 0);
    $pdf->SetXY(70, 52);
    $pdf->Cell(100, 0, $studijbos, 0, 0);
    $pdf->SetXY(70, 62);
开发者ID:msehalic,项目名称:zamger,代码行数:67,代码来源:kolizijapdf.php

示例2: izvjestaj_prijemni_brzi_unos

function izvjestaj_prijemni_brzi_unos()
{
    require_once 'lib/tcpdf/tcpdf.php';
    $termin = intval($_REQUEST['termin']);
    $osoba = intval($_REQUEST['osoba']);
    $q10 = myquery("select ime, prezime, imeoca, jmbg from osoba where id={$osoba}");
    if (mysql_num_rows($q10) < 1) {
        biguglyerror("Nepostojeća osoba");
        zamgerlog("nepostojeca osoba {$osoba}", 3);
        return;
    }
    $ime = mysql_result($q10, 0, 0);
    $prezime = mysql_result($q10, 0, 1);
    $imeoca = mysql_result($q10, 0, 2);
    $jmbg = mysql_result($q10, 0, 3);
    $q20 = myquery("select sifra, jezik from prijemni_obrazac where osoba={$osoba} and prijemni_termin={$termin}");
    if (mysql_num_rows($q20) < 1) {
        biguglyerror("Ne postoji obrazac za ovu osobu");
        zamgerlog("za osobu u{$osoba} ne postoji obrazac na terminu {$termin}", 3);
        return;
    }
    $sifra = mysql_result($q20, 0, 0);
    $jezik = mysql_result($q20, 0, 1);
    $datum = date("d. m. Y.");
    $vrijeme = date("h:i");
    // ----- Pravljenje PDF dokumenta
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    // set document information
    $pdf->SetCreator("Zamger");
    $pdf->SetTitle('Sifra kandidata i pregled vaznijih datuma');
    // set default monospaced font
    $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
    //set margins
    $pdf->SetMargins(0, 0, 0);
    //set auto page breaks
    $pdf->SetAutoPageBreak(false);
    //set image scale factor
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    //$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO*2.083333);
    $pdf->setJPEGQuality(100);
    //set some language-dependent strings
    $pdf->setLanguageArray($l);
    // ---------------------------------------------------------
    // set font
    $pdf->SetFont('freesans', '', 48);
    $pdf->SetHeaderData("", 0, "", "");
    $pdf->SetPrintHeader(false);
    $pdf->SetPrintFooter(false);
    // add a page
    $pdf->AddPage();
    //	$pdf->Image("images/content/150dpi/ETF-Domestic-contract-PGS-ALL-0.png",210,297,0,0,'','','',true,150);
    if ($jezik == "en") {
        $pdf->Image("images/content/150dpi/obrazac_sa_sifrom_en.png", 0, 0, 210, 0, '', '', '', true, 150);
        $en_offset = 7;
    } else {
        $pdf->Image("images/content/150dpi/obrazac_sa_sifrom.png", 0, 0, 210, 0, '', '', '', true, 150);
        $en_offset = 0;
    }
    $pdf->SetXY(130, 15);
    $pdf->Cell(23, 0, $sifra, 0, 0, 'C');
    $pdf->SetFont('freesans', '', 16);
    $pdf->SetXY(80, 62 + $en_offset);
    $pdf->Cell(23, 0, "{$ime} ({$imeoca}) {$prezime}");
    $pdf->SetXY(80, 73 + $en_offset);
    $pdf->Cell(23, 0, $jmbg);
    $pdf->SetFont('freesans', '', 14);
    $pdf->SetXY(40, 113 + $en_offset);
    $pdf->Cell(23, 0, $datum);
    $pdf->SetXY(130, 113 + $en_offset);
    $pdf->Cell(23, 0, $vrijeme);
    // ---------------------------------------------------------
    //Close and output PDF document
    $pdf->Output('obrazac_sa_sifrom.pdf', 'I');
    //============================================================+
    // END OF FILE
    //============================================================+
}
开发者ID:msehalic,项目名称:zamger,代码行数:77,代码来源:prijemni_brzi_unos.php

示例3: __construct

 /**
  * @param Layout $default_layout
  */
 public function __construct(Layout $default_layout)
 {
     $this->pdf = new \TCPDF('P', 'pt', 'A4', true, 'UTF-8');
     $this->pdf->SetTitle($default_layout->getReportTitle());
     $this->pdf->SetCreator('Thinreports Generator');
     $this->pdf->SetAutoPageBreak(false);
     $this->pdf->SetMargins(0, 0, 0, true);
     $this->pdf->SetCellPadding(0);
     $this->pdf->SetCellMargins(0, 0, 0, 0);
     $this->pdf->SetPrintHeader(false);
     $this->pdf->SetPrintFooter(false);
     $this->default_layout = $default_layout;
     $this->default_page_format = $this->buildPageFormat($default_layout);
 }
开发者ID:k-yamamura,项目名称:thinreports-php,代码行数:17,代码来源:Document.php

示例4: __construct

 /**
  * @param Layout|null $default_layout
  */
 public function __construct(Layout $default_layout = null)
 {
     $this->pdf = new \TCPDF('P', 'pt', 'A4', true, 'UTF-8');
     $this->pdf->SetCreator('Thinreports Generator');
     $this->pdf->SetAutoPageBreak(false);
     $this->pdf->SetMargins(0, 0, 0, true);
     $this->pdf->SetCellPadding(0);
     $this->pdf->SetCellMargins(0, 0, 0, 0);
     $this->pdf->SetPrintHeader(false);
     $this->pdf->SetPrintFooter(false);
     if ($default_layout !== null) {
         $this->pdf->SetTitle($default_layout->getReportTitle());
         $this->registerPageFormat($default_layout);
     }
     $this->initDrawer();
 }
开发者ID:monnouchi,项目名称:thinreports-php,代码行数:19,代码来源:Document.php

示例5: prepareStockStatusReport

function prepareStockStatusReport($conn)
{
    $lan = $_POST['lan'];
    if ($lan == 'en-GB') {
        $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');
    } else {
        $MonthList = array('1' => 'Janvier', '2' => 'F�vrier', '3' => 'Mars', '4' => 'Avril', '5' => 'Mai', '6' => 'Juin', '7' => 'Juillet', '8' => 'Ao�t', '9' => 'Septembre', '10' => 'Octobre', '11' => 'Novembre', '12' => 'D�cembre');
    }
    require_once 'tcpdf/tcpdf.php';
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    $pdf->SetPrintHeader(false);
    $pdf->SetPrintFooter(false);
    $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
    $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
    $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
    $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
    $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
        require_once dirname(__FILE__) . '/lang/eng.php';
        $pdf->setLanguageArray($l);
    }
    $pdf->SetFont('dejavusans', '', 12);
    $pdf->AddPage();
    ini_set('magic_quotes_gpc', 'off');
    $html = htmlentities($_POST['html'], ENT_QUOTES, "UTF-8");
    $html = html_entity_decode($html, ENT_QUOTES, "UTF-8");
    $alavel = htmlentities($_POST['alavel'], ENT_QUOTES, "UTF-8");
    $alavel = html_entity_decode($alavel, ENT_QUOTES, "UTF-8");
    $filePath = SITEDOCUMENT . 'administrator/components/com_jcode/source/report/pdfslice/stock_status.svg';
    if (file_exists($filePath)) {
        unlink($filePath);
    }
    $file = fopen($filePath, "w");
    fwrite($file, $html);
    fclose($file);
    $pdf->ImageSVG($file = 'pdfslice/stock_status.svg', $x = 8, $y = 20, $w = 180, $h = '', $link = '', $align = 'left', $palign = 'center', $border = 0, $fitonpage = false);
    $html2 = <<<EOF
    <!-- EXAMPLE OF CSS STYLE -->
    <style>
    </style>
    <body>
        <div id="barchartlegend">
            {$alavel}
        </div>
    </body>
EOF;
    echo $html2;
    $pdf->writeHTMLCell($w = 150, $h = 30, $x = 15, $y = 0, $html2, $border = 0, $ln = 0, $fill = false, $reseth = true, $align = 'C', $autopadding = true);
    $filePath = SITEDOCUMENT . 'administrator/components/com_jcode/source/report/pdfslice/StockStatusChart.pdf';
    if (file_exists($filePath)) {
        unlink($filePath);
    }
    $pdf->Output('pdfslice/StockStatusChart.pdf', 'F');
}
开发者ID:sankam-nikolya,项目名称:lptt,代码行数:55,代码来源:r_report_stock_status_different_level_pdf.php

示例6: prepareFundingStatusReport

function prepareFundingStatusReport($conn)
{
    require_once 'tcpdf/tcpdf.php';
    //$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    $pdf = new TCPDF('L', PDF_UNIT, 'Letter', true, 'UTF-8', false);
    $pdf->SetPrintHeader(false);
    $pdf->SetPrintFooter(false);
    $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
    $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
    $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
    $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
    $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
        require_once dirname(__FILE__) . '/lang/eng.php';
        $pdf->setLanguageArray($l);
    }
    $pdf->SetFont('dejavusans', '', 7);
    $pdf->AddPage($orientation = L, $format = 'Letter', $keepmargins = true, $tocpage = false);
    ini_set('magic_quotes_gpc', 'off');
    $html = htmlentities($_POST['html'], ENT_QUOTES, "UTF-8");
    $html = html_entity_decode($html, ENT_QUOTES, "UTF-8");
    $alavel = htmlentities($_POST['alavel'], ENT_QUOTES, "UTF-8");
    $alavel = html_entity_decode($alavel, ENT_QUOTES, "UTF-8");
    $filePath = SITEDOCUMENT . 'administrator/components/com_jcode/source/report/pdfslice/funding_status.svg';
    if (file_exists($filePath)) {
        unlink($filePath);
    }
    $file = fopen($filePath, "w");
    fwrite($file, $html);
    fclose($file);
    $pdf->ImageSVG($file = 'pdfslice/funding_status.svg', $x = 3, $y = 20, $w = 1291, $h = 400, $link = '', $align = '', $palign = 'center', $border = 0, $fitonpage = false);
    $html2 = <<<EOF
    <!-- EXAMPLE OF CSS STYLE -->
    <style>
    </style>
    <body>
        <div id="barchartlegend">
            {$alavel}
        </div>
    </body>
EOF;
    echo $html2;
    $pdf->writeHTMLCell($w = 150, $h = 30, $x = 15, $y = 130, $html2, $border = 0, $ln = 0, $fill = false, $reseth = true, $align = 'middle', $autopadding = true);
    $filePath = SITEDOCUMENT . 'administrator/components/com_jcode/source/report/pdfslice/FundingStatusChart.pdf';
    if (file_exists($filePath)) {
        unlink($filePath);
    }
    $pdf->Output('pdfslice/FundingStatusChart.pdf', 'F');
}
开发者ID:sankam-nikolya,项目名称:lptt,代码行数:50,代码来源:r_report_funding_status_pdf.php

示例7: postAdicionar

 public function postAdicionar()
 {
     $pdf = new TCPDF();
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('GestBiblio - Sistema de Gestão de Bibliotecas');
     $pdf->SetTitle('Comprovante de Imprestimo');
     $pdf->SetPrintHeader(false);
     $pdf->SetPrintFooter(false);
     $pdf->AddPage();
     $html = '';
     $pdf->Text(90, 140, 'This is a test');
     $filename = storage_path() . '/test.pdf';
     $pdf->output($filename, 'F');
     return Response::view($filename);
 }
开发者ID:bening2011,项目名称:GestBiblio-TCC,代码行数:15,代码来源:FpdfController.php

示例8: printPost

 /**
  * [พิมพ์ post]
  * @param  [type] $id [description]
  * @return [type]     [description]
  */
 public function printPost($id)
 {
     if (Session::get('c3') == 1) {
         $sql = ' select c.*, concat(n.pname,n.fname," ",n.lname) as fullname from c_blog_posts c left join n_datageneral n on n.cid=c.created_by';
         $sql .= ' where postID =' . e($id) . ' ';
         $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
         $pdf->SetPrintHeader(false);
         $pdf->SetPrintFooter(false);
         // set header and footer fonts
         $pdf->setHeaderFont(array('angsanaupc', '', PDF_FONT_SIZE_MAIN));
         $pdf->setFooterFont(array('angsanaupc', '', PDF_FONT_SIZE_DATA));
         // set default monospaced font
         $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
         // set margins
         $pdf->SetMargins(15, 15, 15);
         $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
         $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
         $pdf->AddPage();
         $pdf->SetFont('angsanaupc', 'B', 16, '', true);
         $pdf->SetXY(15, 15);
         $pdf->MultiCell(180, 0, 'ใบประสานงานขอรถ', 0, 'C', 0, 1, '', '', true);
         $data = DB::select($sql);
         $pdf->SetFont('angsanaupc', '', 14, '', true);
         $tbl = '<br /><br /><table style="width: 100%; padding:2px;" cellspacing="0">';
         foreach ($data as $key => $value) {
             $tbl = $tbl . '<tr>
                   <td style="border: 0px solid #000000; text-align:left"> เรื่อง ' . $value->postTitle . '</td>
               </tr>';
             $tbl = $tbl . '<tr>
                   <td style="border: 0px solid #000000; text-align:left"> สร้างโดย ' . $value->fullname . ' วันที่ ' . date("d-m", strtotime($value->postDate)) . '-' . (date("Y", strtotime($value->postDate)) + 543) . ' เวลา ' . date("H:i:s", strtotime($value->postDate)) . '</td>
               </tr>';
             $tbl = $tbl . '<tr>
                   <td style="border: 0px solid #000000; text-align:left"> ' . $value->postDesc . '</td>
               </tr>';
         }
         $tbl = $tbl . '</table>';
         $pdf->writeHTML($tbl, true, false, false, false, '');
         $filename = storage_path() . '/report_post.pdf';
         $contents = $pdf->output($filename, 'I');
         $headers = array('Content-Type' => 'application/pdf');
         return Response::make($contents, 200, $headers);
     } else {
         return Redirect::to('contact');
     }
 }
开发者ID:themesanasang,项目名称:car,代码行数:50,代码来源:ContactController.php

示例9: initialize_pdf

 /**
  * Sets up a new PDF object with the necessary settings
  *
  * @return  FPDF            A new PDF object
  */
 protected function initialize_pdf()
 {
     global $CFG;
     require_once $CFG->dirroot . '/local/elisreports/lib/tcpdf/tcpdf.php';
     $newpdf = new TCPDF('L', 'in', 'letter');
     //prevent the library from automatically outputting
     //header or footer bars
     $newpdf->SetPrintHeader(false);
     $newpdf->SetPrintFooter(false);
     $newpdf->setMargins(self::marginx, self::marginy);
     $newpdf->SetFont('freesans', '', 9);
     $newpdf->AddPage();
     $newpdf->SetFont('freesans', '', 16);
     $newpdf->MultiCell(0, 0.2, $this->report->title, 0, 'C');
     $newpdf->Ln(0.2);
     $newpdf->SetFont('freesans', '', 8);
     $newpdf->SetFillColor(225, 225, 225);
     return $newpdf;
 }
开发者ID:jamesmcq,项目名称:elis,代码行数:24,代码来源:php_report_export_pdf.class.php

示例10: generateShipmentReport

function generateShipmentReport($conn)
{
    global $gTEXT;
    require_once 'tcpdf/tcpdf.php';
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    $pdf->SetPrintHeader(false);
    $pdf->SetPrintFooter(false);
    $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
    $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
    $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
    $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
        require_once dirname(__FILE__) . '/lang/eng.php';
        $pdf->setLanguageArray($l);
    }
    $pdf->AddPage();
    $pdf->SetFillColor(255, 255, 255);
    //=====================================================National Inventory Table=======================================================
    /*	$months = $_POST['MonthNumber']; 
        $monthIndex = date("n");
        $yearIndex = date("Y");
        settype($yearIndex, "integer");    
        if ($monthIndex == 1){
    		$monthIndex = 12;				
    		$yearIndex = $yearIndex - 1;				
    	}else{
    	    $monthIndex = $monthIndex - 1;
    	}
        $months = $months - 1;  
          	   
        $currentYearMonth = $yearIndex."-0".$monthIndex."-"."01";    
        $currentYearMonth = date('Y-m-d', strtotime($currentYearMonth));
    	$lastYearMonth = date("Y-m-d", strtotime(date("Y-m-d", strtotime($currentYearMonth)) . "-".$months." month"));  
        */
    $StartMonthId = $_POST['StartMonthId'];
    $StartYearId = $_POST['StartYearId'];
    $EndMonthId = $_POST['EndMonthId'];
    $EndYearId = $_POST['EndYearId'];
    if ($_POST['MonthNumber'] != 0) {
        $months = $_POST['MonthNumber'];
        $monthIndex = date("m");
        $yearIndex = date("Y");
        settype($yearIndex, "integer");
        $startDate = $yearIndex . "-" . $monthIndex . "-" . "01";
        $startDate = date('Y-m-d', strtotime($startDate));
        $months--;
        $endDate = date("Y-m-d", strtotime(date("Y-m-d", strtotime($startDate)) . "+" . $months . " month"));
    } else {
        $startDate = $StartYearId . "-" . $StartMonthId . "-" . "01";
        $startDate = date('Y-m-d', strtotime($startDate));
        $d = cal_days_in_month(CAL_GREGORIAN, $EndMonthId, $EndYearId);
        $endDate = $EndYearId . "-" . $EndMonthId . "-" . $d;
        $endDate = date('Y-m-d', strtotime($endDate));
    }
    $CountryId = $_POST['ACountryId'];
    $AFundingSourceId = $_POST['AFundingSourceId'];
    $ASStatusId = $_POST['ASStatusId'];
    $ItemGroup = $_POST['ItemGroup'];
    $OwnerTypeId = $_POST['OwnerType'];
    if ($AFundingSourceId) {
        $AFundingSourceId = " AND a.FundingSourceId = '" . $AFundingSourceId . "' ";
    }
    if ($ASStatusId) {
        $ASStatusId = " AND a.ShipmentStatusId = '" . $ASStatusId . "' ";
    }
    if ($ItemGroup) {
        $ItemGroup = " AND e.ItemGroupId = '" . $ItemGroup . "' ";
    }
    if ($OwnerTypeId) {
        $OwnerTypeId = " AND f.OwnerTypeId = '" . $OwnerTypeId . "' ";
    }
    $sLimit = "";
    if (isset($_POST['iDisplayStart'])) {
        $sLimit = " LIMIT " . mysql_real_escape_string($_POST['iDisplayStart']) . ", " . mysql_real_escape_string($_POST['iDisplayLength']);
    }
    $sOrder = "";
    if (isset($_POST['iSortCol_0'])) {
        $sOrder = " ORDER BY  ";
        for ($i = 0; $i < mysql_real_escape_string($_POST['iSortingCols']); $i++) {
            $sOrder .= fnColumnToField_agencyShipment(mysql_real_escape_string($_POST['iSortCol_' . $i])) . "" . mysql_real_escape_string($_POST['sSortDir_' . $i]) . ", ";
        }
        $sOrder = substr_replace($sOrder, "", -2);
    }
    $sWhere = "";
    if ($_POST['sSearch'] != "") {
        $sWhere = "  AND (a.ItemNo LIKE '%" . mysql_real_escape_string($_POST['sSearch']) . "%'  OR " . " e.ItemName LIKE '%" . mysql_real_escape_string($_POST['sSearch']) . "%' OR " . " c.ShipmentStatusDesc LIKE '%" . mysql_real_escape_string($_POST['sSearch']) . "%')  ";
    }
    $sql = "SELECT SQL_CALC_FOUND_ROWS AgencyShipmentId, a.FundingSourceId, d.FundingSourceName, a.ShipmentStatusId, c.ShipmentStatusDesc, a.CountryId, \n            b.CountryName, a.ItemNo, e.ItemName, a.ShipmentDate, a.Qty, a.OwnerTypeId, f.OwnerTypeName \n\t\t\tFROM t_agencyshipment as a\n            INNER JOIN t_country b ON a.CountryId = b.CountryId\n            INNER JOIN t_shipmentstatus c ON a.ShipmentStatusId = c.ShipmentStatusId\n            INNER JOIN t_fundingsource d ON a.FundingSourceId= d.FundingSourceId\n            INNER JOIN t_itemlist e ON a.ItemNo = e.ItemNo\n            INNER JOIN t_owner_type f ON a.OwnerTypeId = f.OwnerTypeId \n            WHERE CAST(a.ShipmentDate AS DATETIME) BETWEEN CAST('{$startDate}' AS DATETIME) AND CAST('{$endDate}' AS DATETIME) \n            AND (a.CountryId = " . $CountryId . " OR " . $CountryId . " = 0) \n            " . $AFundingSourceId . " " . $ASStatusId . " " . $ItemGroup . " " . $OwnerTypeId . "\n\t\t\t{$sWhere} {$sOrder} {$sLimit} ";
    $result = mysql_query($sql, $conn);
    $total = mysql_num_rows($result);
    $i = 0;
    $f = 0;
    $GrandtotalQty = 0;
    $SubtotalQty = 0;
    $OldCountry = ' ';
    $NewCountry = ' ';
    $serial = 1;
    $tblHTML = '';
    if ($total > 0) {
//.........这里部分代码省略.........
开发者ID:sankam-nikolya,项目名称:lptt,代码行数:101,代码来源:r_report_shipment_pdf.php

示例11: genPDF

function genPDF($proj, $local = false)
{
    // create new PDF document
    $size = array(8.5, 11);
    $pdf = new TCPDF("l", "in", $size, true, "UTF-8", false);
    // set document information
    $pdf->SetCreator(PDF_CREATOR);
    $pdf->SetAuthor("EMu Mover");
    $pdf->SetTitle("Project Title");
    $pdf->SetSubject("Project");
    $pdf->SetKeywords("EMu, Project");
    $pdf->SetPrintHeader(false);
    $pdf->SetPrintFooter(false);
    $pdf->SetMargins(0.5, 0.5, 0.5, false);
    setSpacing($pdf);
    // set font
    $pdf->SetFont("helvetica", "", 10);
    // add a page
    $pdf->AddPage();
    $pdf->SetAutoPageBreak(TRUE, 0);
    $html = "";
    $css = file_get_contents("report.css");
    $style = "<style type=\"text/css\">\n{$css}\n</style>";
    $w = $pdf->getPageWidth();
    $h = $pdf->getPageHeight();
    $m = $pdf->getMargins();
    $pdf->setCellPaddings(0.05, 0.1, 0.05, 0);
    $pdf->setCellHeightRatio(0.4);
    $w -= $m['left'] + $m['right'];
    $h -= $m['top'] + $m['bottom'];
    $sixth = $w / 6;
    $sixth = floor($sixth * 100.0) / 100.0;
    $objs = generatePDFcells($proj);
    addHeaderRow($pdf);
    //Get row heights
    $heights = array();
    foreach ($objs as $k1 => $obj) {
        $c = 0;
        $lh = 0;
        $y = $pdf->GetY();
        foreach ($obj as $k2 => $cell) {
            $cellWidth = $sixth;
            $x = $pdf->GetX();
            if ($c == 1) {
                $cellWidth = 3 * $sixth;
            }
            $pdf->writeHTMLcell($cellWidth, 0, $x, $y, $style . $cell, 0, 0, 0, 1, '', 1);
            $c++;
            $tlh = $pdf->getLastH();
            //$objs[$k1][$k2] .= "<p>$tlh</p>";
            if ($tlh > $lh) {
                $lh = $tlh;
            }
        }
        $heights[$k1] = $lh;
        $pdf->deletePage($pdf->getPage());
        $pdf->AddPage();
    }
    addIntro($pdf, $proj);
    $y = $pdf->GetY();
    addHeaderRow($pdf);
    //Now actually create the PDF
    foreach ($objs as $k1 => $obj) {
        $y = $pdf->GetY();
        if (isset($heights[$k1])) {
            if ($y + $heights[$k1] >= $h) {
                $pdf->AddPage();
                addHeaderRow($pdf);
            }
        }
        $c = 0;
        $lh = 0;
        $y = $pdf->GetY();
        foreach ($obj as $k2 => $cell) {
            $cellWidth = $sixth;
            $x = $pdf->GetX();
            if ($c == 1) {
                $cellWidth = 3 * $sixth;
            }
            $pdf->writeHTMLcell($cellWidth, $heights[$k1], $x, $y, $style . $cell, 'LTRB', 0, 0, 1, '', 1);
            $c++;
        }
        $pdf->SetY($y + $heights[$k1]);
    }
    if ($proj) {
        $info = getProjectInfo($proj);
        if ($local) {
            $fname = $info['title'] . ".pdf";
            $pdfpath = sys_get_temp_dir() . "/" . $info['title'] . "--" . date("Y-m-d") . ".pdf";
            $pdf->Output($pdfpath, "F");
            return $pdfpath;
        } else {
            header("Content-type: application/pdf");
            $val = $pdf->Output($info['title'] . "-" . date("Y-m-d") . ".pdf", "I");
            print $val;
        }
        return true;
        exit;
    } else {
        print "{$style}";
//.........这里部分代码省略.........
开发者ID:CMP-Studio,项目名称:EmuObjectMover,代码行数:101,代码来源:genPDF.php

示例12: generateFacilityInventoryReport

function generateFacilityInventoryReport($conn)
{
    global $gTEXT;
    require_once 'tcpdf/tcpdf.php';
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    $pdf->SetPrintHeader(false);
    $pdf->SetPrintFooter(false);
    $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
    $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
    $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
    $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
        require_once dirname(__FILE__) . '/lang/eng.php';
        $pdf->setLanguageArray($l);
    }
    $pdf->setFontSubsetting(false);
    $pdf->AddPage();
    $pdf->SetFillColor(255, 255, 255);
    //=====================================================Facility Inventory Table=======================================================
    $MonthId = $_REQUEST['MonthId'];
    $YearId = $_REQUEST['YearId'];
    $mosTypeId = $_REQUEST['MosTypeId'];
    $countryId = $_REQUEST['CountryId'];
    $fLevelId = $_REQUEST['FLevelId'];
    $FacilityId = $_REQUEST['FacilityId'];
    $ItemGroupId = $_REQUEST['ItemGroupId'];
    $regionId = $_REQUEST['RegionId'];
    $districtId = $_REQUEST['DistrictId'];
    $ownerTypeId = $_REQUEST['OwnerTypeId'];
    $region = $_REQUEST['Region'];
    $district = $_REQUEST['District'];
    $ownerType = $_REQUEST['OwnerType'];
    $year = $_REQUEST['Year'];
    $CountryName = $_REQUEST['CountryName'];
    $monthName = $_REQUEST['MonthName'];
    $ItemGroupName = $_REQUEST['ItemGroupName'];
    $FacilityName = $_REQUEST['FacilityName'];
    $lan = $_REQUEST['lan'];
    if ($lan == 'en-GB') {
        $SITETITLE = SITETITLEENG;
    } else {
        $SITETITLE = SITETITLEFRN;
    }
    $column_name = array();
    $sQuery1 = "SELECT\n\t\t\t    MosTypeId\n\t\t\t    , MosTypeName\n\t\t\t    , ColorCode\n\t\t\tFROM\n\t\t\t    t_mostype_facility\n\t\t\tWHERE CountryId = {$countryId} AND FLevelId = {$fLevelId}  AND (MosTypeId = {$mosTypeId} OR {$mosTypeId} = 0)\n\t\t\tORDER BY MosTypeId;";
    $rResult1 = mysql_query($sQuery1);
    $output1 = array();
    $col = '';
    while ($row1 = mysql_fetch_array($rResult1)) {
        $output1[] = $row1;
        array_push($column_name, $row1['MosTypeName']);
    }
    $col .= '<tr><th width="180" align="left"><b>' . $gTEXT['Product Name'] . '</b></th>';
    $col .= '<th width="60" align="left"><b>' . $gTEXT['Closing Balance'] . '</b></th>';
    $col .= '<th width="45" align="left"><b>' . $gTEXT['AMC'] . '</b></th>';
    $col .= '<th width="40" align="left"><b>' . $gTEXT['MOS'] . '</b></th>';
    $f = 0;
    for ($f = 0; $f < count($output1); $f++) {
        $col .= '<th width="70" align="right"><b>' . $column_name[$f] . '</b></th>';
    }
    $col .= '</tr>';
    /*
    	$sQuery = "SELECT p.MosTypeId, ItemName, MOS FROM (SELECT
    				    a.ItemNo
    				    , b.ItemName
    				    , a.MOS
    				,(SELECT MosTypeId FROM t_mostype_facility x WHERE CountryId = $countryId AND FLevelId = $fLevelId  AND (MosTypeId = $mosTypeId OR $mosTypeId = 0) AND a.MOS >= x.MinMos AND a.MOS < x.MaxMos) MosTypeId
    				FROM t_cfm_stockstatus a, t_itemlist b,  t_cfm_masterstockstatus c
    				WHERE a.itemno = b.itemno AND a.MOS IS NOT NULL AND a.MonthId = " . $_REQUEST['MonthId'] . " AND a.Year = '" . $_REQUEST['YearId'] . "' AND a.CountryId = " . $_REQUEST['CountryId'] . " AND a.FacilityId = " . $_REQUEST['FacilityId'] . " AND a.ItemGroupId = " . $_REQUEST['ItemGroupId'] . " AND a.CFMStockId = c.CFMStockId" . " AND c.StatusId = 5 " . ") p
    				WHERE (p.MosTypeId = $mosTypeId OR $mosTypeId = 0) 
    				ORDER BY ItemName";
    */
    if ($ownerTypeId == 1 || $ownerTypeId == 2) {
        $sQuery = "SELECT p.MosTypeId, ItemName, MOS ,ClStock,AMC FROM (SELECT\n\t\t\t\t    a.ItemNo, b.ItemName, a.MOS ,a.ClStock,a.AMC\n\t\t\t\t,(SELECT MosTypeId FROM t_mostype_facility x WHERE CountryId = {$countryId} \n                AND FLevelId = {$fLevelId}  AND (MosTypeId = {$mosTypeId} OR {$mosTypeId} = 0) \n                AND a.MOS >= x.MinMos AND a.MOS < x.MaxMos ) MosTypeId\n\t\t\t\tFROM t_cfm_stockstatus a, t_itemlist b,  t_cfm_masterstockstatus c, t_facility g\n\t\t\t\tWHERE a.itemno = b.itemno AND a.MOS IS NOT NULL AND a.MonthId = " . $MonthId . " \n                AND a.Year = '" . $YearId . "' AND a.CountryId = " . $countryId . " \n                AND a.FacilityId = " . $FacilityId . " AND a.ItemGroupId = " . $ItemGroupId . "\n                AND a.CFMStockId = c.CFMStockId" . " AND c.StatusId = 5 " . "\n                AND a.FacilityId=g.FacilityId \n                AND g.OwnerTypeId = {$ownerTypeId} \n                AND  (g.RegionId = {$regionId} OR {$regionId} = 0)\n                AND (g.DistrictId = {$districtId} OR {$districtId} = 0)\n                 ) p\n                \n\t\t\t\tWHERE (p.MosTypeId = {$mosTypeId} OR {$mosTypeId} = 0) \n\t\t\t\tORDER BY ItemName";
    } else {
        $sQuery = "SELECT p.MosTypeId, ItemName, MOS ,ClStock,AMC FROM (SELECT\n\t\t\t\t    a.ItemNo, b.ItemName, a.MOS ,a.ClStock,a.AMC\n\t\t\t\t,(SELECT MosTypeId FROM t_mostype_facility x WHERE CountryId = {$countryId} \n                AND FLevelId = {$fLevelId}  AND (MosTypeId = {$mosTypeId} OR {$mosTypeId} = 0) \n                AND a.MOS >= x.MinMos AND a.MOS < x.MaxMos ) MosTypeId\n\t\t\t\tFROM t_cfm_stockstatus a, t_itemlist b,  t_cfm_masterstockstatus c, t_facility g\n\t\t\t\tWHERE a.itemno = b.itemno AND a.MOS IS NOT NULL AND a.MonthId = " . $MonthId . " \n                AND a.Year = '" . $YearId . "' AND a.CountryId = " . $countryId . " \n                AND a.FacilityId = " . $FacilityId . " AND a.ItemGroupId = " . $ItemGroupId . "\n                AND a.CFMStockId = c.CFMStockId" . " AND c.StatusId = 5 " . "\n                AND a.FacilityId=g.FacilityId\n                AND g.AgentType = {$ownerTypeId} \n                AND  (g.RegionId = {$regionId} OR {$regionId} = 0)\n                AND (g.DistrictId = {$districtId} OR {$districtId} = 0) ) p\n                \n\t\t\t\tWHERE (p.MosTypeId = {$mosTypeId} OR {$mosTypeId} = 0) \n\t\t\t\tORDER BY ItemName";
    }
    //echo $sQuery;
    mysql_query("SET character_set_results=utf8");
    $rResult = mysql_query($sQuery);
    $aData = array();
    $total = mysql_num_rows($rResult);
    if ($total > 0) {
        while ($row = mysql_fetch_array($rResult)) {
            $tmpRow = array();
            /*	foreach ($output1 as $rowMosType) {
            			if ($rowMosType['MosTypeId'] == $row['MosTypeId']) {
            				//$tmpRow[] = '<span class="glyphicon glyphicon-ok-circle" style="color:' . $rowMosType['ColorCode'] . ';font-size:2em;"></span>';
            				$tmpRow[] = '<i class="fa fa-check-circle fa-lg" style="color:' . $rowMosType['ColorCode'] . ';font-size:2.5em;"></i>';
            
            			} else
            				$tmpRow[] = '';
            		}
            		array_unshift($tmpRow, $row['ItemName'], number_format($row['MOS'], 1));
            		$aData[] = $tmpRow;*/
            $col .= '<tr style="page-break-inside:avoid;">
			           <td>' . $row['ItemName'] . '</td>
					   <td>' . $row['ClStock'] . '</td>
					   <td>' . $row['AMC'] . '</td>
//.........这里部分代码省略.........
开发者ID:sankam-nikolya,项目名称:lptt,代码行数:101,代码来源:r_facility_inventory_control_pdf.php

示例13: generateFacilityReport

function generateFacilityReport($conn)
{
    global $gTEXT;
    require_once 'tcpdf/tcpdf.php';
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    $pdf->SetPrintHeader(false);
    $pdf->SetPrintFooter(false);
    $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
    $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
    $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
    $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
        require_once dirname(__FILE__) . '/lang/eng.php';
        $pdf->setLanguageArray($l);
    }
    $pdf->setFontSubsetting(false);
    $pdf->AddPage();
    $pdf->SetFillColor(255, 255, 255);
    $monthId = $_POST['MonthId'];
    $year = $_POST['Year'];
    $country = $_POST['CountryId'];
    // $itemGroupId=$_POST['ItemGroupId'];
    $CountryName = $_POST['CountryName'];
    $MonthName = $_POST['MonthName'];
    $ItemGroupName = $_POST['ItemGroupName'];
    $regionId = $_POST['RegionId'];
    $RegionName = $_POST['RegionName'];
    $districtId = $_POST['DistrictId'];
    $DistrictName = $_POST['DistrictName'];
    $ownerTypeId = $_POST['OwnerTypeId'];
    $OwnerTypeName = $_POST['OwnerTypeName'];
    $condition = "";
    if ($regionId) {
        $condition .= " and  x.RegionId = {$regionId} ";
    }
    if ($districtId) {
        $condition .= " and x.DistrictId = {$districtId} ";
    }
    if ($ownerTypeId) {
        $condition .= " and  x.OwnerTypeId = {$ownerTypeId} ";
    }
    $aColumns = array('SL', 'FacilityCode', 'FacilityName', 'bEntered', 'CreatedDt', 'bSubmitted', 'LastSubmittedDt', 'bAccepted', 'AcceptedDt', 'bPublished', 'PublishedDt');
    $sIndexColumn = "FacilityId";
    $sTable = "t_cfm_masterstockstatus";
    $sLimit = "limit 300";
    if (isset($_POST['iDisplayStart']) && $_POST['iDisplayLength'] != '-1') {
        $sLimit = "LIMIT " . intval($_POST['iDisplayStart']) . ", " . intval($_POST['iDisplayLength']);
    }
    $sOrder = "";
    if (isset($_POST['iSortCol_0'])) {
        $sOrder = "ORDER BY  ";
        for ($i = 0; $i < intval($_POST['iSortingCols']); $i++) {
            if ($_POST['bSortable_' . intval($_POST['iSortCol_' . $i])] == "true") {
                $sOrder .= "`" . $aColumns[intval($_POST['iSortCol_' . $i])] . "` " . ($_POST['sSortDir_' . $i] === 'asc' ? 'asc' : 'desc') . ", ";
            }
        }
        $sOrder = substr_replace($sOrder, "", -2);
        if ($sOrder == "ORDER BY") {
            $sOrder = "";
        }
    }
    /*$sWhere="";
    	for ($i = 0; $i < count($aColumns); $i++) {
    		
    		if (isset($_POST['bSearchable_' . $i]) && $_POST['bSearchable_' . $i] == "true" && $_POST['sSearch'] != '') {
    			
    			if ($sWhere == "") {
    				$sWhere = "WHERE ";
    			} else {
    				$sWhere .= " OR ";
    			}
    			$sWhere .= "`" . $aColumns[$i] . "` LIKE '%" . mysql_real_escape_string($_POST['sSearch']) . "%' ";
    		}
    	}*/
    $sWhere = "";
    if ($_POST['sSearch'] != "") {
        $sWhere = " WHERE (b.FacilityCode LIKE '%" . mysql_real_escape_string($_POST['sSearch']) . "%'\n        OR " . " b.FacilityName LIKE '%" . mysql_real_escape_string($_POST['sSearch']) . "%' )";
    }
    safe_query("SET @rank=0;");
    $serial = "@rank:=@rank+1 AS SL";
    $sQuery = "SELECT SQL_CALC_FOUND_ROWS " . $serial . ", b.FacilityId, b.FacilityCode, b.FacilityName,\n\t\t\t\tIFNULL( a.FacilityId,0) bEntered,\t\t\t\t\n\t\t\t\tDATE_FORMAT(a.CreatedDt, '%d-%b-%Y %h:%i %p') CreatedDt,\t\n\t\t\t\tIF(c.StatusId = '2', '1', '0') bSubmitted,\n\t\t\t\tDATE_FORMAT(a.LastSubmittedDt, '%d-%b-%Y %h:%i %p')  LastSubmittedDt,\n\t\t\t\tIF(c.StatusId = '3', '1', '0') bAccepted,\n\t\t\t\tDATE_FORMAT(a.AcceptedDt, '%d-%b-%Y %h:%i %p')  AcceptedDt,\n\t\t\t\tIF(c.StatusId = '5', '1', '0') bPublished,\n\t\t\t\tDATE_FORMAT(a.PublishedDt, '%d-%b-%Y %h:%i %p')  PublishedDt\n\t\t\t\tFROM  t_cfm_masterstockstatus a \n\t\t\t\tRIGHT JOIN (SELECT x.FacilityId, x.FacilityCode, x.FacilityName \n\t\t\t\tFROM t_facility x \n\t\t\t\tWHERE x.CountryId = {$country}  {$condition}) b\n\t\t\t\tON a.FacilityId = b.FacilityId AND  MonthId = {$monthId} \n\t\t\t\tAND Year = '{$year}' AND a.CountryId = {$country} \n\t\t\t\tLEFT JOIN t_status c ON a.StatusId = c.StatusId \n\t\t\t\t{$sWhere}\n\t\t\t\t{$sOrder};";
    mysql_query("SET character_set_results=utf8");
    $r = safe_query($sQuery);
    $total = mysql_num_rows($r);
    $h = 1;
    $col = '';
    $i = 1;
    if ($total > 0) {
        $h = 1;
        while ($rec = mysql_fetch_array($r)) {
            $narr = array();
            for ($i = 0; $i < count($aColumns); $i++) {
                if ($aColumns[$i] == "bEntered") {
                    $narr[] = $rec[$aColumns[$i]] == "0" ? '<span class="label label-danger"> No </span>' : '<span class="label label-success"> Yes </span>';
                } else {
                    if ($aColumns[$i] == "bSubmitted") {
                        $narr[] = $rec[$aColumns[$i]] == "0" ? '<span class="label label-danger"> No </span>' : '<span class="label label-success"> Yes </span>';
                    } else {
                        if ($aColumns[$i] == "bAccepted") {
//.........这里部分代码省略.........
开发者ID:sankam-nikolya,项目名称:lptt,代码行数:101,代码来源:r_facility_reporting_status_pdf.php

示例14: TCPDF

<?php

$footer = "ważna do <b>" . file_get_contents("config/data.txt") . "</b>";
require_once 'lib/tcpdf.php';
$pdf = new TCPDF("P", "mm", "A4");
$pdf->SetCreator("Legitk(s)i");
$pdf->SetFontSubsetting(false);
$pdf->SetPrintFooter(false);
$pdf->SetPrintHeader(false);
$pdf->SetAutoPageBreak(TRUE, 0);
/* SIZE CONFIG - in mm */
$leftMargin = 5;
$topMargin = 5;
$cellsPerPage = 10;
$cellWidth = 80;
$cellHeight = 50;
//$cellWidth=85; $cellHeight=54; //<-- -1mm for border (A4 is 297mm heigh)
$cellWidth = 78;
$cellHeight = 49;
$handle = fopen("config/ludzie.txt", "r");
if ($handle) {
    $i = -1;
    while (($line = fgets($handle)) !== false) {
        $i = ($i + 1) % $cellsPerPage;
        if ($i == 0) {
            //page change
            $x = $leftMargin;
            $y = $topMargin;
            $pdf->AddPage();
        }
        if ($i % 2 == 0) {
开发者ID:KSIUJ,项目名称:legitksi,代码行数:31,代码来源:legitksi.php

示例15: TCPDF

 function project_details($customer_file_id)
 {
     $this->load->library('Pdf');
     $this->load->model(array('payment_schedule_customer_model', 'receipt_model', 'discount_model'));
     $this->db->select('contact.name as customer_name,project.name as project_name,availability_chart_unit.unit_name as unit_name,' . 'customer_file.purchase_cost,customer_file.area,customer_file.rate');
     $this->db->from('customer_file');
     $this->db->join('contact', 'customer_file.customer_id=contact.id');
     $this->db->join('project', 'project.id=customer_file.project_id');
     $this->db->join('availability_chart_unit', 'availability_chart_unit.id=customer_file.unit_id');
     $this->db->where('customer_file.id', $customer_file_id);
     $project_details = $this->db->get()->first_row();
     //        print_r($project_details);exit(0);
     $land_cost = $this->db->select('cost')->where(array('customer_file_id' => $customer_file_id, 'cost_head_id' => '14'))->get('customer_file_unit_costing')->first_row();
     $this->db->select('company.name,company.address,project.project_type');
     $this->db->from('company');
     $this->db->join('project', 'project.company_id=company.id');
     $this->db->join('customer_file', 'customer_file.project_id=project.id');
     $this->db->where('customer_file.id', $customer_file_id);
     $company_details = $this->db->get()->first_row();
     $crm_settings = $this->db->get('crm_settings')->first_row();
     $pdf = new TCPDF('P', PDF_UNIT, 'A4', true, 'UTF-8', false);
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetTitle('Receipt');
     //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, '', '', array(0, 64, 255), array(255, 255, 255));
     $pdf->SetPrintFooter(false);
     $pdf->setPrintHeader(false);
     //$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     //$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     //$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     //$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
         require_once dirname(__FILE__) . '/lang/eng.php';
         $pdf->setLanguageArray($l);
     }
     $pdf->setFontSubsetting(true);
     $pdf->SetFont('dejavusans', '', 8, '', true);
     $pdf->AddPage();
     $pdf->writeHTMLCell(211, 17, '0', 10, '<h2 style="text-align:center;">' . $company_details->name . '</h2>', 0, 1, 0, true, '', true);
     $pdf->writeHTMLCell(211, 12, '0', 15, '<p style="text-align:center;">' . $company_details->address . '</p>', 0, 1, 0, true, '', true);
     $pdf->writeHTMLCell(211, 8, '0', 20, '<p style="text-align:center;">' . 'www.olivebuilder.com' . '</p>', 0, 1, 0, true, '', true);
     $style = array('width' => 0.1, 'color' => array(0, 0, 0));
     $pdf->Line(0, 25, 220, 25, $style);
     $pdf->writeHTMLCell(0, 0, '', '', '<h2 style="text-align:center;"> WWF Report </h2>', 0, 1, 0, true, '', true);
     $style = array('width' => 0.1, 'color' => array(0, 0, 0));
     $pdf->Line(0, 35, 220, 35, $style);
     $html = '<br /><br />';
     $html .= '<table cellpadding="5" ><tr><td width="448"><strong> Customer Name : </strong>' . $project_details->customer_name . '</td>';
     $html .= '<td><strong> Date :</strong> ' . date('m-d-Y') . '</td></tr>';
     $html .= '<tr><td><strong> Project  :</strong> ' . $project_details->project_name . '</td>';
     if ($company_details->project_type == 1) {
         $html .= '<td><strong> Flat No :</strong> ' . $project_details->unit_name . '</td></tr>';
     } else {
         $html .= '<td><strong> Villa No :</strong> ' . $project_details->unit_name . '</td></tr>';
     }
     $html .= '<tr><td></td><td><td/></tr></table><br /><br />';
     $html .= '<table  cellpadding="5" align="center" border="1"><tr><td width="35%"><strong> Construction Cost :</strong> ' . ($project_details->purchase_cost - $land_cost->cost) . '</td>';
     $html .= '<td width="35%"><strong> Land Cost :</strong> ' . round($land_cost->cost) . '</td>';
     $html .= '<td width="35%"><strong> Purchase Cost :</strong> ' . round($project_details->purchase_cost) . '</td></tr></table><br />';
     $html .= '<br /><br />';
     $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
     $pdf->Output('receipt.pdf', 'I');
 }
开发者ID:EasysoftTechnologies,项目名称:zimp,代码行数:66,代码来源:generate_pdf.php


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