403Webshell
Server IP : 210.245.233.93  /  Your IP : 216.73.216.226
Web Server : Apache/2.2.15 (CentOS)
System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/hkosl.com/innoutstorage/webadmin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/hkosl.com/innoutstorage/webadmin/output_invoice3_pdf.php_20221221rwbk
<?php
require_once('check_login.php');
require_once 'dompdf/autoload.inc.php';

use Dompdf\Dompdf;
use Dompdf\Options;

set_time_limit(0);
ini_set('memory_limit', '512M');
ini_set('apc.cache_by_default', 0);

if (!($_GET["invoice_id"] || (int)$_GET["invoice_id"] >= 0 || $_GET["order_id"] || (int)$_GET["order_id"] >= 0)) {
	echo "<script>alert('請選擇正確的發票。'); history.back();</script>";
	exit;
}

date_default_timezone_set('Asia/Hong_Kong');

ini_set('apc.cache_by_default', 0);

if (PHP_SAPI == 'cli') {
	die('This example should only be run from a Web Browser');
}

// get invoice data
$invoice_id = NULL;
$order_id = NULL;
$invoice_info = NULL;
$customer_info = NULL;
$balance = NULL;
$code = NULL;

if ($_GET["invoice_id"]) {
	$invoice_id = (int)$_GET["invoice_id"];
	$invoice_info = get_deposit($invoice_id);
	$balance      = $invoice_info["deposit_balance"];
	$code         = $invoice_info["deposit_code"];
	$order_id = (int)$invoice_info["order_id"];
	//$customer_info = get_customer($invoice_info["customer_id"]);
}

if ($_GET["order_id"]) {
	//$invoice_id = (int)$_GET["invoice_id"];
	//$invoice_info = get_deposit($invoice_id);
	$balance      = 0.00;
	$code         = $invoice_info["deposit_code"];
	$order_id = $_GET["order_id"];
	// $customer_info = get_customer($invoice_info["customer_id"]);
}

//get order data
if(!empty($order_id)){

	$order_info = get_order($order_id);
	$customer_info = get_customer($order_info["customer_id"]);


	$order_room_info = get_order_room($order_id);
	$order_room_list = "";
	foreach($order_room_info as $order_room){
		$room_info = get_room($order_room["room_id"]);
		$order_room_list .= check_combine_room($room_info["code"]).", ";
	}
	$order_info["order_room_list"] = substr_replace($order_room_list, "", -2);

	$order_room_dtl = "";
	foreach ($order_room_info as $order_room) {
		$room_info        = get_room($order_room["room_id"]);
		$master_room_info = get_master_room($room_info["master_room_id"]);
		$order_room_list  = check_combine_room($room_info["code"]) . " (" . $master_room_info["length"] . "'x" . $master_room_info["width"] . "'x" . $master_room_info["height"] . "')";
		//$order_room_list = substr_replace($order_room_list ,"",-2);
		$order_room_dtl .= "<table><tr><td>&nbsp;&nbsp;合約編號: " . $order_info["code"] .", 租用單位: " . $order_room_list . "</td></tr></table>";
	}
	
	$withdraw_remuneration = "";
	$actual_returnamount = "";
	$deposit_code = "";
	if ($_GET["invoice_id"]){
		$withdraw_remuneration = numberformat($order_info['withdraw_remuneration']);
		$actual_returnamount = $invoice_info["actual_returnamount"];
		$deposit_code = $invoice_info["deposit_code"];
	} else {
		$withdraw_remuneration = "0.00";
		$actual_returnamount = "0.00";
		$deposit_code = "不適用";
	}

	// check corporate client or personal client
	if($order_info["customer_typeid"] == "PERSONAL"){
		$idno = "Identification Number 身份證明號碼 :" . rsa_crypt($order_info["customer_identity_id"], 2);
		$name = $order_info["customer_name"];
	}else{
		$idno = "Business Registration No 商業登記證號碼 :" . rsa_crypt($order_info["customer_identity_id"], 2);
		$name = $order_info["customer_companyname"];
	}

	$content = "
		<!doctype html>
		<html lang='en'>
		<head>
			<meta charset='utf-8'>
			<title></title>
			<style>
				table {
					width: 100%;
				}

				* {
					font-family: 'simsun';
				}

				/** 
				Set the margins of the page to 0, so the footer and the header
				can be of the full height and width !
				**/
				@page {
					margin: 0cm 0cm;
				}

				/** Define now the real margins of every page in the PDF **/
				body {
					margin-top: 3cm;
					margin-left: 0.5cm;
					margin-right: 0.5cm;
					margin-bottom: 0.5cm;
				}

				/** Define the header rules **/
				header {
					position: fixed;
					top: 0cm;
					left: 0cm;
					right: 0cm;
					height: 3cm;
				}

				/** Define the footer rules **/
				footer {
					position: fixed; 
					bottom: 0cm; 
					left: 0cm; 
					right: 0cm;
					height: 2cm;
				}

				u {
					text-decoration: none;
					border-bottom: 1px solid #333;
					padding-bottom: 5px;
					display: inline-block;
					font-size: 11px;
				}

				td {
					font-size: 12px;
					word-wrap: break-word;
					padding: 0;
				}

				p {
					margin-top: 0;
					font-size: 11px;
				}

				.page_break {
					page-break-before: always;
				}

				.terms p {
					font-size: 10px;
					word-wrap: break-word;
				}

				.terms p.title {
					font-size: 15px;
					text-align: center;
					margin: 0;
				}
				
				.title {
					font-size: 24px;
					text-align: center;
					margin: 0;
				}
			</style>
		</head>
		<body>
			<header>
				<img src='http://" . $_SERVER['SERVER_NAME'] . "/webadmin/pdf_template/header.png' width='100%' height='100%'/>
			</header>
			<br>

			<table>
				<tr>
					<td style='font-size: 18px; text-align: center;'>
						<b>
							退倉收據
						</b>
					</td>
				</tr>
			</table>
			<hr>
			<br>

			<table>
				<tr>
					<td>客戶編號 : " . $customer_info["code"] . "</td>
					<td style='text-align: right;'>日期: " . date("Y-m-d") . "</td>
				</tr>
			</table>
			<table>
				<tr>
					<td>客戶姓名 : " . $name . "</td>
					<td style='text-align: right;'>編號 : " . $deposit_code . "</td>
				</tr>
			</table>
			<table>
				<tr>
					<td>客戶地址 : " . rsa_crypt($order_info["customer_address"], 2) . "</td>
					<td style='text-align: right;'>退倉日期: " . substr($order_info["withdraw_date"],0 ,10) . "</td>
				</tr>
			</table>

			<br>
			<table>
				<tr>
					<td style='font-size: 15px; font-weight: bold'>服務詳情</td>
					<td style='font-size: 15px; text-align: right; font-weight: bold;'>費用(HK$)</td>
				</tr>
			</table>

			<table>
				<tr>
					<td>按金</td>
					<td style='text-align: right;'>" . numberformat($invoice_info["deposit_amount"]) . "</td>
				</tr>
			</table>
			".$order_room_dtl."
				
			<br>
			<table>
				<tr>
					<td>合約到期日:". substr($order_info["enddate"],0 ,4) . "年" . substr($order_info["enddate"],5 ,2) . "月" . substr($order_info["enddate"],8 ,2) . "日" ." </td>
				</tr>
			</table>
			<table>
				<tr>
					<td>退還日期:".  substr($order_info["withdraw_date"],0 ,4) . "年" . substr($order_info["withdraw_date"],5 ,2) . "月" . substr($order_info["withdraw_date"],8 ,2) . "日" ."</td>
				</tr>
			</table>
			<table>
				<tr>
					<td>額外租金</td>
					<td style='text-align: right;'>" . $withdraw_remuneration . "</td>
				</tr>
			</table>

			<br>
			<table>
				<tr>
					<td style='text-align: right;'>_____________________________</td>
				</tr>
			</table>

			<br>
			<table>
				<tr>
					<td>實際退回按金</td>
					<td style='text-align: right;'>" . numberformat($actual_returnamount) . "</td>
				</tr>
			</table>
			<br><br><br>

			<b>備註 :</b>
			<p>**本公司未查核迷你倉的狀況,如發現迷你倉有損壞,本公司保留追討權利。</p>
			<p>按金會在15個工作天內以支票或銀行轉帳形式退還。</p>
		</body>
		</html>	
	";

	$options = new Options();
	$options->set('isHtml5ParserEnabled', true);
	$options->set('isRemoteEnabled', true);
	$options->set('isFontSubsettingEnabled', true);
	$dompdf = new Dompdf($options);
	$dompdf->loadHtml($content);
	$dompdf->render();
	if ($_GET['invoice_id']){
		$dompdf->stream("TerminationReceipt_" .  $order_info["order_room_list"] . "_" . $invoice_info["deposit_code"] . ".pdf");
		
	}  else {
		
		$dompdf->stream("TerminationReceipt_" .  $order_info["order_room_list"] . ".pdf");
	}

} else {
	echo "<script>alert('找不到相關發票。');history.back();</script>";
}
exit;

Youez - 2016 - github.com/yon3zu
LinuXploit