本文整理汇总了PHP中TCPDF::Line方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF::Line方法的具体用法?PHP TCPDF::Line怎么用?PHP TCPDF::Line使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCPDF
的用法示例。
在下文中一共展示了TCPDF::Line方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPdfOutput
public function testPdfOutput()
{
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 012');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// disable header and footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
$pdf->setLanguageArray($this->langSettings);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 10);
// add a page
$pdf->AddPage();
$style = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,20,5,10', 'phase' => 10, 'color' => array(255, 0, 0));
$style2 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0));
$style3 = array('width' => 1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,10', 'color' => array(255, 0, 0));
$style4 = array('L' => 0, 'T' => array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => '20,10', 'phase' => 10, 'color' => array(100, 100, 255)), 'R' => array('width' => 0.5, 'cap' => 'round', 'join' => 'miter', 'dash' => 0, 'color' => array(50, 50, 127)), 'B' => array('width' => 0.75, 'cap' => 'square', 'join' => 'miter', 'dash' => '30,10,5,10'));
$style5 = array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 64, 128));
$style6 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,10', 'color' => array(0, 128, 0));
$style7 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 128, 0));
// Line
$pdf->Text(5, 4, 'Line examples');
$pdf->Line(5, 10, 80, 30, $style);
$pdf->Line(5, 10, 5, 30, $style2);
$pdf->Line(5, 10, 80, 10, $style3);
// Rect
$pdf->Text(100, 4, 'Rectangle examples');
$pdf->Rect(100, 10, 40, 20, 'DF', $style4, array(220, 220, 200));
$pdf->Rect(145, 10, 40, 20, 'D', array('all' => $style3));
// Curve
$pdf->Text(5, 34, 'Curve examples');
$pdf->Curve(5, 40, 30, 55, 70, 45, 60, 75, null, $style6);
$pdf->Curve(80, 40, 70, 75, 150, 45, 100, 75, 'F', $style6);
$pdf->Curve(140, 40, 150, 55, 180, 45, 200, 75, 'DF', $style6, array(200, 220, 200));
// Circle and ellipse
$pdf->Text(5, 79, 'Circle and ellipse examples');
$pdf->SetLineStyle($style5);
$pdf->Circle(25, 105, 20);
$pdf->Circle(25, 105, 10, 90, 180, null, $style6);
$pdf->Circle(25, 105, 10, 270, 360, 'F');
$pdf->Circle(25, 105, 10, 270, 360, 'C', $style6);
$pdf->SetLineStyle($style5);
$pdf->Ellipse(100, 103, 40, 20);
$pdf->Ellipse(100, 105, 20, 10, 0, 90, 180, null, $style6);
$pdf->Ellipse(100, 105, 20, 10, 0, 270, 360, 'DF', $style6);
$pdf->SetLineStyle($style5);
$pdf->Ellipse(175, 103, 30, 15, 45);
$pdf->Ellipse(175, 105, 15, 7.5, 45, 90, 180, null, $style6);
$pdf->Ellipse(175, 105, 15, 7.5, 45, 270, 360, 'F', $style6, array(220, 200, 200));
// Polygon
$pdf->Text(5, 129, 'Polygon examples');
$pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
$pdf->Polygon(array(5, 135, 45, 135, 15, 165));
$pdf->Polygon(array(60, 135, 80, 135, 80, 155, 70, 165, 50, 155), 'DF', array($style6, $style7, $style7, 0, $style6), array(220, 200, 200));
$pdf->Polygon(array(120, 135, 140, 135, 150, 155, 110, 155), 'D', array($style6, 0, $style7, $style6));
$pdf->Polygon(array(160, 135, 190, 155, 170, 155, 200, 160, 160, 165), 'DF', array('all' => $style6), array(220, 220, 220));
// Polygonal Line
$pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 164)));
$pdf->PolyLine(array(80, 165, 90, 160, 100, 165, 110, 160, 120, 165, 130, 160, 140, 165), 'D', array(), array());
// Regular polygon
$pdf->Text(5, 169, 'Regular polygon examples');
$pdf->SetLineStyle($style5);
$pdf->RegularPolygon(20, 190, 15, 6, 0, 1, 'F');
$pdf->RegularPolygon(55, 190, 15, 6);
$pdf->RegularPolygon(55, 190, 10, 6, 45, 0, 'DF', array($style6, 0, $style7, 0, $style7, $style7));
$pdf->RegularPolygon(90, 190, 15, 3, 0, 1, 'DF', array('all' => $style5), array(200, 220, 200), 'F', array(255, 200, 200));
$pdf->RegularPolygon(125, 190, 15, 4, 30, 1, null, array('all' => $style5), null, null, $style6);
$pdf->RegularPolygon(160, 190, 15, 10);
// Star polygon
$pdf->Text(5, 209, 'Star polygon examples');
$pdf->SetLineStyle($style5);
$pdf->StarPolygon(20, 230, 15, 20, 3, 0, 1, 'F');
$pdf->StarPolygon(55, 230, 15, 12, 5);
$pdf->StarPolygon(55, 230, 7, 12, 5, 45, 0, 'DF', array('all' => $style7), array(220, 220, 200), 'F', array(255, 200, 200));
$pdf->StarPolygon(90, 230, 15, 20, 6, 0, 1, 'DF', array('all' => $style5), array(220, 220, 200), 'F', array(255, 200, 200));
$pdf->StarPolygon(125, 230, 15, 5, 2, 30, 1, null, array('all' => $style5), null, null, $style6);
$pdf->StarPolygon(160, 230, 15, 10, 3);
$pdf->StarPolygon(160, 230, 7, 50, 26);
// Rounded rectangle
$pdf->Text(5, 249, 'Rounded rectangle examples');
$pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
$pdf->RoundedRect(5, 255, 40, 30, 3.5, '1111', 'DF');
$pdf->RoundedRect(50, 255, 40, 30, 6.5, '1000');
$pdf->RoundedRect(95, 255, 40, 30, 10.0, '1111', null, $style6);
$pdf->RoundedRect(140, 255, 40, 30, 8.0, '0101', 'DF', $style6, array(200, 200, 200));
//.........这里部分代码省略.........
示例2: prepareRowAsPdf
/**
* Adds to the TCPDF instance, the data related to a row in the GIS dataset.
*
* @param string $spatial GIS MULTILINESTRING object
* @param string $label Label for the GIS MULTILINESTRING object
* @param string $line_color Color for the GIS MULTILINESTRING object
* @param array $scale_data Array containing data related to scaling
* @param TCPDF $pdf TCPDF instance
*
* @return TCPDF the modified TCPDF instance
* @access public
*/
public function prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf)
{
/** @var PMA_String $pmaString */
$pmaString = $GLOBALS['PMA_String'];
// allocate colors
$red = hexdec($pmaString->substr($line_color, 1, 2));
$green = hexdec($pmaString->substr($line_color, 3, 2));
$blue = hexdec($pmaString->substr($line_color, 4, 2));
$line = array('width' => 1.5, 'color' => array($red, $green, $blue));
// Trim to remove leading 'MULTILINESTRING((' and trailing '))'
$multilinestirng = $pmaString->substr($spatial, 17, $pmaString->strlen($spatial) - 19);
// Separate each linestring
$linestirngs = explode("),(", $multilinestirng);
$first_line = true;
foreach ($linestirngs as $linestring) {
$points_arr = $this->extractPoints($linestring, $scale_data);
foreach ($points_arr as $point) {
if (!isset($temp_point)) {
$temp_point = $point;
} else {
// draw line section
$pdf->Line($temp_point[0], $temp_point[1], $point[0], $point[1], $line);
$temp_point = $point;
}
}
unset($temp_point);
// print label
if (isset($label) && trim($label) != '' && $first_line) {
$pdf->SetXY($points_arr[1][0], $points_arr[1][1]);
$pdf->SetFontSize(5);
$pdf->Cell(0, 0, trim($label));
}
$first_line = false;
}
return $pdf;
}
示例3: drawLine
/**
* @param float|string $x1
* @param float|string $y1
* @param float|string $x2
* @param float|string $y2
* @param array $attrs {
* @option string|null "stroke_width" required
* @option string|null "stroke_color" required
* @option string "stroke_dash" required
* }
* @see http://www.tcpdf.org/doc/code/classTCPDF.html
*/
public function drawLine($x1, $y1, $x2, $y2, array $attrs = array())
{
$style = $this->buildGraphicStyles($attrs);
if ($style['stroke'] === null) {
return;
}
$this->pdf->Line($x1, $y1, $x2, $y2, $style['stroke']);
}
示例4: line
/**
* Draws a line from x1,y1 to x2,y2
*
* See {@link Style::munge_color()} for the format of the color array.
* See {@link Cpdf::setLineStyle()} for a description of the format of the
* $style parameter (aka dash).
*
* @param float $x1
* @param float $y1
* @param float $x2
* @param float $y2
* @param array $color
* @param float $width
* @param array $style
*/
function line($x1, $y1, $x2, $y2, $color, $width, $style = array(), $blend = "Normal", $opacity = 1.0)
{
//dompdf_debug("trace", "($x1, $y1, $x2, $y2, [$color[0], $color[1], $color[2]], $width, $style, $blend, $opacity)");
//$this->_set_stroke_color($color);
//$this->_set_line_style($width, "butt", "", $style);
$this->_set_line_transparency($blend, $opacity);
$this->_pdf->Line($x1, $y1, $x2, $y2, $this->_make_line_style($color, $width, "butt", "", $style));
}
示例5: line
/**
* Draws a line from x1,y1 to x2,y2
*
* See {@link Style::munge_color()} for the format of the color array.
* See {@link Cpdf::setLineStyle()} for a description of the format of the
* $style parameter (aka dash).
*
* @param float $x1
* @param float $y1
* @param float $x2
* @param float $y2
* @param array $color
* @param float $width
* @param array $style
*/
function line($x1, $y1, $x2, $y2, $color, $width, $style = array(), $blend = "Normal", $opacity = 1.0)
{
dompdf_debug("trace", "({$x1}, {$y1}, {$x2}, {$y2}, [{$color['0']}, {$color['1']}, {$color['2']}], {$width}, {$style}, {$blend}, {$opacity})");
//$this->_set_stroke_color($color);
//$this->_set_line_style($width, "butt", "", $style);
$this->_set_line_transparency($blend, $opacity);
$this->_pdf->Line($x1, $y1, $x2, $y2, $this->_make_line_style($color, $width, "butt", "", $style));
}
示例6: index
function index()
{
$this->load->model(array('payment_schedule_customer_model', 'receipt_model'));
$this->load->library('form_validation');
$this->load->model(array('user_model', 'project_model'));
$this->load->helper('csv');
$this->load->helper('download');
$data['sales_persons'] = $this->user_model->list_by_department(2);
$this->form_validation->set_rules('from_date', 'From date', 'trim|required');
$this->form_validation->set_rules('to_date', 'To date', 'trim|required');
if ($this->form_validation->run() == FALSE) {
$data['dues'] = array();
$this->load->view('reports/enquiry_report', $data);
} else {
$dues = array();
$sales_person_selected = $this->input->post('sales_person');
$from_date_db = $this->input->post('from_date');
$from_date_db = date('Y-m-d', strtotime($from_date_db));
$to_date_db = $this->input->post('to_date');
$to_date_db = date('Y-m-d', strtotime($to_date_db));
$enquiry_report = array();
$this->db->select('lead.id, lead.max_budgect,contact.name,' . 'project.name as project,lead.lead_source,customer_rating.name as rating,' . 'contact.phone,contact.phone_2,contact.phone_3,contact.email,contact.email_2,' . 'lead.date, lead.preferred_location, lead.looking_for,' . 'user.full_name as sales_person,sales_stage.name as sales_stage');
$this->db->from('lead');
$this->db->join('contact', ' lead.contact_id=contact.id');
$this->db->join('project', ' lead.interested_project=project.id');
$this->db->join('user', 'user.id= lead.lead_owner', 'left');
$this->db->join('sales_stage', 'sales_stage.id= lead.sales_stage', 'left');
$this->db->join('customer_rating', 'customer_rating.id= lead.rating', 'left');
if (!empty($sales_person_selected)) {
$this->db->where('lead.lead_owner', $sales_person_selected);
}
$this->db->where('lead.date >=', $from_date_db);
$this->db->where('lead.date <=', $to_date_db);
$customers = $this->db->get()->result();
foreach ($customers as $customer) {
$enquiry_report[$customer->id] = array();
$enquiry_report[$customer->id]['date'] = $customer->date;
$enquiry_report[$customer->id]['lead_owner'] = $customer->sales_person;
$enquiry_report[$customer->id]['prospect_name'] = $customer->name;
$enquiry_report[$customer->id]['project'] = $customer->project;
$enquiry_report[$customer->id]['max_budgect'] = $customer->max_budgect;
$enquiry_report[$customer->id]['lead_source'] = $customer->lead_source;
$enquiry_report[$customer->id]['rating'] = $customer->rating;
$enquiry_report[$customer->id]['sales_stage'] = $customer->sales_stage;
$enquiry_report[$customer->id]['follow_ups'] = $this->db->where('lead_id', $customer->id)->count_all_results(' interaction');
$lead_id = $customer->id;
$total_due_amount = 0;
}
//print_r($enquiry_report);
//exit();
if (isset($_POST['generate_pdf'])) {
$this->load->library('Pdf');
$this->db->select('company.name');
$this->db->from('company');
$company_details = $this->db->get()->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', '', 7, '', true);
$pdf->AddPage();
$pdf->writeHTMLCell(211, 17, '0', 10, '<h2 style="text-align:center;">' . $company_details->name . '</h2>', 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;">Sales Report</h2>', 0, 1, 0, true, '', true);
$style = array('width' => 0.1, 'color' => array(0, 0, 0));
$pdf->Line(0, 35, 220, 35, $style);
$pdf->writeHTMLCell(50, 0, 10, 40, '<strong style="text-align:center;">Period : ' . date('M Y', strtotime($from_date_db)) . ' - ' . date('M Y', strtotime($to_date_db)) . '</strong>', 0, 1, 0, true, '', true);
$pdf->writeHTMLCell(35, 0, 168, 40, '<strong style="text-align:center;">Date : ' . date('d-m-Y') . '</strong>', 0, 1, 0, true, '', true);
$html .= '<tr><td></td><td><td/></tr></table><br /><br /><br /><br />';
$html .= '<table border="1" cellpadding="5" cellspacing = "0" width = "100%" nobr="true"><thead><tr>';
$html .= '<th width="30">No.</th>';
$html .= '<th width="65">Date</th>';
$html .= '<th width="75">Lead Owner</th>';
$html .= '<th width="65">Prospect Name</th>';
$html .= '<th width="65">Interested Project</th>';
$html .= '<th width="65">Budget</th>';
$html .= '<th width="65">Lead Source</th>';
$html .= '<th width="65">Rating</th>';
$html .= '<th width="65">Sales Stage</th>';
$html .= '<th width="65">Follow Ups</th>';
$html .= '</tr>';
$html .= '</thead><tbody>';
foreach ($enquiry_report as $due) {
$html .= '<tr>';
//.........这里部分代码省略.........
示例7: array
$pdf->Cell(30, 0, 'Center-Top', 1, $ln = 0, 'C', 0, '', 0, false, 'C', 'T');
$pdf->Cell(30, 0, 'Bottom-Top', 1, $ln = 0, 'C', 0, '', 0, false, 'B', 'T');
$pdf->Cell(30, 0, 'Ascent-Top', 1, $ln = 0, 'C', 0, '', 0, false, 'A', 'T');
$pdf->Cell(30, 0, 'Baseline-Top', 1, $ln = 0, 'C', 0, '', 0, false, 'L', 'T');
$pdf->Cell(30, 0, 'Descent-Top', 1, $ln = 0, 'C', 0, '', 0, false, 'D', 'T');
$pdf->SetXY(15, 120);
// text on bottom
$pdf->Cell(30, 0, 'Top-Bottom', 1, $ln = 0, 'C', 0, '', 0, false, 'T', 'B');
$pdf->Cell(30, 0, 'Center-Bottom', 1, $ln = 0, 'C', 0, '', 0, false, 'C', 'B');
$pdf->Cell(30, 0, 'Bottom-Bottom', 1, $ln = 0, 'C', 0, '', 0, false, 'B', 'B');
$pdf->Cell(30, 0, 'Ascent-Bottom', 1, $ln = 0, 'C', 0, '', 0, false, 'A', 'B');
$pdf->Cell(30, 0, 'Baseline-Bottom', 1, $ln = 0, 'C', 0, '', 0, false, 'L', 'B');
$pdf->Cell(30, 0, 'Descent-Bottom', 1, $ln = 0, 'C', 0, '', 0, false, 'D', 'B');
// draw some reference lines
$linestyle = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(255, 0, 0));
$pdf->Line(15, 60, 195, 60, $linestyle);
$pdf->Line(15, 90, 195, 90, $linestyle);
$pdf->Line(15, 120, 195, 120, $linestyle);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Print an image to explain cell measures
$pdf->Image('images/tcpdf_cell.png', 15, 160, 100, 100, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false);
$legend = 'LEGEND:
X: cell x top-left origin (top-right for RTL)
Y: cell y top-left origin (top-right for RTL)
CW: cell width
CH: cell height
LW: line width
NRL: normal line position
EXT: external line position
INT: internal line position
示例8: date
function final_bill($customer_file_id)
{
$this->load->library('form_validation');
$this->form_validation->set_rules('due_date', 'Due Date', 'trim|required');
if ($this->form_validation->run() == FALSE) {
$data['customer_file_id'] = $customer_file_id;
$this->load->view('customer_file/final_bill', $data);
} else {
$due_date = $this->input->post('due_date');
$due_date_db = date('Y-m-d', strtotime($due_date));
$show_payment = $this->input->post('show_payment');
$show_tax = $this->input->post('show_tax');
$show_dpc = $this->input->post('show_dpc');
$show_discount = $this->input->post('show_discount');
$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();
$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,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();
$this->db->select('receipt_split_up.amount as splitup_amount,payment_schedule_customer.installment_name,' . 'payment_schedule_customer.dpc_interest,payment_schedule_customer.dpc_grace_period,' . 'payment_schedule_customer.due_date,payment_schedule_customer.due_amount,receipt.date_payment,' . 'receipt.receipt_number');
$this->db->from('receipt_split_up');
$this->db->join('receipt', 'receipt.id=receipt_split_up.receipt_id');
$this->db->join('payment_schedule_customer', 'payment_schedule_customer.id=receipt_split_up.installment_id');
$this->db->where('payment_schedule_customer.customer_file_id', $customer_file_id);
$this->db->where('receipt_split_up.amount >', 0);
$paid_amout_details = $this->db->get()->result();
$actual_payment_schedule = $this->payment_schedule_customer_model->list_schedule_customer_file_actual($customer_file_id);
$additional_payment_schedule = $this->payment_schedule_customer_model->list_schedule_customer_file_additional($customer_file_id);
$receipts = $this->receipt_model->list_cleared_receipt_customer_file($customer_file_id);
if ($show_discount == 1) {
$discounts = $this->discount_model->list_discount_customer_file($customer_file_id);
$htmldis = '</br /><br /></br /><br /><h3 style="padding: 10px; text-align:center"><u>Discount </u></h3>';
$htmldis .= '<table border="1" cellpadding="5" cellspacing = "0" width = "100%" nobr="true">';
$htmldis .= '<tr><td width="40"><b>No.</b></td><td width="110"><b>Date</b></td><td width="110"><b>Amount</b></td><td width="377"><b>Remarks</b></td></tr>';
$nd = 1;
$total_discount = 0;
foreach ($discounts as $discount) {
$total_discount += $discount->amount;
$htmldis .= '<tr><td>' . $nd . '</td><td>' . date('d-m-Y', strtotime($discount->date)) . '</td>' . '<td>' . number_format($discount->amount) . '</td><td>' . $discount->remarks . '</td></tr>';
$nd++;
}
$htmldis .= '<tr><td></td><td></td><td>' . number_format($total_discount) . '</td><td></td></tr>';
$htmldis .= '</table></br /><br />';
$htmldis .= '<table>';
$htmldis .= '<tr>';
$htmldis .= '<td><strong>Total Discount : </strong>' . number_format($total_discount) . '</td>';
$htmldis .= '</tr>';
$htmldis .= '</table><br /><br />';
}
$this->db->select('tax_type.name,tax_master.id');
$this->db->from('tax_type');
$this->db->join('tax_master', 'tax_master.tax_type_id=tax_type.id');
$this->db->join('customer_file_tax', 'customer_file_tax.tax_id=tax_master.id');
$this->db->where('customer_file_tax.customer_file_id', $customer_file_id);
$customer_tax = $this->db->get()->result();
$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);
$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;">Final Bill </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> ' . $due_date . '</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>';
//.........这里部分代码省略.........
示例9: tax_continuous_type4
public function tax_continuous_type4($id = null, $year = null)
{
if (Session::get('level') != '') {
$y = Input::get('y3');
if ($y != '') {
$year = $y;
$id = 'all';
}
$pdf = new TCPDF();
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$n = DB::select('select * from s_general_data');
foreach ($n as $k) {
$name = $k->name;
$address = $k->address;
$address2 = $k->address2;
$tax_id2 = $k->tax_id2;
$director = $k->director;
}
$sql = ' select concat(n.pname,"",n.fname," ",n.lname) as name, s.cid, s.tax_id,sum(s.salary+s.r_other) as salary, sum(s.r_c) as r_c, sum(s.special_m+s.pts+s.pts2) as special, sum(s.tax) as tax ,sum(s.kbk) as kbk from s_salary_ocsc_detail s left join n_datageneral n on n.cid=s.cid left join n_position_salary p on p.cid=n.cid where s.cid=5350400051484 and year(s.order_date)=' . $year . ' group by s.cid order by n.datainfoID asc ';
$result = DB::select($sql);
foreach ($result as $key) {
$pdf->AddPage('P', 'A4');
$pdf->SetFont('freeserif', 'B', 11, '', true);
$pdf->MultiCell(185, 5, 'เลขที่ งป. ........................./ ' . ($year == 'null' ? $this->yearThai() : $year + 543), 0, 'R', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 16, '', true);
$pdf->SetY(25);
$pdf->SetX(18);
$pdf->MultiCell(177, 5, 'หนังสือรับรองการหักภาษี ณ ที่จ่าย', 0, 'C', 0, 1, '', '', true);
$pdf->SetY(34);
$pdf->SetX(18);
$pdf->MultiCell(177, 5, 'ตามมาตรา 50 ทวิ แห่งประมวลรัษฎากร', 0, 'C', 0, 1, '', '', true);
//===== แนวตั้ง =====//
$linever1 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(18, 190, 18, 50, $linever1);
$linever2 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(80, 190, 80, 50, $linever2);
$linever3 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(110, 190, 110, 50, $linever3);
$linever4 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(135, 190, 135, 50, $linever4);
$linever5 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(165, 190, 165, 50, $linever5);
$linever6 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(195, 190, 195, 50, $linever6);
//===== แนวนอน =====//
$linetop = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(18, 50, 195, 50, $linetop);
$linetop2 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(80, 63, 195, 63, $linetop2);
$linetop3 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(18, 120, 80, 120, $linetop3);
$linetop4 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(80, 180, 195, 180, $linetop4);
$linetop5 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(18, 190, 195, 190, $linetop5);
//======= text in box 1 ========//
$pdf->SetFont('freeserif', '', 13, '', true);
$pdf->SetY(52);
$pdf->SetX(19);
$pdf->MultiCell(62, 5, 'ชื่อและที่อยู่ของผู้มีหน้าที่หักภาษี ณ ที่จ่าย บุคคลคณะบุคคล นิติบุคคล ส่วนราชการ องค์การ รัฐวิสาหกิจ ฯลฯ ', 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 13, '', true);
$pdf->SetY(82);
$pdf->SetX(19);
$pdf->MultiCell(62, 5, $address2, 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 13, '', true);
$pdf->SetY(105);
$pdf->SetX(19);
$pdf->MultiCell(40, 5, $tax_id2, 0, 'L', 0, 1, '', '', true);
//======= text in box 2 ========//
$pdf->SetFont('freeserif', '', 13, '', true);
$pdf->SetY(122);
$pdf->SetX(19);
$pdf->MultiCell(62, 5, 'ชื่อและที่อยู่ของผู้ถูกหักภาษี ณ ที่จ่าย', 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 12, '', true);
$pdf->SetY(137);
$pdf->SetX(21);
$pdf->MultiCell(59, 5, $key->name, 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', '', 13, '', true);
$pdf->SetY(145);
$pdf->SetX(19);
$pdf->MultiCell(62, 5, $address, 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 13, '', true);
$pdf->SetY(165);
$pdf->SetX(19);
$pdf->MultiCell(62, 5, 'เลขประจำตัวผู้เสียภาษีของผู้ถูกหักภาษี ณ ที่จ่าย', 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', '', 12, '', true);
$pdf->SetY(178);
$pdf->SetX(22);
$pdf->MultiCell(62, 5, $key->cid, 0, 'L', 0, 1, '', '', true);
//======= text in box 3 header content ========//
$pdf->SetFont('freeserif', 'B', 13, '', true);
$pdf->SetY(54);
$pdf->SetX(83);
$pdf->MultiCell(32, 5, 'เงินได้ที่จ่าย', 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 13, '', true);
$pdf->SetY(54);
$pdf->SetX(111);
$pdf->MultiCell(32, 5, 'ปีภาษีที่จ่าย', 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 13, '', true);
//.........这里部分代码省略.........
示例10: render
//.........这里部分代码省略.........
$columns['d'][$k2]['w'] = $new_width;
}
}
}
$flag_first_row = false;
// columns
foreach ($all_columns as $k20 => $v20) {
$x = 5;
foreach ($columns['d'] as $k10 => $v10) {
foreach (array('v', 'c', 'a', 'b', 's', 't', 'u') as $v30) {
if (isset($v20['d'][$k10][$v30])) {
$v10[$v30] = $v20['d'][$k10][$v30];
}
}
$new_width = @$v10['w'];
if (!empty($v10['c'])) {
// we need to get width of next elements
for ($i = $k10 + 1; $i < $k10 + $v10['c']; $i++) {
$new_width += $columns['d'][$k10]['w'];
}
}
$align = str_replace(array('left', 'right', 'center'), array('L', 'R', 'C'), @$v10['a']);
if (empty($align)) {
$align = 'L';
}
if (@$v10['b']) {
$pdf->SetFont($this->header['pdf']['font']['family'], 'B', $this->header['pdf']['font']['size']);
} else {
$pdf->SetFont($this->header['pdf']['font']['family'], '', $this->header['pdf']['font']['size']);
}
$pdf->MultiCell($new_width, 5, @$v10['v'], $this->flag_pdf_show_borders, $align, 1, 0, $x, $page_y, true, 0, false, true, 10, 'T');
// underline
if (@$v10['u']) {
$pdf->SetLineStyle(array('width' => 0, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
$pdf->Line($x, $page_y + 5, $x + @$v10['w'], $page_y + 5);
}
$x += @$v10['w'];
}
$page_y += 5;
}
}
$pdf->SetFont($this->header['pdf']['font']['family'], '', $this->header['pdf']['font']['size']);
$x = 5;
foreach ($columns['d'] as $k10 => $v10) {
// we do do render cells if no data
if (isset($v['d'][$k10]['v'])) {
$align = str_replace(array('left', 'right', 'center'), array('L', 'R', 'C'), @$v['d'][$k10]['a']);
if (empty($align)) {
$align = 'L';
}
if (@$v['d'][$k10]['b']) {
$pdf->SetFont($this->header['pdf']['font']['family'], 'B', $this->header['pdf']['font']['size']);
} else {
$pdf->SetFont($this->header['pdf']['font']['family'], '', $this->header['pdf']['font']['size']);
}
// if we override width
$width = $v10['w'];
if (isset($v['d'][$k10]['w'])) {
$width = $v['d'][$k10]['w'];
} else {
if (isset($v['d'][$k10]['c'])) {
// colspan
// we need to get width of next elements
for ($i = $k10 + 1; $i < $k10 + $v['d'][$k10]['c']; $i++) {
$width += @$columns['d'][$i]['w'];
}
示例11: floor
$pdf->MultiCell($lwidth, 0, $cx, 1, 'C', 0, 1, '', '', true);
//dc_YDown(1);
if ($k == 0) {
$lheight += $pdf->getLastH();
}
}
if ($plbcode == 'Y') {
$pl = true;
dc_YDown(1);
$pdf->SetX($x);
$ty1 = $pdf->GetY();
$pdf->write1DBarcode($b['barcode'], 'C39', '', '', $lwidth, 9, 0.4, $style, 'N');
$ty2 = $pdf->GetY();
//$pdf->Line($x,$ty1,$x+$lwidth,$ty1);
//$pdf->Line($x,$ty1,$x,$ty2);
$pdf->Line($x, $ty2, $x + $lwidth, $ty2);
//$pdf->Line($x+60,$ty1,$x+60,$ty2);
if ($k == 0) {
$lheight += 10;
}
}
// End of Print label >>
if ($pl) {
if ($k == 0) {
$k = 1;
$nrow = floor($dcPageH / $lheight);
}
$kol++;
if ($kol == $nkol) {
$kol = 0;
$row++;
示例12: prepareRowAsPdf
/**
* Adds to the TCPDF instance, the data related to a row in the GIS dataset.
*
* @param string $spatial GIS LINESTRING object
* @param string $label Label for the GIS LINESTRING object
* @param string $line_color Color for the GIS LINESTRING object
* @param array $scale_data Array containing data related to scaling
* @param TCPDF $pdf TCPDF instance
*
* @return TCPDF the modified TCPDF instance
* @access public
*/
public function prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf)
{
/** @var PMA_String $pmaString */
$pmaString = $GLOBALS['PMA_String'];
// allocate colors
$red = hexdec($pmaString->substr($line_color, 1, 2));
$green = hexdec($pmaString->substr($line_color, 3, 2));
$blue = hexdec($pmaString->substr($line_color, 4, 2));
$line = array('width' => 1.5, 'color' => array($red, $green, $blue));
// Trim to remove leading 'LINESTRING(' and trailing ')'
$linesrting = $pmaString->substr($spatial, 11, $pmaString->strlen($spatial) - 12);
$points_arr = $this->extractPoints($linesrting, $scale_data);
foreach ($points_arr as $point) {
if (!isset($temp_point)) {
$temp_point = $point;
} else {
// draw line section
$pdf->Line($temp_point[0], $temp_point[1], $point[0], $point[1], $line);
$temp_point = $point;
}
}
// print label
if (isset($label) && trim($label) != '') {
$pdf->SetXY($points_arr[1][0], $points_arr[1][1]);
$pdf->SetFontSize(5);
$pdf->Cell(0, 0, trim($label));
}
return $pdf;
}
示例13: salary_sso_pdf_export
public function salary_sso_pdf_export()
{
$m = Input::get('m_sso_1');
$y = Input::get('y_sso_1');
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetPrintHeader(false);
// set header and footer fonts
$pdf->setHeaderFont(array('freeserif', 'B', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array('freeserif', 'B', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(10, 15, 10);
$pdf->SetHeaderMargin(15);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->SetFont('freeserif', '', 14, '', true);
$n = DB::select('select * from s_general_data');
foreach ($n as $k) {
$name = $k->name;
}
$sql = ' select s.cid, concat(n.pname,"",n.fname," ",n.lname) as name, (s.salary+s.salary_other) as salary, s.salary_sso ';
$sql .= ' from s_salary_detail s';
$sql .= ' left join n_datageneral n on n.cid=s.cid';
$sql .= ' where year(order_date)=' . $y . ' and month(order_date)=' . $m . ' ';
$data = DB::Select($sql);
$j = 0;
$row = 0;
$sum1 = 0;
$sum2 = 0;
foreach ($data as $k) {
$row++;
if ($j == 30) {
$j = 0;
}
if ($j == 0) {
$pdf->AddPage('', 'A4');
//header
$pdf->SetFont('freeserif', '', 12, '', true);
$pdf->SetY(5);
$pdf->SetX(160);
$pdf->MultiCell(40, 5, 'สปส.1-10 (ส่วนที่ 2)', 0, 'R', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 14, '', true);
$pdf->MultiCell(190, 5, 'แบบรายงานการแสดงการส่งเงินสมทบ ', 0, 'C', 0, 1, '', '', true);
$pdf->SetFont('freeserif', '', 13, '', true);
$pdf->SetY(18);
$pdf->MultiCell(190, 5, 'การนำส่งเงินสมทบสำหรับค่าจ้างเดิอน ' . $this->get_monthyearThai($m, $y), 0, 'C', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 13, '', true);
$pdf->SetY(30);
$pdf->SetX(10);
$pdf->MultiCell(40, 5, 'ชื่อสถานประกอบการ ', 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', '', 13, '', true);
$pdf->SetY(30);
$pdf->SetX(50);
$pdf->MultiCell(70, 5, $name, 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 13, '', true);
$pdf->SetY(30);
$pdf->SetX(140);
$pdf->MultiCell(22, 5, 'เลขที่บัญชี', 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', '', 13, '', true);
$pdf->SetY(30);
$pdf->SetX(163);
$pdf->MultiCell(25, 5, '1090000219', 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', 'B', 13, '', true);
$pdf->SetY(36);
$pdf->SetX(140);
$pdf->MultiCell(22, 5, 'สาขา', 0, 'L', 0, 1, '', '', true);
$pdf->SetFont('freeserif', '', 13, '', true);
$pdf->SetY(36);
$pdf->SetX(163);
$pdf->MultiCell(25, 5, '300311', 0, 'L', 0, 1, '', '', true);
$linever = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
$pdf->Line(200, 43, 10, 43, $linever);
$pdf->Line(200, 50, 10, 50, $linever);
$pdf->SetFont('freeserif', '', 13, '', true);
$pdf->SetY(43);
$pdf->SetX(10);
$pdf->MultiCell(20, 7, 'ลำดับที่', 0, 'C', 0, 1, '', '', true);
$pdf->SetY(43);
$pdf->SetX(30);
$pdf->MultiCell(40, 7, 'เลขประจำตัวประชาชน', 0, 'C', 0, 1, '', '', true);
$pdf->SetY(43);
$pdf->SetX(70);
$pdf->MultiCell(70, 7, 'ชื่อ-สกุล', 0, 'C', 0, 1, '', '', true);
$pdf->SetY(43);
$pdf->SetX(140);
$pdf->MultiCell(30, 7, 'ค่าจ้าง', 0, 'R', 0, 1, '', '', true);
$pdf->SetY(43);
$pdf->SetX(170);
$pdf->MultiCell(30, 7, 'เงินสมทบ', 0, 'R', 0, 1, '', '', true);
}
//end add header
//detail
$pdf->SetY(50 + $j * 7.5);
$pdf->SetX(10);
$pdf->MultiCell(20, 7, $row, 0, 'R', 0, 1, '', '', true);
$pdf->SetY(50 + $j * 7.5);
$pdf->SetX(30);
$pdf->MultiCell(40, 7, $k->cid, 0, 'C', 0, 1, '', '', true);
$pdf->SetY(50 + $j * 7.5);
$pdf->SetX(70);
//.........这里部分代码省略.........
示例14: array
//.........这里部分代码省略.........
}
//print_r($due_report);
//exit();
if (isset($_POST['generate_pdf'])) {
$this->load->library('Pdf');
$this->db->select('company.name,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');
$company_details = $this->db->get()->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', '', 7, '', true);
$pdf->AddPage();
$pdf->writeHTMLCell(211, 17, '0', 10, '<h2 style="text-align:center;">' . $company_details->name . '</h2>', 0, 1, 0, true, '', true);
$style = array('width' => 0.1, 'color' => array(0, 0, 0));
$pdf->Line(0, 25, 220, 25, $style);
if ($with_tax_selected == 1) {
$pdf->writeHTMLCell(0, 0, '', '', '<h2 style="text-align:center;">Customer Wise Aging Report - With Tax</h2>', 0, 1, 0, true, '', true);
} else {
$pdf->writeHTMLCell(0, 0, '', '', '<h2 style="text-align:center;">Customer Wise Aging Report - without Tax</h2>', 0, 1, 0, true, '', true);
}
$style = array('width' => 0.1, 'color' => array(0, 0, 0));
$pdf->Line(0, 35, 220, 35, $style);
$pdf->writeHTMLCell(35, 0, 10, 40, '<strong style="text-align:center;">Period : ' . date('M Y', strtotime($due_date_db)) . '</strong>', 0, 1, 0, true, '', true);
$pdf->writeHTMLCell(35, 0, 168, 40, '<strong style="text-align:center;">Date : ' . date('d-m-Y') . '</strong>', 0, 1, 0, true, '', true);
$html .= '<tr><td></td><td><td/></tr></table><br /><br /><br /><br />';
$html .= '<table border="1" cellpadding="5" cellspacing = "0" width = "100%" nobr="true"><thead><tr>';
$html .= '<th width="25">No.</th>';
$html .= '<th width="75">Client Name</th>';
$html .= '<th width="60">0-3 Month</th>';
$html .= '<th width="60">3-6 Month</th>';
$html .= '<th width="60">6-9 Month</th>';
$html .= '<th width="60">9-12 Month</th>';
$html .= '<th width="60">1-1.5 Yrs</th>';
$html .= '<th width="60">1.5-2 Yrs</th>';
$html .= '<th width="60">Above 2 Yrs</th>';
$html .= '<th width="60">Total</th>';
$html .= '<th width="60">Tools</th>';
$html .= '</tr>';
$html .= '</thead><tbody>';
$total_sale_amount = 0;
$total_due_amount = 0;
$total_due_amount_additional = 0;
$total_due_tax = 0;
$total_due_tax_additional = 0;
$total_collection = 0;
$total_balance = 0;
foreach ($due_report as $due) {
示例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');
}