| 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 : |
<?php
require_once('check_login.php');
$order_info = get_order((int)$_GET["order_id"]);
//$customer_info = get_customer($order_info["customer_id"]);
$order_discount_info = get_order_discount((int)$_GET["order_id"]);
$order_product_info = get_order_product((int)$_GET["order_id"]);
$order_room_info = get_order_room((int)$_GET["order_id"]);
$sql99 = "SELECT * FROM sys_cms_login WHERE cmsloginid=?";
$parameters99 = array((int)$order_info{'lastupby'});
$row99 = bind_pdo($sql99, $parameters99, "selectone");
?>
<!DOCTYPE html>
<html>
<head>
<?php require_once("html_head.php"); ?>
<style>
table input[type='text'], table textarea {
width: 95%;
}
.need_delivery_service {
display: none;
}
</style>
<script type="text/javascript">
function check_form() {
var confirm_text = "";
if ($("select[name='order_status']").val() == "VOID") {
confirm_text = "合約狀態改為'取消',相關的按金,租金及其他發票將同時取消。 確定要修改這張合約?";
} else {
confirm_text = "確定要修改這張合約?";
}
if (confirm(confirm_text)) {
$("#order_modify").submit();
}
}
$(function () {
<?php if(isset($_GET["print"]) && (int)$_GET["print"] == 1){ ?>
$("#printing").trigger("click");
<?php }else if(isset($_GET["print"]) && (int)$_GET["print"] == 2){ ?>
$("#printing2").trigger("click");
<?php } ?>
});
</script>
</head>
<body>
<form action="order_modify.php" method="post" name="modifyform" id="order_modify" enctype="multipart/form-data">
<input type="hidden" name="order_id" value="<?= (int)$_GET["order_id"]; ?>"/>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="70" align="right" valign="middle" class="icontxt">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="150" align="center" style="font-size: 12px;">
<div onclick="location.href='output_order3b.php?order_id=<?= $_GET["order_id"] ?>'" style="cursor:pointer;" id="printing2">
<img src="images/print.png" width="32" height="32" border="0"/> <br> 合併列印(合約,租金,付款)(Excel) </a>
</div>
</td>
<td width="150" align="center" style="font-size: 12px;">
<div onclick="location.href='output_order3.php?order_id=<?= $_GET["order_id"] ?>'" style="cursor:pointer;" id="printing2">
<img src="images/print.png" width="32" height="32" border="0"/> <br> 合併列印(合約,租金,付款) </a>
</div>
</td>
<td width="50" align="center" style="font-size: 12px;">
<div onclick="location.href='output_order2b.php?order_id=<?= $_GET["order_id"] ?>'" style="cursor:pointer;" id="printing">
<img src="images/print.png" width="32" height="32" border="0"/> <br> 列印(Excel) </a>
</div>
</td>
<td width="50" align="center" style="font-size: 12px;">
<div onclick="location.href='output_order2.php?order_id=<?= $_GET["order_id"] ?>'" style="cursor:pointer;" id="printing">
<img src="images/print.png" width="32" height="32" border="0"/> <br> 列印 </a>
</div>
</td>
<td width="50" align="center" style="font-size: 12px;">
<div onclick="check_form();">
<img src="images/iconSave.png" width="32" height="32" border="0"/>
</div>
<!--<input type="image" alt="submit" src="images/iconSave.png" width="32" height="32" border="0"><br>-->
儲存 </a>
</td>
<td width="50" align="center">
<a href="order_index.php?<?php
if (isset($_SESSION["index_url_parameter"])){
if(substr($_SESSION["index_url_parameter"],-18) == urlencode("取消")){
echo $_SESSION["index_url_parameter"];
} else {
echo $_SESSION["index_url_parameter"] . "&msg=取消";
}
}
?>"
>
<img src="images/iconCancel.png" alt="取消" width="32" height="32" border="0"><br>
取消
</a>
</td>
<td> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<span style="float:left;" class="pagetitletxt">
<b><img src="images/iconList.jpg" width="48" height="48" align="absmiddle"/> 合約詳情
</b></span><span style="float:right;" class="msg">最近更新: <?= $row99{'cmsusername'} . ' ' . $order_info{'lastupdate'}; ?></span>
</td>
</tr>
<tr>
<td align="left" valign="middle"><!-- Content -->
<table style="width: 1000px; padding-left: 15px;">
<tr>
<td>
<p>建立日期: </p>
</td>
<td><?= substr($order_info["createdate"], 0, 10) ?></td>
</tr>
<tr>
<td>
<p>狀態: </p>
</td>
<td>
<?php
if ($order_info["status"] == "VOID") {
$order_status_info = get_master_type_code("ORDER_STATUS", $order_info["status"]);
echo $order_status_info["name_tc"];
} else {
echo "<select name='order_status'>";
$order_status_info = get_master_type_code("ORDER_STATUS");
foreach ($order_status_info as $order_status) {
if ($order_status["code"] == $order_info["status"]) {
$selected = "selected";
} else {
$selected = "";
}
if ($order_status["code"] == "REVISED" || $order_status["code"] == "COMPLETED" || $order_status["code"] == "TERMINATION") {
$disabled = " disabled";
} else {
$disabled = "";
}
echo "<option value='" . $order_status["code"] . "' " . $selected . $disabled . ">" . $order_status["name_tc"] . "</option>";
}
print "</select>";
if ($order_info["status"] == "COMPLETED" || $order_info["status"] == "TERMINATION") {
echo " <span style='font-size: 15px;'>退倉日期: " . substr($order_info["withdraw_date"], 0, 10) . "</span>";
}
}
?>
</td>
</tr>
<tr>
<td>
<p>合約編號: </p>
</td>
<td>
<?= $order_info["code"]; ?>
</td>
</tr>
<tr>
<td>
<p>客戶編號: </p>
</td>
<td>
<a href="customer_modifyform.php?id=<?= $order_info["customer_id"]; ?>" target="_blank">
<?= $order_info["customer_code"]; ?>
</a>
</td>
</tr>
<tr>
<td style="width: 150px;">
<p>客戶類型: </p>
</td>
<td style="min-width: 400px;">
<?php
$customer_type = get_master_type_code("CUSTOMER_TYPE", $order_info["customer_typeid"]);
echo $customer_type["name_tc"];
?>
<br>
</td>
</tr>
<?php if ($order_info["customer_typeid"] == "PERSONAL") { ?>
<tr>
<td>
<p>證明文件號碼: </p>
</td>
<td>
<?php
/*if($order_info["customer_typeid"] == "BUSINESS")
echo rsa_crypt($order_info["customer_hkbr"], 2);*/
//if($order_info["customer_typeid"] == "PERSONAL")
echo rsa_crypt($order_info["customer_hkid"], 2);
?>
</td>
</tr>
<?php } ?>
<tr>
<td>
<p>姓氏: </p>
</td>
<td>
<input type="text" name="customer_lastname" value="<?= rsa_crypt($order_info["customer_lastname"], 2); ?>">
</td>
</tr>
<tr>
<td>
<p>名字: </p>
</td>
<td>
<input type="text" name="customer_firstname" value="<?= rsa_crypt($order_info["customer_firstname"], 2); ?>">
</td>
</tr>
<?php if ($order_info["customer_typeid"] == "BUSINESS") { ?>
<tr>
<td>
<p>公司名稱: </p>
</td>
<td>
<input type="text" name="customer_companyname" value="<?=$order_info["customer_companyname"]; ?>">
</td>
</tr>
<?php } ?>
<?php //if ($order_info["customer_typeid"] == "PERSONAL") {?>
<?php if (!empty($order_info["customer_email"])) {?>
<tr>
<td>
<p>聯絡電郵: </p>
</td>
<td>
<input type="text" name="customer_email" value="<?= rsa_crypt($order_info["customer_email"], 2); ?>">
</td>
</tr>
<?php } ?>
<tr>
<td>
<p>聯絡電話: </p>
</td>
<td>
<input type="text" name="customer_tel" value="<?= rsa_crypt($order_info["customer_tel"], 2); ?>">
</td>
</tr>
<tr>
<td>
<p>聯絡地址: </p>
</td>
<td>
<input type="text" name="customer_address" value="<?= rsa_crypt($order_info["customer_address"], 2); ?>">
</td>
</tr>
<tr>
<td>已選取倉庫</td>
<td>
<table border="1" cellpadding="5" style="border-collapse: collapse;">
<tr>
<td>倉庫編號</td>
<td>原價格(月)</td>
<td>價格(月)</td>
<td>預繳 / 特價優惠</td>
</tr>
<?php
if (!empty($order_room_info)) {
foreach ($order_room_info as $order_room) {
$room_info = get_room($order_room["room_id"]);
echo "<tr>
<td>" . check_combine_room($room_info["code"]) . "</td>
<td>$" . numberformat($order_room["retail_price"]) . "</td>
<td>$" . numberformat($order_room["discounted_price"]) . "</td>
";
echo "<td>";
if (!empty($order_discount_info)) {
foreach ($order_discount_info as $order_discount) {
if ($order_discount["room_id"] == $order_room["room_id"]) {
echo $order_discount["name_tc"] . ": " . $order_discount["order_discount_discount"] . $order_discount["discount_type"] . "<br>";
}
}
} else {
echo "-";
}
echo "</td>";
echo "</tr>";
}
}
?>
</table>
</td>
</tr>
<tr>
<td>
<p>大約面積 : </p>
</td>
<td>
<?php
//unit change
if($order_info["createdate"] > "2017-04-27 18:00:00"){
$unit = "平方呎";
}else{
$unit = "立方呎";
}
echo $order_info["roughly_size"].$unit;
?>
</td>
</tr>
<tr>
<td>
<p>每月租金(折扣後) : </p>
</td>
<td>
$<?= numberformat($order_info["total_discounted_price"]); ?>
</td>
</tr>
<tr>
<td>
<p>按金 : </p>
</td>
<td>
$<?= numberformat($order_info["deposit"]); ?>
</td>
</tr>
<tr>
<td>
<p>租用期 : </p>
</td>
<td>
<?= $order_info["rent_month"]; ?>
月
</td>
</tr>
<tr>
<td>
<p>預繳 : </p>
</td>
<td>
<?php
if ($order_info["prepaid_month"] == 0) {
echo "-";
} else {
echo $order_info["prepaid_month"] . "月";
}
?>
</td>
</tr>
<tr>
<td>
<p>首月半價 : </p>
</td>
<td>
<?php
//if (!empty($order_info["free_first_month_deduct"]) && ($order_info["discount_deduct"]-) > 0) {
if ((float)($order_info["free_first_month_deduct"]) && ($order_info["discount_deduct"]-$order_info["last_paid"]) > 0) {
echo '<input type="checkbox" name="free_first_month" value="1" checked disabled>';
} else {
echo "-";
}
?>
</td>
</tr>
<tr>
<td>
<p>免2個月租金 : </p>
</td>
<td>
<?php
//if (!empty($order_info["free_first_month_deduct"]) && ($order_info["discount_deduct"]-) > 0) {
if ((float)($order_info["free_2_month_deduct"]) && ($order_info["discount_deduct"]-$order_info["last_paid"]) > 0) {
echo '<input type="checkbox" name="free_2_month_deduct" value="'.$order_info["free_2_month_deduct"].'" checked disabled>';
} else {
echo "-";
}
?>
</td>
</tr>
<tr>
<td>
<p>優惠金額 : </p>
</td>
<td>
$<?= numberformat($order_info["discount_amount"]); ?>
</td>
</tr>
<tr>
<td>
<p>已付款項 : </p>
</td>
<td>
$<?= numberformat($order_info["last_paid"]); ?>
</td>
</tr>
<tr>
<td>
<p>入倉日期 : </p>
</td>
<td>
<?= $order_info["warehousing_date"]; ?>
</td>
</tr>
<tr>
<td>
<p>租約期 : </p>
</td>
<td>
<?= $order_info["startdate"]; ?> 至
<?= $order_info["enddate"]; ?>
</td>
</tr>
<tr>
<td>
<p>已選購物品 : </p>
</td>
<td>
<?php if (!empty($order_product_info)) { ?>
<table cellpadding="5" id="product_table">
<tr>
<td>
名稱
</td>
<td>
數量
</td>
<td>
價錢
</td>
<td>
小計
</td>
</tr>
<?php
$order_product_total = 0;
foreach ($order_product_info as $product) {
$product_info = get_product($product["product_id"]);
echo "<tr>
<td>" . $product_info["name_tc"] . "</td>
<td>" . (int)$product["qty"] . "</td>
<td>$" . numberformat($product["price"]) . "</td>
<td>$" . numberformat($product["price"] * $product["qty"]) . "</td>
</tr>";
$order_product_total += $product["price"] * $product["qty"];
}
?>
</table>
<?php echo "<br>總計: $" . numberformat($order_product_total);
} else echo "-"; ?>
</td>
</tr>
<tr>
<td>
<p>運輸服務 : </p>
</td>
<td>
<?php if ($order_info["transport_enable"] == "1") echo "需要"; else echo "不需要"; ?>
</td>
</tr>
<?php if ($order_info["transport_enable"] == "1") { ?>
<tr>
<td>
<p>服務日期 : </p>
</td>
<td>
<?= $order_info["transport_date"]; ?>
</td>
</tr>
<tr>
<td>
<p>起點 : </p>
</td>
<td>
<?= $order_info["transport_address"]; ?>
</td>
</tr>
<tr>
<td>
<p>終點 : </p>
</td>
<td>
<?= $order_info["transport_destination"]; ?>
</td>
</tr>
<?php } ?>
<tr>
<td>
<p>門卡號碼 : </p>
</td>
<td>
<input type="text" name="room_key" value="<?= $order_info["room_key"]; ?>"> <br>
<span style="color: red; font-size: 12px;">請使用","去分隔門卡號碼</span>
</td>
</tr>
<tr>
<td>
<p>備註 : </p>
</td>
<td>
<textarea name="remark" style="height: 100px;"><?= ($order_info["remark"]); ?></textarea>
</td>
</tr>
<tr>
<td>
<p>按金付款方式 : </p>
</td>
<td>
<?php
$paymethod = get_master_type_code("PAYMENT_METHOD", $order_info["paymethod"]);
echo $paymethod["name_tc"];
if ($order_info["paymethod"] == "CHEQUE") {
echo '<br>
銀行名稱 : ' . '<input type="text" name="bank_name" value="' . $order_info["bank_name"] . '" style="display: inline;"><br>
支票號碼 : ' . '<input type="text" name="cheque_num" value="' . $order_info["cheque_num"] . '">';
}
if ($order_info["paymethod"] == "OTHER" || $order_info["paymethod"] == "BANKIN") {
echo '<br>' . $order_info["paymethod_other"];
}
?>
</td>
</tr>
<tr>
<td>
<p>租金付款方式 : </p>
</td>
<td>
<?php
if (empty($order_info["paymethod2"])) {
$paymethod = get_master_type_code("PAYMENT_METHOD", $order_info["paymethod"]);
echo $paymethod["name_tc"];
if ($order_info["paymethod"] == "CHEQUE") {
echo '<br>
銀行名稱 : ' . '<input type="text" name="bank_name" value="' . $order_info["bank_name"] . '"><br>
支票號碼 : ' . '<input type="text" name="cheque_num" value="' . $order_info["cheque_num"] . '">';
}
if ($order_info["paymethod"] == "OTHER" || $order_info["paymethod"] == "BANKIN") {
echo '<br>' . $order_info["paymethod_other"];
}
} else {
$paymethod = get_master_type_code("PAYMENT_METHOD", $order_info["paymethod2"]);
echo $paymethod["name_tc"];
if ($order_info["paymethod2"] == "CHEQUE") {
echo '<br>
銀行名稱 : ' . '<input type="text" name="bank_name2" value="' . $order_info["bank_name2"] . '"><br>
支票號碼 : ' . '<input type="text" name="cheque_num2" value="' . $order_info["cheque_num2"] . '">';
}
if ($order_info["paymethod2"] == "OTHER" || $order_info["paymethod2"] == "BANKIN") {
echo '<br>' . $order_info["paymethod_other2"];
}
}
?>
</td>
</tr>
<tr>
<td>
<p>合約總計 : </p>
</td>
<td>
$<?= numberformat($order_info["original_amount"]); ?>
</td>
</tr>
<tr>
<td>
<p>扣減 : </p>
</td>
<td>
$<?= numberformat($order_info["discount_deduct"]); ?>
<br> (已付款項+首月半價+免2個月租金+優惠金額)
</td>
</tr>
<tr>
<td>
<p>合約總計(折扣後) : </p>
</td>
<td>
$<?= numberformat($order_info["balance"]); ?>
</td>
</tr>
<tr>
<td>
<p>定期自動付款服務 : </p>
</td>
<td>
<?php
if ($order_info["recurring_payment"] == 1) {
echo "是";
} else {
echo "否";
}
?>
</td>
</tr>
<tr>
<td>
<p>透過網上租倉 : </p>
</td>
<td>
<?php
if ($order_info["is_online_order"] == 1) {
echo "是";
} else {
echo "否";
}
?>
</td>
</tr>
</table>
<br><br>
<!-- End Content -->
</td>
</tr>
</table>
</form>
</body>
</html>