| Server IP : 172.67.216.113 / Your IP : 172.71.28.146 [ 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/simded.com/cart/ |
Upload File : |
<?php
include('../include72/header.php');
include('../themes/menu.php');
?>
<?php
// init variables
$min_number = 10;
$max_number = 30;
// generating random numbers
$random_number1 = mt_rand($min_number, $max_number);
$random_number2 = mt_rand($min_number, $max_number);
?>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="row" style="margin-top:25px;">
<div class="col-md-12" style="margin-bottom:10px;">
<p class="HeadText" style="text-align:left">ตะกร้าสินค้า</p>
<p style="font-size:30px;">รายการสั่งซื้อของคุณ</p>
<span id="alert_listcart"></span>
<div class="div_com">
<table class="table tb_list_cart">
<thead>
<tr>
<th>ร้านค้า</th>
<th width="25%">เบอร์ที่สั่งซื้อ</th>
<th width="20%">เครือข่าย</th>
<th width="25%">ราคา/บาท</th>
<th width="10%">ลบสินค้า</th>
</tr>
</thead>
<tbody>
<?php
if(count($_SESSION["cart"]) == 0)
{
?>
<tr>
<td colspan="5"><div class="td_end"> ไม่สินค้าในรายการ </div></td>
</tr>
<?php
}
else
{
$total = 0;
foreach ($_SESSION["cart"] as $key => $value)
{
$list = array('table'=>'phonenumber','where'=>'id = "'.$value.'"','order'=> "ORDER BY id DESC");
$view = $view_db->view($list);
$row = $view_db->q($view);
if(!$row){
$list = array('table'=>'carregistration','where'=>'carregistration = "'.$value.'"','order'=> "ORDER BY id DESC");
$view = $view_db->view($list);
$row = $view_db->q($view);
$phonenumber =$row['carregistration'];
$row_mobilenetwork = '';
$list_shr = array('table'=>'shop','where'=>'id = "'.$row['id_shop'].'" ');
$view_shr = $view_db->view($list_shr);
$row_shr = $view_db->q($view_shr);
}else{
$phonenumber = $Phone_class->format_phonenumber($row['phonenumber'],$row['format']);
$row_mobilenetwork = $actiondata_db->q_one('mobilenetwork','id = "'.$row['mobilenetwork'].'"','image');
$list_shr = array('table'=>'shop','where'=>'id = "'.$row['id_shop'].'" ');
$view_shr = $view_db->view($list_shr);
$row_shr = $view_db->q($view_shr);
$urlshop = $util_class->ck_expired_shop($row_shr['id']);
}
?>
<tr>
<td><div><a href="<?php echo $Url_shop.$row_shr['codeshop']?>"><?php echo imgprofile_shop($row_shr['image_profile'],'34').' ' . $row_shr['nameShop']?> </a></div></td>
<td><div><?php echo $phonenumber; ?> </div></td>
<td><div>
<?php if($row_mobilenetwork != ''){ ?>
<img src="<?php echo $upload ?>mobilenetwork/<?php echo $row_mobilenetwork ?>" width="50">
<?php } ?>
</div></td>
<td><div><?php echo number_format($row['price'])?> </div></td>
<td><div class="td_end"> <img src="../images/icon_bin.png" width="28" onClick="delete_product('<?php echo $value ?>')" /></div></td>
</tr>
<?php
$total = $total + $row['price'];
}
}
?>
</tbody>
</table>
</div>
<?php
foreach ($_SESSION["cart"] as $key => $value)
{
$list = array('table'=>'phonenumber','where'=>'id = "'.$value.'"','order'=> "ORDER BY id DESC");
$view = $view_db->view($list);
$row = $view_db->q($view);
$phonenumber = $Phone_class->format_phonenumber($row['phonenumber'],$row['format']);
$row_mobilenetwork = $actiondata_db->q_one('mobilenetwork','id = "'.$row['mobilenetwork'].'"','image');
$list_shr = array('table'=>'shop','where'=>'id = "'.$row['id_shop'].'" ');
$view_shr = $view_db->view($list_shr);
$row_shr = $view_db->q($view_shr);
?>
<div class="row order_mobile div_mobile" align="center">
<div class="col-xs-12">เบอร์ : <span><?php echo $phonenumber; ?> </span> </div>
<div class="col-xs-6 order_mb_1">
<a href="<?php echo $Url_shop.$row_shr['codeshop']?>" style="color:#000;">
<?php echo imgprofile_shop($image_profile,'34').' ' . $row_shr['nameShop']?> </a>
</div>
<div class="col-xs-6 order_mb_2">
เครือข่าย
<img src="<?php echo $upload ?>mobilenetwork/<?php echo $row_mobilenetwork ?>" width="50">
</div>
<div class="col-xs-12 col-md-8" style="color:#F00;">ราคา :<span><?php echo number_format($row['price'])?></span> บาท</div>
<div class="col-xs-12 col-md-4" align="right" style="color:#F00;"> <img src="../images/bn_bin.jpg" width="100" style="cursor:pointer" onClick="delete_product('<?php echo $value ?>')">
</div>
</div>
<?php } ?>
<div class="row" style="border-bottom:1px solid #f4eedc;padding-bottom:10px;">
<div class="col-md-6">
<button type="button" class="btn btn-primary btn_backweb">+เลือกสินค้าเพิ่มเติม</button>
</div>
<div class="col-md-6" style="color:#F00;font-size:20px;">
ราคารวมทั้งหมด <?php echo number_format($total)?> บาท
</div>
</div>
</div>
</div>
<div class="row" style="margin-top:25px;">
<div class="col-md-12" style="margin-bottom:10px;">
<p class="HeadText" style="text-align:left">ที่อยู่การจัดส่ง</p>
<?php
if($_SESSION["simDed_login"] == 1 && $_SESSION["simDed_type"] == 'member')
{
$sql_m = array('table'=>'member','where'=>"id = '".$_SESSION["simDed_id"]."'");
$viewid_m = $view_db->view($sql_m);
$row_m = $view_db->q($viewid_m);
}
?>
<div class="row">
<div class="col-md-8" style="background-color:#fff6da;padding-top:20px;padding-bottom:20px;margin-top:20px;">
<form action="cart_confirm.php" class="fm_order" method="post" name="fm_order" id="fm_order">
<div class="col-md-12">
<div class="form-group">
<label for="">เลือกวิธีการจัดส่ง</label>
<select class="form-control" style="font-family:Verdana, Geneva, sans-serif" name="shipping">
<?php
$list_sp = array('table'=>'ems_type','where'=>'1','order'=> "ORDER BY id ASC");
$view_sp = $view_db->view($list_sp);
$result_sp = $view_db->q_re($view_sp);
while($row_sp = $view_db->q_ro($result_sp))
{
?><option value="<?php echo $row_sp['id']?>"><?php echo $row_sp['name']?> </option><?php
}
?>
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">ชื่อ</label>
<input type="text" class="form-control" id="" name="name" placeholder="" value="<?php echo $row_m['name']; ?>" style="font-family:Verdana, Geneva, sans-serif">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">นามสกุล</label>
<input type="text" class="form-control" id="" name="lastname" placeholder="" value="<?php echo $row_m['lastname']; ?>" style="font-family:Verdana, Geneva, sans-serif">
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="">ที่อยู่ที่ต้องจัดส่ง</label>
<textarea name="address" class="form-control" style="font-family:Verdana, Geneva, sans-serif" rows="5" cols="40"></textarea>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">จังหวัด</label>
<select class="Drop" name="province" id="province" onchange="" style="margin-top:0px;">
<option value="" disabled selected>กรุณาเลือก</option>
<?php
$list_prv = array('table'=>'province','where'=>'1','order'=> "ORDER BY name='กรุงเทพมหานคร' DESC ,id ASC");
$view_prv = $view_db->view($list_prv);
$result_prv = $view_db->q_re($view_prv);
while($row_prv = $view_db->q_ro($result_prv))
{
?> <option value="<?php echo $row_prv['id'] ?>"><?php echo $row_prv['name'] ?></option> <?php
}
?>
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">รหัสไปรษณี</label>
<input type="text" class="form-control" id="" placeholder="" name="zip" value="" style="font-family:Verdana, Geneva, sans-serif">
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="">เบอร์โทรติดต่อ</label>
<input type="text" class="form-control" id="" placeholder="" name="phone" value="<?php echo $row_m['phone']; ?>" style="font-family:Verdana, Geneva, sans-serif">
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="">อีเมล</label>
<input type="email" class="form-control" id="" placeholder="" name="email" value="<?php echo $row_m['email']; ?>" style="font-family:Verdana, Geneva, sans-serif">
</div>
</div>
<div class="col-md-12">
<div class="form-group" align="center"><br>
<input type="checkbox" value="1" name="check"> ขอรับรองข้อความข้างต้นนี้เป็นความจริง<br>
</div>
</div>
<!--<div class="col-md-6">
<div class="form-group">
<label for=""><?php //echo $random_number1 . ' + ' . $random_number2 . ' ';?></label>
<input type="text" class="form-control" name="captchaResult" value="" style="font-family:Verdana, Geneva, sans-serif">
<input name="firstNumber" type="hidden" value="<?php //echo $random_number1; ?>" />
<input name="secondNumber" type="hidden" value="<?php //echo $random_number2; ?>" />
</div>
</div>-->
<div class="col-md-6">
<div class="form-group">
<label for="" id="captchaOperation"></label>
<input type="text" class="form-control" name="captcha" />
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<div style="height:33px;"></div>
<button type="submit" class="btn btn-danger bn_send_order">ยืนยันที่อยู่จัดส่ง</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div><!--/row-->
</div><!--/.container-->
<?php
include('../themes/footer.php');
include('../include/footer_js.php');
?>
<script>
function delete_product(var1)
{
swal({
title: "ยืนยันการลบข้อมูล ?",
text: "คุณจะไม่สามารถกู้ข้อมูลคืนกลับได้ !",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "ยืนยันการลบข้อมูล",
cancelButtonText: "ยกเลิก",
closeOnConfirm: false
},
function(isConfirm){
if (isConfirm) {
swal.close();
testHoldon('sk-rect');
$.ajax({
url: "../include/ajax_delete_product.php", // Url to which the request is send
type: "POST", // Type of request to be send, called as method
data: 'cart_id='+var1,
cache: false, // To unable request pages to be cached
processData:false, // To send DOMDocument or non processed data file it is set to false
success: function(data) // A function to be called if request succeeds
{
testHoldon_cl('sk-circle');
//$("#alert_listcart").html(data);
window.location.href = '../cart/list.php';
}
});
}
});
}
function checkAll() {
var inputs = document.querySelectorAll('.child');
for (var i = 0; i < inputs.length; i++) {
inputs[i].checked = true;
}
}
</script>