| 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');
if (empty($_GET["location_id"])) {
$location_id = 1;
} else {
$location_id = (int)$_GET["location_id"];
}
$discount_type = (int)$_GET["discount_type"];
if ($discount_type == 1) { //預繳優惠
$title = "預繳";
$sql = "select * from master_type_code where typeid = ? and code != ? and deleted = ? order by sort ASC";
$parameters = array("PAYMENT_TERM", "SPECIFIC_SIZE", 0);
$discount_option_info = bind_pdo($sql, $parameters, "selectall");
}
if ($discount_type == 2) { //指定單位優惠
$title = "指定單位";
$sql = "select * from master_type_code where typeid = ? and code = ? and deleted = ? order by sort ASC";
$parameters = array("PAYMENT_TERM", "SPECIFIC_SIZE", 0);
$discount_option_info = bind_pdo($sql, $parameters, "selectall");
}
$master_room_info = get_master_room(null, $location_id);
$locations = get_location();
?>
<!DOCTYPE html>
<html>
<head>
<?php require_once('html_head.php'); ?>
<script type="text/javascript">
$(function () {
$("#effectivedate_from").datepicker({dateFormat: 'yy-mm-dd'});
$("#effectivedate_to").datepicker({dateFormat: 'yy-mm-dd'});
$("#check_all").on("click", function () {
if ($(this).prop("checked")) {
$(".master_room").attr("checked", true);
} else {
$(".master_room").attr("checked", false);
}
if ($("#check_all_remark").text() == "全選") {
$("#check_all_remark").text("取消全選");
} else {
$("#check_all_remark").text("全選");
}
});
});
</script>
<style>
.room_size_checkbox {
width: 160px;
height: 30px;
display: inline-block;
vertical-align: top;
margin-top: 10px;
}
</style>
</head>
<body>
<form action="discount_add.php" method="post" name="addform" enctype="multipart/form-data">
<input type="hidden" name="discount_type" value="<?= (int)$_GET["discount_type"] ?>"/>
<input type="hidden" name="location_id" value="<?= (int)$_GET["location_id"] ?>"/>
<table width="1100" 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="50" align="center" style="font-size: 12px;">
<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="discount_index.php?discount_type=<?= (int)$_GET["discount_type"] ?>&msg=取消&location_id=<?= (int)$_GET["location_id"] ?>"><img
src="images/iconCancel.png" alt="Cancel" width="32" height="32" border="0"><br>
取消 </a></td>
<td> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="pagetitletxt">
<b><img src="images/iconList.jpg" width="48" height="48" align="absmiddle"/>新增 優惠設定(<?= $title ?>)</b>
</td>
</tr>
<tr>
<td align="left" valign="middle"><!-- Content -->
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td width="150" align="right" valign="top" class='content'>樓層</td>
<td width="5" valign="top" class='content'>: </td>
<td class='content'>
<select name="location_id" style="margin-bottom: 10px;"
onchange="location.href='discount_addform.php?discount_type=<?= $discount_type ?>&location_id='+this.value;">
<?php
foreach ($locations as $location) {
if ($location["location_id"] == 1) {
$name = "所有樓層";
} else {
$name = "只限" . $location["location_code"] . " " . $location["location_name_tc"];
}
echo "<option value='" . $location["location_id"] . "' " . ($location_id == $location["location_id"] ? "selected" : "") . ">" . $name . "</option>";
}
?>
</select>
<br>
</td>
</tr>
<tr>
<td width="150" align="right" valign="top" class='content'>倉庫尺寸</td>
<td width="5" valign="top" class='content'>: </td>
<td class='content'>
<!--<select name="master_room_id">
<?php
/* if($_GET["discount_type"] == 1)
echo "<option value='ALL'>所有</option>";
foreach($master_room_info as $master_room){
echo "<option value='".$master_room["id"]."'>".$master_room["length"]." X ".$master_room["width"]." X ".$master_room["height"]."</option>";
}
*/ ?>
</select>-->
<div style="width: 800px;">
<input type="checkbox" id="check_all"> <span id="check_all_remark">全選</span>
<br>
<?php
foreach ($master_room_info as $master_room) {
if ($master_room["location_id"] > 1) {
$check_if_f12_has_this_size = check_if_f12_has_this_size($master_room["id"]);
if (!$check_if_f12_has_this_size) {
//echo '<div style="width: 160px; height: 50px; display: inline-block;vertical-align: top;"><input type="checkbox" name="master_room_ids[]" value="'.$master_room["id"].'" class="master_room">'.$master_room["length"]." X ".$master_room["width"]." X ".$master_room["height"]. ($master_room{"display_size"} != ($master_room{'length'}) . "' x " . ($master_room{'width'}) . "' x " . ($master_room{'height'}) . "'" ? "<br> (" . $master_room{"display_size"} . ")" : "").'</div>';
//echo '<div style="width: 160px; height: 30px; display: inline-block;vertical-align: top;"><input type="checkbox" name="master_room_ids[]" value="'.$master_room["id"].'" class="master_room">'.$master_room["length"]." X ".$master_room["width"]." X ".$master_room["height"].'</div>';
echo '<div class="room_size_checkbox"><input type="checkbox" name="master_room_ids[]" value="' . $master_room["id"] . '" class="master_room">' . $master_room["length"] . " X " . $master_room["width"] . " X " . $master_room["height"] . '' . ($master_room{"display_size"} != ($master_room{'length'}) . "' x " . ($master_room{'width'}) . "' x " . ($master_room{'height'}) . "'" ? "<br> (" . $master_room{"display_size"} . ")" : "") . '</div>';
}
} else {
//echo '<div style="width: 160px; height: 50px; display: inline-block; vertical-align: top;"><input type="checkbox" name="master_room_ids[]" value="'.$master_room["id"].'" class="master_room">'.$master_room["length"]." X ".$master_room["width"]." X ".$master_room["height"]. ($master_room{"display_size"} != ($master_room{'length'}) . "' x " . ($master_room{'width'}) . "' x " . ($master_room{'height'}) . "'" ? "<br> (" . $master_room{"display_size"} . ")" : "").'</div>';
//echo '<div style="width: 160px; height: 30px; display: inline-block; vertical-align: top;"><input type="checkbox" name="master_room_ids[]" value="'.$master_room["id"].'" class="master_room">'.$master_room["length"]." X ".$master_room["width"]." X ".$master_room["height"].'</div>';
echo '<div class="room_size_checkbox"><input type="checkbox" name="master_room_ids[]" value="' . $master_room["id"] . '" class="master_room">' . $master_room["length"] . " X " . $master_room["width"] . " X " . $master_room["height"] . ($master_room{"display_size"} != ($master_room{'length'}) . "' x " . ($master_room{'width'}) . "' x " . ($master_room{'height'}) . "'" ? "<br> (" . $master_room{"display_size"} . ")" : "") . '</div>';
}
//echo '<div style="width: 120px; float: left;"><input type="checkbox" name="master_room_ids[]" value="'.$master_room["id"].'" class="master_room">'.$master_room["length"]." X ".$master_room["width"]." X ".$master_room["height"].'</div>';
}
?>
<div style="clear: both;"></div>
</div>
<br>
</td>
</tr>
<tr>
<td width="150" align="right" valign="top" class='content'>優惠類型</td>
<td width="5" valign="top" class='content'>: </td>
<td class='content'>
<select name="payment_term">
<?php
foreach ($discount_option_info as $discount_option) {
echo "<option value='" . $discount_option["code"] . "'>" . $discount_option["name_tc"] . " </option>";
}
?>
</select>
<br><br>
</td>
</tr>
<tr>
<td width="150" align="right" valign="top" class='content'>優惠折扣</td>
<td width="5" valign="top" class='content'>: </td>
<td class='content'>
<input type="text" name="discount" class="content" required="required"/> % (eg: 20% -> 8折)
<br><br>
</td>
</tr>
<tr>
<td width="150" align="right" valign="top" class='content'>最後折扣 (不可折上折)</td>
<td width="5" valign="top" class='content'>: </td>
<td class='content'>
<input type="checkbox" class="content" name="is_final_discount" id="is_final_discount" value="1">
<br>
<span class="msg">折扣順序: 先進行預繳折扣,然後進行指定尺寸折扣。</span>
<br><br>
</td>
</tr>
<tr>
<td width="150" align="right" valign="top" class='content'>開始日期</td>
<td width="5" valign="top" class='content'>: </td>
<td class='content'>
<input type="text" class="content" name="effectivedate_from" id="effectivedate_from" required="required">
<br><br>
</td>
</tr>
<tr>
<td width="150" align="right" valign="top" class='content'>完結日期</td>
<td width="5" valign="top" class='content'>: </td>
<td class='content'>
<input type="text" class="content" name="effectivedate_to" id="effectivedate_to" required="required">
<br><br>
</td>
</tr>
<tr>
<td width="150" align="right" valign="top" class='content'>前台顯示優惠</td>
<td width="5" valign="top" class='content'>: </td>
<td class='content'>
<input type="radio" class="content" name="show_frontend" id="show_frontend" value="1"> 顯示
<input type="radio" class="content" name="show_frontend" id="show_frontend" value="0" checked> 不顯示
<br>
<span class="msg">同尺寸的優惠最多在前台顯示2個,按預付月份較大排序。</span>
<br><br>
</td>
</tr>
</table>
<!-- End Content -->
</td>
</tr>
<tr>
<td align="left" valign="middle"> </td>
</tr>
</table>
</form>
</body>
</html>