<?php include 'view/reportes/CabezaReport.php'; $pdf = new PDF(); if ($resultRep != "") { $pdf->Carton = ""; $pdf->Titulo = "Reporte de Documentos por SubCategorías"; $pdf->AddPage(); //$pdf->Header('Reporte de Categorías del Sistema'); $pdf->AddCol('nombre_subcategorias', 50, utf8_decode('Nombre de SubCategoría'), 'L'); $pdf->AddCol('lecturas_documentos', 50, utf8_decode('Cantidad de Documentos'), 'C'); $pdf->AddCol('paginas_documentos', 50, 'Cantidad Hojas', 'C'); $prop = array('HeaderColor' => array(246, 31, 66), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 210), 'padding' => 2); $pdf->SetY(40); $format = 1; $pdf->Table($resultRep, $prop, $format); $pdf->AddCol('totales', 50, utf8_decode(''), 'L'); $pdf->AddCol('total_documentos', 50, utf8_decode('Total Documentos'), 'C'); $pdf->AddCol('total_paginas', 50, utf8_decode('Total de Páginas'), 'C'); $prop2 = array('HeaderColor' => array(246, 31, 66), 'color1' => array(232, 237, 233), 'color2' => array(255, 255, 210), 'padding' => 2); //$pdf->SetY(40); $format = 0; $pdf->Table($resultRep2, $prop2, $format); } $pdf->Output();
$this->Cell(0, 6, 'LISTE DES CERTIFICATS', 0, 1, 'C'); $this->Ln(10); //Imprime l'en-tête du tableau si nécessaire parent::Header(); } //Pied de page function Footer() { //Positionnement à 1,5 cm du bas $this->SetY(-15); //Police Arial italique 8 $this->SetFont('Arial', 'I', 8); //Numéro de page $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C'); } } //Connexion à la base mysql_connect('localhost', 'root', ''); mysql_select_db('gestcertdkb'); $pdf = new PDF(); $pdf->Open(); $pdf->AddPage(); $pdf->AliasNbPages(); //tableau : définit 6 colonnes $pdf->AddCol('libelle_cert', 50, 'Nom du Certificat'); $pdf->AddCol('prix_cert', 60, 'Prix (CFA)'); $prop = array('HeaderColor' => array(1, 254, 248), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'padding' => 1); $pdf->Table('SELECT * FROM certificat', $prop); $pdf->Output(); ?>
$this->SetY(-15); //Arial italic 8 $this->SetFont('Arial', 'I', 8); //Page number $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C'); } } $pdf = new PDF('L', $unit = 'mm', $format = 'A4'); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Daily Sales"); $pdf->SetTitle("Daily Sales"); $pdf->SetCreator("Imran Zahid"); $prop = array('color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'color3' => array(128, 128, 128), 'padding' => 2, 'font' => array('Arial', '', 10), 'thfont' => array('Arial', 'B', 10)); $pdf->AddPage(); $pdf->AddCol('party_name', "20%", 'Party', 'L'); $pdf->AddCol('vendor', "20%", 'Vendor', 'L'); $pdf->AddCol('cat_name', "20%", 'Category', 'L'); $pdf->AddCol('description', "20%", 'Item', 'L'); $pdf->AddCol("cs", "10%", 'CS', 'R'); $pdf->AddCol("pc", "10%", 'PC', 'R'); $pdf->Table($data, $prop); $_cMargin = $pdf->cMargin; $pdf->cMargin = $prop['padding']; $pdf->SetFont('Arial', 'B', 10); $pdf->Cell(221.59806666667, 6, "Total", 1, 0, 'C'); $pdf->Cell(27.69975833333, 6, $totals['cs'], 1, 0, 'R'); $pdf->Cell(27.69975833333, 6, $totals['pc'], 1, 0, 'R'); $pdf->cMargin = $_cMargin; $pdf->Ln(); $pdf->Output("daily_sales_{$_GET['date_start']}.pdf", "D");
$pdf->SetSubject("Inventory Movement"); $pdf->SetTitle("Inventory Movement"); $pdf->SetCreator("Imran Zahid"); $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'formatNumber' => TRUE, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10)); $title = $_title; $firstPage = true; $grandTotal = (double) 0; foreach ($data as $godown_name => $ndata) { $opening_balance = $ndata['opening_balance']; $rate = $ndata['rate']; if ($firstPage === true) { $pdf->AddPage(); $firstPage = false; } $pdf->printTitle(); $pdf->AddCol('sno', '5%', 'S#', 'C'); $pdf->AddCol('event', '15%', 'Event', 'L'); $pdf->AddCol('seq', '5%', 'ID', 'L'); $pdf->AddCol('trans_date', '10%', 'Date', 'L'); $pdf->AddCol('erate', '10%', 'Rate', 'R'); $pdf->AddCol('op_qty', '15%', 'Quantity', 'R'); $pdf->AddCol('p_remarks', '40%', 'Remarks', 'L'); $pdf->Table($ndata['data'], $prop); $_cMargin = $pdf->cMargin; $pdf->cMargin = $prop['padding']; $pdf->SetFont('Arial', 'B', 10); $width = $pdf->w - $pdf->lMargin - $pdf->rMargin; $PC5 = 0.05 * $width; $pdf->Cell($width - $PC5 * 11, 6, 'Total', 0, 0, 'C', false); $pdf->Cell($PC5 * 3, 6, number_format($ndata['total'] + $opening_balance, 2), 0, 1, 'R', false); $pdf->Ln();
$this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L'); $this->SetX($this->lMargin); $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R'); } } $pdf = new PDF('P'); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("MM Circular"); $pdf->SetTitle("MM Circular"); $pdf->SetCreator("Imran Zahid"); $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 1, 'formatNumber' => TRUE, 'formatNumberDecimal' => 0, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10)); foreach ($data as $vid => $d) { $vehicle = $d['vehicle']; $pdf->AddPage(); $pdf->AddCol('cno', '5%', '', 'L'); if ($vendor == 'TIK') { $pdf->AddCol('description', '25%', '', 'L'); $pdf->AddCol('fix_rate', '15%', '', 'R'); } else { $pdf->AddCol('description', '40%', '', 'L'); } $pdf->AddCol('model', '15%', '', 'L'); $pdf->AddCol('oem', '15%', '', 'L'); $pdf->AddCol('rate', '15%', '', 'R'); $pdf->AddCol('unit', '10%', '', 'L'); $pdf->Table($d['data'], $prop, TRUE, FALSE); } $pdf->Output("circular.pdf", "D"); } else { if ($_GET['report'] == 'xls') {
$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C'); $this->SetX($this->lMargin); $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L'); $this->SetX($this->lMargin); $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R'); } } $pdf = new PDF('L'); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Order Report"); $pdf->SetTitle("Order Report"); $pdf->SetCreator("Imran Zahid"); $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10)); $pdf->AddPage(); $pdf->AddCol('sno', '5%', 'S.No.', 'C'); $pdf->AddCol('CNo', '10%', 'Date', 'L'); $pdf->AddCol('party_name', '20%', 'Manufacturer #', 'L'); $pdf->AddCol('item', '40%', 'Item Name', 'L'); $pdf->AddCol('qty', '15%', 'Quantity', 'R'); $pdf->AddCol('unit', '10%', 'Unit', 'L'); $pdf->Table($data, $prop); $pdf->Output("order_invoice.pdf", "D"); } else { if ($_GET['report'] == 'xls') { require_once '../../Classes/PHPExcel.php'; $padding = 0.71; $objPHPExcel = new PHPExcel(); $objPHPExcel->getProperties()->setCreator("*****@*****.**")->setLastModifiedBy("Imran Zahid")->setTitle("Order Invoice")->setSubject("Order Invoice")->setDescription("Order Invoice")->setKeywords("Order Invoice")->setCategory("Reports"); $activeSheet = $objPHPExcel->getActiveSheet(); $activeSheet->getHeaderFooter()->setOddHeader('&C&18&B' . $title . '&R&U&D');
{ } } $pdf = new PDF('P', 'mm', 'MA5'); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Account Ledger"); $pdf->SetTitle("Account Ledger"); $pdf->SetCreator("Imran Zahid"); $prop = array('HeaderColor' => array(255, 255, 255), 'HeaderTextColor' => array(0, 0, 0), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10)); foreach ($ledger as $ret) { if ($ret == NULL) { continue; } $pdf->AddPage(); $pdf->AddCol('invseq', '9%', 'Invoice #', 'L'); $pdf->AddCol('voucher_date', '10%', 'Date', 'L'); $pdf->AddCol('voucher_cheque', '9%', 'Cheque', 'L'); //if ($ret['account_cate'] != '276') { $pdf->AddCol('voucher_remarks', '42%', 'Description', 'L'); /*} else { $pdf->AddCol('voucher_remarks', '43%', 'Description', 'L'); $pdf->AddCol('days', '5%', 'Days', 'R'); }*/ $pdf->AddCol('debit_amount', '10%', 'Debit', 'R'); $pdf->AddCol('credit_amount', '10%', 'Credit', 'R'); $pdf->AddCol('balance', '10%', 'Balance', 'R'); $pdf->Table($ret['data'], $prop); $ac = number_format($ret['aob']); if (count($ret['data']) > 0) { $ac = $ret['data'][count($ret['data']) - 1]['balance'];
$pdf->AddPage(); $data = array(); $dr = (double) 0; $cr = (double) 0; $sql = "" . "SELECT @rownum:=@rownum+1 as rownum, x.* FROM (\n" . " SELECT account_name,\n" . " CASE WHEN account_type = 'DR' THEN\n" . " SUM(debit_amount - credit_amount)\n" . " ELSE 0\n" . " END AS Debit,\n" . " CASE WHEN account_type = 'CR' THEN\n" . " SUM(credit_amount - debit_amount)\n" . " ELSE 0\n" . " END AS Credit\n" . " FROM voucher_master vm,\n" . " voucher_detail vd,\n" . " chart_of_account coa\n" . " WHERE vm.voucher_id = vd.voucher_id\n" . " AND coa.account_code = vd.account_code\n" . " AND vm.company_ref_id = {$_SESSION['company_id']}\n" . "GROUP BY account_name,account_type) x,\n" . " (SELECT @rownum:=0) y\n" . " WHERE x.debit <> 0 OR x.credit <> 0"; $result = $mysqli->query($sql); while ($row = $result->fetch_assoc()) { $dr += $row['Debit']; $cr += $row['Credit']; $row['Debit'] = number_format($row['Debit'] * 1, 2); $row['Credit'] = number_format($row['Credit'] * 1, 2); $data[] = $row; } $result->close(); $mysqli->close(); $pdf->AddCol('rownum', '5%', 'S.No.', 'C'); $pdf->AddCol('account_name', '55%', 'Account', 'L'); $pdf->AddCol('Debit', '20%', 'Debit', 'R'); $pdf->AddCol('Credit', '20%', 'Credit', 'R'); $prop = array('color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'padding' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10)); $pdf->Table($data, $prop, FALSE, TRUE); $width = $pdf->w - $pdf->lMargin - $pdf->rMargin; $pdf->SetFont('Arial', 'B', 8); $pdf->Cell(60 / 100 * $width, 5, 'Total', 1, 0, 'L', FALSE); $pdf->Cell(20 / 100 * $width, 5, number_format($dr, 2), 1, 0, 'R', FALSE); $pdf->Cell(20 / 100 * $width, 5, number_format($cr, 2), 1, 0, 'R', FALSE); $pdf->Ln(); $drbal = ""; $crbal = ""; $bal = number_format(abs($dr - $cr), 2); if ($cr > $dr) {
$cr = 0; while ($row = $result->fetch_assoc()) { $d = $row['debit'] * 1; $c = $row['credit'] * 1; $bal = $bal + $d - $c; $dr += $d; $cr += $c; $row['debit'] = number_format($row['debit']); $row['credit'] = number_format($row['credit']); $row['balance'] = number_format($bal); $data[] = $row; } $result->close(); if (count($data) > 0) { $pdf->AddPage(); $pdf->AddCol('sale_master_id', '10%', 'Invoice #', 'L'); $pdf->AddCol('voucher_date', '10%', 'Date', 'L'); $pdf->AddCol('comments', '50%', 'Description', 'L'); $pdf->AddCol('debit', '10%', 'Debit', 'R'); $pdf->AddCol('credit', '10%', 'Credit', 'R'); $pdf->AddCol('balance', '10%', 'Balance', 'R'); $pdf->Table($data, $prop); $title = ""; $ac = $aob + $dr - $cr; $pdf->SetFont('Arial', 'B', 8); $cellSize = 10 / 100 * $pdf->TableWidth; $pdf->SetX($pdf->lMargin); $pdf->Cell(70 / 100 * $pdf->TableWidth, 5, 'Total', 0, 0, 'C'); $pdf->Cell($cellSize, 5, number_format($dr), 0, 0, 'R'); $pdf->Cell($cellSize, 5, number_format($cr), 0, 0, 'R'); $pdf->SetX($pdf->lMargin);
$col = 5.5; $pad = 0; if ($_GET['mm'] == 'quantity') { $pad = $col * 6; } else { if ($_GET['mm'] == 'rate') { $pad = $col * 3; } } $c = $col * 3 - $col * count($billNos); $dw = 20 + $c; foreach ($data as $cat_name => $d) { $title = "Category - {$cat_name}"; $cat_perc = $pm["{$cat_name}"]; $pdf->AddPage(); $pdf->AddCol('cno', '4%', 'Comp\\nNo', 'L', 10); $pdf->AddCol('description', $pad + $dw . '%', 'Item\\nDescription', 'L', 10); $pdf->AddCol('manufacturer_no', '10%', 'Part\\nNo', 'L', 10); $pdf->AddCol('karachi', $col . '%', 'Karachi\\nGodown', 'R', 10); $pdf->AddCol('lahore', $col . '%', 'Lahore\\nGodown', 'R', 10); foreach ($billNos as $bill) { $pdf->AddCol($bill, $col . '%', $bill, 'R', 10); } $pdf->AddCol('stock_total', $col . '%', 'Total', 'R', 10); if ($_GET['mm'] == 'complete') { $pdf->AddCol('dprice', $col . '%', 'Dollar\\nPrice', 'R', 10); $pdf->AddCol('cost', $col . '%', 'Cost', 'R', 10); $pdf->AddCol('current_cost', $col . '%', 'Current\\nCost', 'R', 10); } if ($_GET['mm'] == 'complete' || $_GET['mm'] == 'rate') { $pdf->AddCol('fix_rate', $col . '%', 'Fix\\nRate', 'R', 10);
parent::Header(); } //Pied de page function Footer() { //Positionnement à 1,5 cm du bas $this->SetY(-15); //Police Arial italique 8 $this->SetFont('Arial', 'I', 8); //Numéro de page $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C'); } } //Connexion à la base mysql_connect('localhost', 'root', ''); mysql_select_db('gestcertdkb'); $pdf = new PDF(); $pdf->Open(); $pdf->AddPage(); $pdf->AliasNbPages(); //tableau : définit 6 colonnes $pdf->AddCol('nom_client', 25, 'Nom'); $pdf->AddCol('prenom_client', 50, 'Prenoms'); $pdf->AddCol('mail_client', 50, 'Mail'); $pdf->AddCol('tel_client', 30, 'Contact'); $pdf->AddCol('certificat_client', 40, 'Certificat'); $prop = array('HeaderColor' => array(1, 254, 248), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'padding' => 1); $pdf->Table('SELECT * FROM client', $prop); $pdf->Output(); ?>
{ $this->Ln(3); $this->SetFont('Times', 'B', 16); $this->SetTextColor(0, 0, 0); $this->Cell(0, 3, $pdfAgencyName, 0, 1, 'L'); $this->Ln(5); $this->SetFont('Times', 'B', 11); $this->SetTextColor(131, 130, 139); $this->Cell(0, 3, "Powered by Getchs;", 0, 1, 'L'); $this->tdheight = 5; $this->Ln(30); $this->SetFont('Times', 'B', 24); $this->SetTextColor(64, 64, 64); $this->Cell(0, 3, "LIST OF ALL APPLICANTS", 0, 1, 'C'); $this->Ln(5); //Ensure table header is output parent::Header(); } } //Connect to database mysql_connect("{$db_hostname}", "{$db_username}", "{$db_password}"); mysql_select_db('remsdb'); $pdf = new PDF("L", "mm", array(300, 200)); $pdf->AddPage(); $pdf->SetTextColor(0, 0, 0); $pdf->AddCol("Name", 55, 'Applicant Name', 'C'); $pdf->AddCol('basicEmail', 80, 'Email Address', 'C'); $prop = array('HeaderColor' => array(89, 201, 145), 'color1' => array(224, 235, 255), 'color2' => array(255, 255, 240)); $pdf->SetFont('Times', 'B', 30); $pdf->Table("SELECT CONCAT (basicLastName , ',' , basicFirstName , ' ', basicMiddleName) AS Name, basicEmail\n\t\t\tFROM tbl_basic_info a, tbl_applicant b\n\t\t\tWHERE a.basicId = b.applicantId", $prop); $pdf->Output();
} $sql .= "GROUP BY coa.account_name\n"; //echo "<pre>$sql</pre>"; $result = $mysqli->query($sql); $data = array(); while ($row = $result->fetch_assoc()) { $row['account_name'] = trim($row['account_name']); $d_net += $row['outstanding'] * 1; $row['outstanding'] = number_format($row['outstanding'] * 1, 2); $data[] = $row; } $result->close(); $mysqli->close(); $d_net = number_format($d_net * 1, 2); $pdf->AddPage(); $pdf->AddCol('account_name', '50%', 'Party Name', 'L'); $pdf->AddCol('outstanding', '50%', 'Outstanding Amount', 'R'); $pdf->Table($data, $prop); $pdf->Ln(); $pdf->Output("dist_party_outstand_{$_GET['distributor']}.pdf", "D"); } else { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="shortcut icon" href="../images/logo_icon.gif"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="../stylesheets/style.css" rel="stylesheet" type="text/css" /> <title><?php echo $_SESSION['companyname']; ?>
$pdf = new PDF(); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Godown Stock"); $pdf->SetTitle("Godown Stock"); $pdf->SetCreator("Imran Zahid"); $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'formatNumber' => TRUE, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10)); $grandTotal = array('Total' => (double) 0); foreach ($godowns as $gdn) { $grandTotal[$gdn] = (double) 0; } foreach ($data as $ndata) { $vendor = $ndata['vendor']; $pdf->AddPage(); $col = 40 / count($godowns); $pdf->AddCol('sno', '3%', 'S#', 'C'); $pdf->AddCol('category', '37%', 'Category', 'L'); foreach ($godowns as $gdn) { $pdf->AddCol($gdn, $col . '%', $gdn, 'R'); } $pdf->AddCol('Total', '20%', 'Total', 'R'); $pdf->Table($ndata['data'], $prop); $_cMargin = $pdf->cMargin; $pdf->cMargin = $prop['padding']; $pdf->SetFont('Arial', 'B', 10); $width = $pdf->w - $pdf->lMargin - $pdf->rMargin; $PC10 = 0.1 * $width; $col = $col / 10; $pdf->Cell($PC10 * 4, 6, 'Total', 0, 0, 'C', false); foreach ($godowns as $gdn) { $pdf->Cell($PC10 * $col, 6, number_format($ndata['total'][$gdn]), 0, 0, 'R', false);
$this->Cell(0, 6, 'Tecnoinversiones RB', 0, 1, 'C'); //Ensure table header is output parent::Header(); } } $fechaP = $_REQUEST['fechaM']; $fechaP = cambiaf_a_mysql($_REQUEST['fechaM']); //Connect to database mysql_select_db($database_tecno, $tecno); $pdf = new PDF('P', 'mm', 'Letter'); $pdf->Open(); $pdf->AddPage(); //table: $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 6, 'Listado de Morosos Ventas', 0, 1, 'C'); $pdf->AddCol('nom', 36, 'Nombres', 'C'); $pdf->AddCol('telefono', 18, 'Teléfono'); $pdf->AddCol('celular', 18, 'Celular'); $pdf->AddCol('giro', 9, 'Giro'); $pdf->AddCol('fechaV', 19, 'Fecha V', 'C'); $pdf->AddCol('monto', 15, 'Monto', 'C'); $pdf->AddCol('productoDes', 40, 'Descripción', 'C'); $pdf->AddCol('', 32, 'Observaciones', 'C'); $prop = array('HeaderColor' => array(210, 210, 210), 'color1' => array(255, 255, 255), 'color2' => array(235, 235, 235), 'padding' => 1); $pdf->Table("SELECT *, CONCAT(nombres,' ',primerApellido) as nom\r\nFROM datospersonales, detallescliente\r\nWHERE datospersonales.id = detallescliente.id\r\nAND detallescliente.status =0\r\nAND detallescliente.fechaV <= '{$fechaP}'\r\nAND detallescliente.tipo = 1\r\nORDER BY datospersonales.cedula ASC, detallescliente.fechaV DESC, detallescliente.productoDes DESC", $prop); $pdf->AddPage(); //table2: $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(0, 6, 'Listado de Morosos Préstamos', 0, 1, 'C'); $pdf->AddCol('nom', 36, 'Nombres', 'C'); $pdf->AddCol('telefono', 18, 'Teléfono');
//Page number $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C'); $this->SetX($this->lMargin); $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L'); $this->SetX($this->lMargin); $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R'); } } $pdf = new PDF('L'); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Active Trial Balance"); $pdf->SetTitle("Active Trial Balance"); $pdf->SetCreator("Imran Zahid"); $pdf->AddPage(); $pdf->AddCol('rownum', '5%', 'S.No.', 'C'); $pdf->AddCol('account_name', '45%', 'Account Name', 'L'); $pdf->AddCol('debit', '25%', 'Debit', 'R'); $pdf->AddCol('credit', '25%', 'Credit', 'R'); $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10)); $pdf->Table($ndata, $prop, FALSE, TRUE); $width = $pdf->w - $pdf->lMargin - $pdf->rMargin; $pdf->SetFont('Arial', 'B', 8); $pdf->Cell(50 / 100 * $width, 5, 'Total', 1, 0, 'L', FALSE); $pdf->Cell(25 / 100 * $width, 5, number_format($dr, 2), 1, 0, 'R', FALSE); $pdf->Cell(25 / 100 * $width, 5, number_format($cr, 2), 1, 0, 'R', FALSE); $pdf->Ln(); $drbal = ""; $crbal = ""; $bal = number_format($dr - $cr, 2); if ($cr > $dr) {
} //Connect to database mysql_connect("{$db_hostname}", "{$db_username}", "{$db_password}"); mysql_select_db('remsdb'); $pdf = new PDF("L", "mm", array(400, 200)); $pdf->AddPage(); $pdf->SetFont('Times', 'B', 16); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Times', 'B', 14); $pdf->SetY(8); $pdf->SetX(10); $pdf->Cell(0, 3, $pdfAgencyName, 0, 1, 'L'); $pdf->Ln(5); $pdf->SetFont('Times', 'B', 12); $pdf->SetTextColor(131, 130, 139); $pdf->Cell(0, 3, "Powered by Getchs;", 0, 1, 'L'); $pdf->tdheight = 5; $pdf->Ln(30); $pdf->SetFont('Times', 'B', 24); $pdf->SetTextColor(64, 64, 64); $pdf->Cell(0, 3, "Employee Contract Report From: {$_SESSION['start1']} To: {$_SESSION['end1']}", 0, 1, 'C'); $pdf->Ln(10); $pdf->AddCol("Name", 100, 'Employee Name', 'L'); $pdf->AddCol('clientName', 70, 'Client Name', 'L'); $pdf->AddCol('jobName', 60, 'Job', 'C'); $pdf->AddCol('contractStartDate', 45, 'Start of Contract', 'C'); $pdf->AddCol('contractEndDate', 45, 'End of Contract', 'C'); $prop = array('HeaderColor' => array(164, 219, 254), 'color2' => array(224, 235, 255), 'color1' => array(255, 255, 255)); $pdf->SetFont('Times', 'B', 24); $pdf->Table("SELECT CONCAT (basicLastName , ',' , basicFirstName , ' ', basicMiddleName) AS Name, clientName, jobName, contractStartDate, contractEndDate\n\t\t\tFROM tbl_employee a, tbl_applicant b, tbl_basic_info c, tbl_client d, tbl_job_posting e, tbl_contract f \n\t\t\t\t\tWHERE a.applicantId = b.applicantId\n\t\t\t\t\tAND c.basicId = b.basicId\n\t\t\t\t\tAND a.jobPostingId = e.jobPostingId \n\t\t\t\t\tAND d.clientId = e.clientId\n\t\t\t\t\tAND f.employeeId = a.employeeId\n\t\t\tAND contractStartDate >= '{$_SESSION['start1']}' AND contractEndDate <= '{$_SESSION['end1']}' ", $prop); $pdf->Output();
$this->SetX($this->lMargin); $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L'); $this->SetX($this->lMargin); $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R'); } } $pdf = new PDF('L'); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Payment Detail"); $pdf->SetTitle("Payment Detail"); $pdf->SetCreator("Imran Zahid"); $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 1, 'formatNumber' => TRUE, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10)); $title = $_title; $pdf->AddPage(); $pdf->AddCol('name', '20%', 'Party', 'L'); $pdf->AddCol('term', '5%', 'Term', 'L'); if (strlen($_GET['month']) > 1) { for ($i = $start; $i <= $end; $i++) { $pdf->AddCol("ob{$i}", '7.5%', 'Bal', 'R'); $pdf->AddCol("pay{$i}", '7.5%', 'Payment', 'R'); } $pdf->Table($data, $prop); $prop['font'] = array('Arial', 'B', 10); $data = array(); $data[] = $totals; $pdf->AddCol('name', '25%', 'Total', 'C'); for ($i = $start; $i <= $end; $i++) { $pdf->AddCol("ob{$i}", '7.5%', 'Bal', 'R'); $pdf->AddCol("pay{$i}", '7.5%', 'Payment', 'R'); }
} //Connect to database mysql_connect("{$db_hostname}", "{$db_username}", "{$db_password}"); mysql_select_db('remsdb'); $pdf = new PDF("L", "mm", array(400, 200)); $pdf->AddPage(); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Times', 'B', 16); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Times', 'B', 14); $pdf->SetY(8); $pdf->SetX(10); $pdf->Cell(0, 3, $pdfAgencyName, 0, 1, 'L'); $pdf->Ln(5); $pdf->SetFont('Times', 'B', 12); $pdf->SetTextColor(131, 130, 139); $pdf->Cell(0, 3, "Powered by Getchs;", 0, 1, 'L'); $pdf->tdheight = 5; $pdf->Ln(30); $pdf->SetFont('Times', 'B', 24); $pdf->SetTextColor(64, 64, 64); $pdf->Cell(0, 3, "LIST OF ALL ENDORSED APPLICANT", 0, 1, 'C'); $pdf->Ln(10); $pdf->AddCol("Name", 80, 'Applicant Name', 'L'); $pdf->AddCol('clientName', 70, 'Client Name', 'L'); $pdf->AddCol('endorsementDate', 60, 'Application Date', 'L'); $pdf->AddCol('endorsementStatus', 50, 'Applicant Status', 'L'); $prop = array('HeaderColor' => array(89, 201, 145), 'color1' => array(224, 235, 255), 'color2' => array(255, 255, 240)); $pdf->SetFont('Times', 'B', 24); $pdf->Table("SELECT CONCAT (basicLastName , ',' , basicFirstName , ' ', basicMiddleName) AS Name, clientName, endorsementDate, endorsementStatus\n\t\t\tFROM tbl_endorsement a, tbl_applicant b, tbl_basic_info c, tbl_client d, tbl_job_posting e\n\t\t\tWHERE a.applicantId = b.applicantId \n\t\t\t\t\tAND c.basicId = b.basicId\n\t\t\t\t\tAND a.clientId = d.clientId\n\t\t\t\t\tAND a.jobPostingId = e.jobPostingId", $prop); $pdf->Output();
$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C'); $this->SetX($this->lMargin); $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L'); $this->SetX($this->lMargin); $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R'); } } $pdf = new PDF('L'); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Order Report"); $pdf->SetTitle("Order Report"); $pdf->SetCreator("Imran Zahid"); $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10)); $pdf->AddPage(); $pdf->AddCol('sno', '5%', 'S#', 'C'); $pdf->AddCol('o_date', '10%', 'Date', 'L'); $pdf->AddCol('party_name', '20%', 'Supplier', 'L'); $pdf->AddCol('item', '40%', 'Item', 'L'); $pdf->AddCol('qty', '15%', 'Quantity', 'R'); $pdf->AddCol('unit', '10%', 'Unit', 'L'); $pdf->Table($data, $prop); $pdf->Output("order_invoice.pdf", "D"); } else { if ($_GET['report'] == 'xls') { require_once '../../Classes/PHPExcel.php'; $padding = 0.71; $objPHPExcel = new PHPExcel(); $objPHPExcel->getProperties()->setCreator("*****@*****.**")->setLastModifiedBy("Imran Zahid")->setTitle("Order Invoice")->setSubject("Order Invoice")->setDescription("Order Invoice")->setKeywords("Order Invoice")->setCategory("Reports"); $activeSheet = $objPHPExcel->getActiveSheet(); $activeSheet->getHeaderFooter()->setOddHeader('&C&18&B' . $title . '&R&U&D');
//$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C'); $this->SetX($this->lMargin); $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L'); $this->SetX($this->lMargin); $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R'); } } $pdf = new PDF('L'); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Sales Vendor Party"); $pdf->SetTitle("Sales Vendor Party"); $pdf->SetCreator("Imran Zahid"); $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'formatNumber' => TRUE, 'font' => array('Arial', '', 10), 'thfont' => array('Arial', 'B', 12)); $pdf->AddPage(); $pdf->AddCol('seq', '8%', 'Inv No', 'L'); $pdf->AddCol('cno', '5%', 'C-No', 'L'); $pdf->AddCol('description', '47%', 'Item Description', 'L'); $pdf->AddCol('sales_qty', '8%', 'Quantity', 'R'); $pdf->AddCol('sales_rate', '8%', 'Rate', 'R'); $pdf->AddCol('circular_rate', '8%', 'Circular', 'R'); $pdf->AddCol('fix_rate', '8%', 'Fix Rate', 'R'); $pdf->AddCol('diff', '8%', 'Difference', 'R'); $pdf->Table($data, $prop); $prop['font'] = array('Arial', 'B', 12); $data = array($tdata); $pdf->AddCol('title', '92%', 'Title', 'C'); $pdf->AddCol('rate', '8%', 'Rate', 'R'); $pdf->Table($data, $prop, TRUE, FALSE); $pdf->Ln(); $pdf->Output("sales_item_rate_compare.pdf", "D");
function Footer() { } } $pdf = new PDF('P', 'mm', 'MA5'); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Warehouse Transfer"); $pdf->SetTitle("Warehouse Transfer"); $pdf->SetCreator("Imran Zahid"); $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 8)); foreach ($data as $id => $d) { $transDate = $d[0]['trans_date']; $billNo = $d[0]['billno']; $pdf->AddPage(); $pdf->AddCol('sno', '5%', 'S#', 'C'); $pdf->AddCol('cno', '10%', 'Cno', 'L'); $pdf->AddCol('manufacturer_no', '15%', 'Part No', 'L'); $pdf->AddCol('item', '35%', 'Description', 'L'); $pdf->AddCol('cat_name', '20%', 'Model', 'L'); $pdf->AddCol('qty', '10%', 'Quantity', 'R'); $pdf->AddCol('unit', '5%', 'Unit', 'C'); $pdf->Table($d, $prop); } $pdf->Output("warehouse_transfer.pdf", "D"); } else { if ($_GET['report'] == 'xls') { require_once '../../Classes/PHPExcel.php'; $padding = 0.71; $objPHPExcel = new PHPExcel(); $objPHPExcel->getProperties()->setCreator("*****@*****.**")->setLastModifiedBy("Imran Zahid")->setTitle("Warehouse Transfer")->setSubject("Warehouse Transfer")->setDescription("Warehouse Transfer")->setKeywords("Warehouse Transfer")->setCategory("Reports");
$this->SetX($this->lMargin); $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R'); } } $pdf = new PDF('L'); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Sales Comparision"); $pdf->SetTitle("Sales Comparision"); $pdf->SetCreator("Imran Zahid"); foreach ($regionals as $city => $regional) { $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 1, 'formatNumber' => TRUE, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10)); $ndata = $regional['data']; $totals = $regional['totals']; $pdf->AddPage(); $pdf->AddCol('vendor', '16%', 'Vendor', 'L'); foreach ($months as $month) { $pdf->AddCol($month, '7%', $month, 'R'); } $pdf->Table($ndata, $prop); $prop['font'] = array('Arial', 'B', 10); $ndata = array(); $ndata[] = $totals; $pdf->AddCol('vendor', '16%', 'Vendor', 'L'); foreach ($months as $month) { $pdf->AddCol($month, '7%', $month, 'R'); } $pdf->Table($ndata, $prop, TRUE, FALSE); } $pdf->Output("sales_comparision.pdf", "D"); } else {
$this->SetX($this->lMargin); $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L'); $this->SetX($this->lMargin); $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R'); } } $pdf = new PDF('P'); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Missing Challan"); $pdf->SetTitle("Missing Challan"); $pdf->SetCreator("Imran Zahid"); $prop = array('color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'padding' => 2, 'formatNumber' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10)); $pdf->AddPage(); foreach ($cities as $city) { $pdf->AddCol("bill{$city}", '10%', 'Bill No', 'L'); $pdf->AddCol('remarks', '40%', 'Remarks', 'L'); } $pdf->Table($ndata, $prop); $pdf->Output("missng_challan.pdf", "D"); } } else { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="shortcut icon" href="../images/logo_icon.gif"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="../stylesheets/style.css" rel="stylesheet" type="text/css" /> <title><?php echo $_SESSION['companyname'];
while ($row = $result->fetch_assoc()) { $row['sno'] = $count++; $total['qty'] += $row['shipQty']; $total['amt'] += $row['amount']; $row['shipQty'] = number_format($row['shipQty']); $row['shipRate'] = number_format($row['shipRate'], 2); $row['amount'] = number_format($row['amount'], 2); if ($showimport) { $total['uamt'] += $row['unitAmount']; $row['unitCost'] = number_format($row['unitCost'], 2); $row['unitAmount'] = number_format($row['unitAmount'], 2); } $data[] = $row; } $result->close(); $pdf->AddCol('sno', '5%', 'S#', 'C'); $pdf->AddCol('item', ($showimport === true ? '43' : '40') . '%', 'Item', 'L'); $pdf->AddCol('shipQty', ($showimport === true ? '8' : '20') . '%', 'Qty', 'R'); $pdf->AddCol('shipRate', ($showimport === true ? '8' : '15') . '%', 'Rate', 'R'); $pdf->AddCol('amount', ($showimport === true ? '12' : '20') . '%', 'Amt', 'R'); if ($showimport) { $pdf->AddCol('unitCost', '12%', 'Unit Cost', 'R'); $pdf->AddCol('unitAmount', '12%', 'Unit Amt', 'R'); } $pdf->Table($data, $prop); $_cMargin = $pdf->cMargin; $pdf->cMargin = $prop['padding']; $pdf->SetFont('Arial', 'B', 10); $width = $pdf->w - $pdf->lMargin - $pdf->rMargin; $cellSize = 0.01 * $width; $pdf->Cell($cellSize * ($showimport === true ? 48 : 45), 6, 'Total', 1, 0, 'C', false);
$this->SetX($this->lMargin); $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R'); } } $pdf = new PDF('L'); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Back Order"); $pdf->SetTitle("Back Order"); $pdf->SetCreator("Imran Zahid"); $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 1, 'formatNumber' => TRUE, 'formatNumberDecimal' => 0, 'printZero' => FALSE, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10)); foreach ($data as $cat_name => $d) { $prop['font'] = array('Arial', '', 8); $title = "Category - {$cat_name}"; $pdf->AddPage(); $pdf->AddCol('cno', '4%', 'Comp\\nNo', 'L', 10); $pdf->AddCol('manufacturer_no', '9%', 'Part\\nNo', 'L', 10); $pdf->AddCol('description', '16%', 'Item\\nDescription', 'L', 10); $pdf->AddCol('karachi', '6%', 'Karachi\\nGodown', 'R', 10); $pdf->AddCol('lahore', '6%', 'Lahore\\nGodown', 'R', 10); $pdf->AddCol('stock_total', '6%', 'Total', 'R', 10); $pdf->AddCol('cost', '5%', 'Cost', 'R', 10); $pdf->AddCol('amt', '6%', 'Amount', 'R', 10); $pdf->AddCol('reference', '8%', 'Order\\nNo', 'L', 10); $pdf->AddCol('o_date', '6%', 'Order\\nDate', 'L', 10); $pdf->AddCol('order', '5%', 'Order', 'R', 10); $pdf->AddCol('o_rate', '5%', 'Rate', 'R', 10); $pdf->AddCol('rec', '6%', 'Receive\\nQuantity', 'R', 10); $pdf->AddCol('bal', '6%', 'Balance\\nQuantity', 'R', 10); $pdf->AddCol('bal_amt', '6%', 'Balance\\nAmount', 'R', 10); $pdf->Table($d, $prop);
$data = array(); $count = 1; $total = array(); $total['qty'] = (double) 0; $total['amt'] = (double) 0; while ($row = $result->fetch_assoc()) { $row['sno'] = $count++; $total['qty'] += $row['pr_qty']; $total['amt'] += $row['amt']; $row['pr_qty'] = number_format($row['pr_qty']); $row['pr_rate'] = number_format($row['pr_rate']); $row['amt'] = number_format($row['amt']); $data[] = $row; } $result->close(); $pdf->AddCol('sno', '5%', 'S#', 'C'); $pdf->AddCol('item', '50%', 'Item', 'L'); $pdf->AddCol('pr_qty', '15%', 'Quantity', 'R'); $pdf->AddCol('pr_rate', '15%', 'Rate', 'R'); $pdf->AddCol('amt', '15%', 'Amount', 'R'); $pdf->Table($data, $prop); $_cMargin = $pdf->cMargin; $pdf->cMargin = $prop['padding']; $pdf->SetFont($prop['thfont'][0], $prop['thfont'][1], $prop['thfont'][2]); $width = $pdf->w - $pdf->lMargin - $pdf->rMargin; $cellSize = 0.01 * $width; $pdf->Cell($cellSize * 45, 6, 'Total', 0, 0, 'C', false); $pdf->Cell($cellSize * 20, 6, number_format($total['qty']), 0, 0, 'R', false); $pdf->Cell($cellSize * 15, 6, '', 0, 0, 'L', false); $pdf->Cell($cellSize * 20, 6, number_format($total['amt']), 0, 0, 'R', false); $pdf->Ln();
$pdf = new PDF(); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Cash Movement"); $pdf->SetTitle("Cash Movement"); $pdf->SetCreator("Imran Zahid"); $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 1, 'formatNumber' => TRUE, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10)); $title = $_title; $pdf->AddPage(); $col = 100 / $total; for ($i = 0; $i < $total; $i++) { $align = 'R'; if ($i % 2 == 0) { $align = 'L'; } $pdf->AddCol("{$i}", $col . '%', '', $align); } $pdf->Table($data, $prop, FALSE, FALSE); $pdf->Table($tdata, $prop, TRUE, FALSE); $fileName .= ".pdf"; $pdf->Output($fileName, "D"); } else { if ($_GET['report'] == 'xls') { require_once '../../Classes/PHPExcel.php'; $padding = 0.71; $objPHPExcel = new PHPExcel(); $objPHPExcel->getProperties()->setCreator("*****@*****.**")->setLastModifiedBy("Imran Zahid")->setTitle("Godown Stock")->setSubject("Godown Stock")->setDescription("Godown Stock")->setKeywords("Godown Stock")->setCategory("Reports"); $activeSheet = $objPHPExcel->getActiveSheet(); $activeSheet->getHeaderFooter()->setOddHeader('&C&18&B' . $_title . '&R&U&D'); $activeSheet->getHeaderFooter()->setOddFooter('&LPlease consider the environment before printing this report&C&IPage &P/&N&RReport generated by nexexcel.com'); $activeSheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
// con filtro del motivos y depattamento if ($depto != '-1' and $motivo != '-1' and ($fechai != "" and $fechaf != "")) { $query1 = " \nSelect empleado.No_Empleado, CONCAT(Primer_nombre, ' ', Segundo_nombre, ' ', Primer_apellido, ' ', Segundo_Apellido) as Nombre, departamento_laboral.nombre_departamento,motivos.descripcion, \nCOUNT(permisos.id_Permisos) as Solicitudes, SUM(permisos.dias_permiso) as Inasistencias from permisos\n inner join motivos on permisos.id_motivo=motivos.Motivo_ID \n inner join empleado on empleado.No_Empleado=permisos.No_Empleado \n inner join persona on persona.N_identidad=empleado.N_identidad \n inner join departamento_laboral on departamento_laboral.id_departamento_laboral = permisos.id_departamento \n where departamento_laboral.nombre_departamento='" . $depto . "' and motivos.descripcion='" . $motivo . "' and \n date_format(permisos.fecha,'%d-%m-%Y') between date_format('" . $fechai . " ','%d-%m-%Y')and date_format('" . $fechaf . "','%d-%m-%Y')\t\n\tGROUP BY Primer_nombre, Segundo_nombre, Primer_apellido, Segundo_Apellido, departamento_laboral.nombre_departamento,motivos.descripcion ORDER BY Primer_nombre asc"; } // por fechas if ($depto == '-1' and $motivo != '-1') { $query1 = " \nSelect empleado.No_Empleado, CONCAT(Primer_nombre, ' ', Segundo_nombre, ' ', Primer_apellido, ' ', Segundo_Apellido) as Nombre, departamento_laboral.nombre_departamento, motivos.descripcion, \nCOUNT(permisos.id_Permisos) as Solicitudes, SUM(permisos.dias_permiso) as Inasistencias from permisos\n inner join motivos on permisos.id_motivo=motivos.Motivo_ID \n inner join empleado on empleado.No_Empleado=permisos.No_Empleado \n inner join persona on persona.N_identidad=empleado.N_identidad \n inner join departamento_laboral on departamento_laboral.id_departamento_laboral = permisos.id_departamento \n where motivos.descripcion='" . $motivo . "' and \n date_format(permisos.fecha,'%d-%m-%Y') between date_format('" . $fechai . " ','%d-%m-%Y')and date_format('" . $fechaf . "','%d-%m-%Y')\t\n\tGROUP BY Primer_nombre, Segundo_nombre, Primer_apellido, Segundo_Apellido, departamento_laboral.nombre_departamento,motivos.descripcion ORDER BY Primer_nombre asc"; } $pdf = new PDF(); $pdf->AddPage("L", "Letter"); $pdf->SetFont('Arial', '', 18); $pdf->Image($maindir . 'assets/img/lucen-aspicio.png', 50, 15, 200, 200, 'PNG'); $pdf->Image($maindir . 'assets/img/logo_unah.png', 15, 5, 24, 36, 'PNG'); $pdf->Image($maindir . 'assets/img/logo-cienciasjuridicas.png', 230, 8, 35, 35, 'PNG'); $pdf->Cell(22, 10, '', 0); $pdf->SetFont('Arial', '', 18); $pdf->Cell(45, 10, '', 0); $pdf->Cell(70, 10, utf8_decode('Universidad Nacional Autónoma de Honduras'), 0); $pdf->Ln(10); $pdf->SetFont('Arial', 'U', 14); $pdf->Cell(60, 8, '', 0, 0, "C"); $pdf->Cell(130, 8, 'Reportes de Permisos Personales', 0, 0, "C"); $pdf->Ln(25); //$pdf->AddCol('N',25,'#Empleado','C'); $pdf->AddCol('Nombre', 70, 'Nombre Completo', 'C'); $pdf->AddCol('nombre_departamento', 40, 'Departamento', 'C'); $pdf->AddCol('descripcion', 40, 'Motivo', 'C'); $pdf->AddCol('Solicitudes', 28, 'Solicitudes', 'R'); $pdf->AddCol('Inasistencias', 30, utf8_decode('Días Faltados'), 'R'); $pdf->Table($query1); $pdf->Output();
} $data[] = $tempTotal; $totals['net_profit_loss'][0] += $tempTotal["yr1"]; $totals['net_profit_loss'][1] += $tempTotal["yr2"]; $totals['net_profit_loss'][2] += $tempTotal["yr3"]; for ($i = 0; $i < 3; $i++) { if ($totals['net_profit_loss'][$i] < 0) { $totals['net_profit_loss'][$i] = '(' . number_format($totals['net_profit_loss'][$i] * -1, 2) . ')'; } else { $totals['net_profit_loss'][$i] = number_format($totals['net_profit_loss'][$i], 2); } } $data[] = array("description" => "", "yr1" => "", "yr2" => "", "yr3" => ""); $data[] = array("description" => "Net Profit or Loss", "yr1" => $totals['net_profit_loss'][0], "yr2" => $totals['net_profit_loss'][1], "yr3" => $totals['net_profit_loss'][2], "hilite" => "Y"); $pdf->AddPage(); $pdf->AddCol('description', '40%', 'Description', 'L'); $divisor = 0; for ($i = 0; $i < 3; $i++) { if ($years["{$i}"]['year_id'] * 1 > 0) { $divisor += 1; } } $col = 60 / $divisor; for ($i = 0; $i < 3; $i++) { if ($years["{$i}"]['year_id'] * 1 > 0) { $pdf->AddCol('yr' . ($i + 1), $col . '%', $years["{$i}"]['period'], 'R'); } } $pdf->Table($data, $prop); $pdf->Output("pl_statement_{$_GET['fyear']}.pdf", "D"); } else {