| Server IP : 104.21.37.246 / Your IP : 172.71.28.145 [ 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 : /home2/cp648411/public_html/kainumber.com/cart/ |
Upload File : |
<?php include('../include/header.php')?>
<?php $menu = 'cart';?>
<?php
if(isset($_POST['order_id']))
{
$_SESSION['order_id'] = $_POST['order_id'];
}
if($_SESSION['order_id'] == '')
{
?><meta http-equiv="refresh" content="0;URL=../home/index.php"><?php
exit;
}
?>
<?php include('../theme/menu.php')?>
<?php //include('../banner/index.php')?>
<?php //include('../theme/category.php')?>
<!-- /.body -->
<script type="text/javascript">
function PrintElem(elem)
{
Popup($(elem).html());
}
function Popup(data)
{
var mywindow = window.open('print_order.php', 'ใบสั่งซื้อสินค้า - kainumber', 'height=500,width=600');
mywindow.document.write('<html><head><title>ใบสั่งซื้อสินค้า - kainumber</title>');
/*optional stylesheet*/ //mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />');
mywindow.document.write('</head><body >');
mywindow.document.write(data);
mywindow.document.write('</body></html>');
mywindow.document.close(); // necessary for IE >= 10
mywindow.focus(); // necessary for IE >= 10
mywindow.print();
mywindow.close();
return true;
}
</script>
<div class="container mt-5 px-lg-5 px-3">
<div class="row px-md-5 mb-3 pt-md-5">
<div class="col-md-12 px-md-2 d-flex justify-content-between align-baseline" >
<div class="">
<h2 class="pb-0 mb-0 fw-loungethbold">
<?php if($_GET['s'] == 1 || $row['status'] == 7){?> เสร็จสิ้น !<?php }else{?> ไม่สำเสร็จ!!!<?php } ?>
</h2>
<!--<hr class="line1 my-1">-->
</div>
</div>
</div>
</div>
<div class="container mt-5 px-lg-5 px-3">
<div class="row px-md-5 mb-3">
<div class="col-md-12 px-md-2" >
<div class="row justify-content-center mb-5">
<div class="btn-group text-center" role="group" aria-label="Basic checkbox toggle button group">
<input type="checkbox" class="btn-check" id="btncheck1" autocomplete="off">
<label class="btn btn-secondary2" for="btncheck1">ขั้นตอนที่ 1</label>
<input type="checkbox" class="btn-check" id="btncheck2" autocomplete="off">
<label class="btn btn-secondary2" for="btncheck2">ขั้นตอนที่ 2</label>
<input type="checkbox" class="btn-check" id="btncheck3" autocomplete="off">
<label class="btn btn-secondary2" for="btncheck3">ขั้นตอนที่ 3</label>
<input type="checkbox" class="btn-check" id="btncheck3" autocomplete="off">
<label class="btn btn-secondary2" for="btncheck3">ขั้นตอนที่ 4</label>
<input type="checkbox" class="btn-check" id="btncheck3" autocomplete="off">
<label class="btn btn-secondary2 active-btn" for="btncheck3">ยืนยัน</label>
</div>
</div>
<div class="row">
<div class="col-12 col-md-12">
<?php
$sql = array('table'=>'orders','where'=>"id = '". $_SESSION['order_id'] ."'");
$view_sql = $view_db->view($sql);
$row = $view_db->q($view_sql);
?>
<?php if($_GET['s'] == 1){ ?>
<div style="padding:30px 0px;" align="center">
<style> .tb_receipt td{ padding:7px; } </style>
<table width="100%" border="0" class="tb_receipt">
<tr>
<td align="right"><img src="../image/text_logotop.png" width="200" class="img-responsive"></td>
</tr>
<tr>
<td>เลขที่ใบสั่งซื้อ : #<?php printf("%06d", $_SESSION['order_id']);?></td>
</tr>
<tr>
<td>วันที่สั่งสินค้า : <?php echo $util_class->day_num2($row['date_time']) ?></td>
</tr>
<?php
$dmy = $util_class->day_num4($row['date_time']);
/*$date = new DateTime(date("Y-m-d"));
$date->modify('+1 day');
$date_1 = $date->format('d/m/Y');*/
$date_1 = date("d/m/Y",date("U")+ 60*60*24);
?>
<tr>
<td>ชำระเงินภายในวันที่ : <?php echo $date_1 ?></td>
</tr>
</table>
<br>
<table width="100%" border="1" class="table tb_receipt rounded-4 text-light" style="border: 3px solid #ff7800;">
<tbody class="border-kai-bottom2" style="border-width: 0px;">
<tr align="center" class="border-kai-bottom2">
<td>หมายเลขโทรศัพท์</td>
<td>เครือข่าย</td>
<td>ราคา</td>
</tr>
<?php
$list1 = array('table'=>'order_detail','where'=>'id_order = "'.$_SESSION['order_id'].'"','order'=> "ORDER BY id ASC");
$view1 = $view_db->view($list1);
$result1 = $view_db->q_re($view1);
while($row1 = $view_db->q_ro($result1))
{
$sql2 = array('table'=>'phonenumber','where'=>"id = '". $row1['id_pho']."'");
$view_sql2 = $view_db->view($sql2);
$row2 = $view_db->q($view_sql2);
$network_img='';
if($row2['mobilenetwork']==1){$network_img='0222- ais.png';}
if($row2['mobilenetwork']==2){$network_img='01- ddd.png';}
if($row2['mobilenetwork']==3){$network_img='03- true.png';}
if($row2['mobilenetwork']==8){$network_img='05- yyyy.png';}
?>
<tr align="center" class="border-kai-bottom2">
<td><?php echo $Phone_class->phonenumber($row2['phonenumber']); ?></td>
<?php
$sql_type = array('table'=>'mobilenetwork','where'=>"id = '". $row2['mobilenetwork']."'");
$view_type = $view_db->view($sql_type);
$row_type = $view_db->q($view_type);
?>
<td class="border-kai-bottom2"><img src="../redbag/mobilenetwork/<?php echo $network_img;?>" width="58" ></td>
<td align="right"><?php echo $row2['price']; ?> บาท</td>
</tr>
<?php
$p_price = str_replace("," , "" ,$row2['price']);
$sum_price = $sum_price + $p_price;
}
?>
<tr>
<td align="right" colspan="2">รวม</td>
<td align="right"><?php echo number_format($sum_price);?> บาท</td>
</tr>
<tr>
<td align="right" colspan="2">ค่าจัดส่ง</td>
<td align="right"><?php echo number_format($row['delivery']);?> บาท</td>
</tr>
<?php
$total = $sum_price + $row['delivery'];
?>
<?php
$day_to = date('Y-m-d');
$sql_ds = array('table'=>'code','where'=>"code = '".$row['discount_c']."' AND expirationdate >= '".$day_to."'");
$view_ds = $view_db->view($sql_ds);
$row_ds = $view_db->q($view_ds);
if($row_ds['id'] > 0)
{
if($row_ds['type'] == 1)
{
$discount_t = $row_ds['money'].' บาท';
$total = $total - $row_ds['money'];
}
if($row_ds['type'] == 2)
{
$discount_t = $row_ds['money'].' %';
$money = $total * $row_ds['money']/100;
$total = $total - $money;
}
?>
<tr>
<td align="right" colspan="2">ส่วนลด</td>
<td align="right"><?php echo $discount_t;?></td>
</tr>
<?php } ?>
<tr>
<td align="right" colspan="2">ราคารวม</td>
<td align="right"><?php echo number_format($total);?> บาท</td>
</tr>
</tbody>
</table>
<br><br><br>
คุณได้ทำการสั่งซื้อสินค้าเรียบร้อยแล้วค่ะ !! <br>
ทางระบบกำลังจะส่งรายละเอียดคำสั่งซื้อไปให้ทางEmailของท่าน<br>
ขอบคุณที่ใช้บริการของเราค่ะ<br><br><br>
คุณสามารถชำระเงินได้ที่<br>
<?php
$list_de = array('table'=>'payment_method','where'=>'id = 1 AND status = 1','order'=> "ORDER BY id ASC");
$view_de = $view_db->view($list_de);
$row_de = $view_db->q($view_de);
echo $row_de['detail'];
?>
</div>
<div class="row mb-3 text-center mt-3">
<div class="col-sm-offset-2 col-sm-12">
<input type="hidden" name="confirm" value="cm4">
<input class="btn btn-default corner_cancel btn-kai1 px-3" type="button" value="พิมพ์ใบสั่งซื้อ" onClick="PrintElem('#orders2')" style="color:#FFF;">
</div>
</div>
<?php
}
else if($row['status'] == 7)
{
?>
<div style="padding:30px 0px;" align="center">
คุณได้ทำการสั่งซื้อสินค้าและชำระเงินเรียบร้อยแล้วค่ะ !! <br>
ขอบคุณที่ใช้บริการของเราค่ะ<br>
</div>
<div class="row mb-3 text-center mt-3">
<div class="col-sm-offset-2 col-sm-12">
<input type="hidden" name="confirm" value="cm4">
<input class="btn btn-default corner_cancel btn-kai1 px-3" type="button" value="พิมพ์ใบสั่งซื้อ" onClick="PrintElem('#orders2')" style="color:#FFF;">
</div>
</div>
<?php
}
else if($row['status'] >= 8 && $row['status'] <= 11)
{
?>
<div style="padding:30px 0px;color:#F00;" align="center">
เกิดข้อผิดพลาด !! <br>
การชำระเงินไม่สำเร็จ<br>
</div>
<?php
}
else
{
?>
<div style="padding:30px 0px;color:#F00;" align="center">
ข้ออภัย ระบบขัดข้อง!!! <br>
กรุณาลองใหม่อีกครั้ง
</div>
<?php
}
?>
</div>
<div id="orders2" style="display:none">
<table width="100%" border="0">
<tr>
<td align="right"><img src="../image/text_logotop.png" width="200" class="img-responsive"></td>
</tr>
<tr>
<td>เลขที่ใบสั่งซื้อ : #<?php printf("%06d", $_SESSION['order_id']);?></td>
</tr>
<tr>
<td>วันที่สั่งสินค้า : <?php echo $util_class->day_num2($row['date_time']) ?></td>
</tr>
<?php
$dmy = $util_class->day_num4($row['date_time']);
/*$date = new DateTime(date("Y-m-d"));
$date->modify('+1 day');
$date_1 = $date->format('d/m/Y');*/
$date_1 = date("d/m/Y",date("U")+ 60*60*24);
?>
<tr>
<td>ชำระเงินภายในวันที่ : <?php echo $date_1 ?></td>
</tr>
</table>
<div style="border:1px solid #000;margin-top:15px;">
<table width="100%" border="0">
<tr>
<td>ที่อยู่สำหรับจัดส่งสินค้า</td>
</tr>
<tr>
<td><?php echo $row['name'] .' '. $row['lastname'];?></td>
</tr>
<tr>
<td><?php echo $row['address'] .' '. $row['province'] .' '. $row['zipcode']?></td>
</tr>
<tr>
<td>โทรศัพท์ <?php echo $Phone_class->phonenumber($row['phone']);?></td>
</tr>
</table>
</div>
<br><br>
<table width="100%" border="1" align="center" cellpadding="5" cellspacing="0">
<tr align="center">
<td>หมายเลขโทรศัพท์</td>
<td>เครือข่าย</td>
<td>ราคา</td>
</tr>
<?php
$sum_price = 0;
$list1 = array('table'=>'order_detail','where'=>'id_order = "'.$_SESSION['order_id'].'"','order'=> "ORDER BY id ASC");
$view1 = $view_db->view($list1);
$result1 = $view_db->q_re($view1);
while($row1 = $view_db->q_ro($result1))
{
$sql2 = array('table'=>'phonenumber','where'=>"id = '". $row1['id_pho']."'");
$view_sql2 = $view_db->view($sql2);
$row2 = $view_db->q($view_sql2);
?>
<tr align="center">
<td><?php echo $Phone_class->phonenumber($row2['phonenumber']); ?></td>
<?php
$sql_type = array('table'=>'mobilenetwork','where'=>"id = '". $row2['mobilenetwork']."'");
$view_type = $view_db->view($sql_type);
$row_type = $view_db->q($view_type);
?>
<td><img src="../redbag/mobilenetwork/<?php echo $row_type['image'];?>" width="38" height="19"></td>
<td align="right"><?php echo $row2['price']; ?> บาท</td>
</tr>
<?php
$p_price = str_replace("," , "" ,$row2['price']);
$sum_price = $sum_price + $p_price;
}
?>
<tr>
<td align="right" colspan="2">รวม</td>
<td align="right"><?php echo number_format($sum_price);?> บาท</td>
</tr>
<tr>
<td align="right" colspan="2">ค่าจัดส่ง</td>
<td align="right"><?php echo number_format($row['delivery']);?> บาท</td>
</tr>
<?php
$total = $sum_price + $row['delivery'];
?>
<?php
$day_to = date('Y-m-d');
$sql_ds = array('table'=>'code','where'=>"code = '".$row['discount_c']."' AND expirationdate >= '".$day_to."'");
$view_ds = $view_db->view($sql_ds);
$row_ds = $view_db->q($view_ds);
if($row_ds['id'] > 0)
{
if($row_ds['type'] == 1)
{
$discount_t = $row_ds['money'].' บาท';
$total = $total - $row_ds['money'];
}
if($row_ds['type'] == 2)
{
$discount_t = $row_ds['money'].' %';
$money = $total * $row_ds['money']/100;
$total = $total - $money;
}
?>
<tr>
<td align="right" colspan="2">ส่วนลด</td>
<td align="right"><?php echo $discount_t;?></td>
</tr>
<?php
}
?>
<tr>
<td align="right" colspan="2">ราคารวม</td>
<td align="right"><?php echo number_format($total);?> บาท</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- /.body -->
<?php include('../include/footer.php')?>
<?php include('../include/footer_js.php')?>