| 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($_GET['action']=='cancel')
{
session_unregister("cart");
session_unregister("num_cart");
}
?>
<?php include('../theme/menu.php')?>
<link href="../include/Fullscreen-Loading/src/css/HoldOn.css" rel="stylesheet" type="text/css">
<script src="../include/Fullscreen-Loading/jquery-1.11.3.min.js"></script>
<script src="../include/Fullscreen-Loading/src/js/HoldOn.js"></script>
<script>
function testHoldon(themeName){
HoldOn.open({
theme:themeName,
message:"<h4> กำลังโหลดข้อมูล </h4>"
});
/* setTimeout(function(){
HoldOn.close();
},5000);*/
}
function testHoldon_cl(themeName){
/*HoldOn.open({
theme:themeName,
//message:"<h4> กำลังโหลดข้อมูล </h4>"
});*/
setTimeout(function(){
HoldOn.close();
},0);
}
var HttPRequest = false;
function checkform_Shipping_extra()
{
if(document.from_shipping.name.value==""){alert("ขออภัยค่ะกรุณากรอก ชื่อ");document.from_shipping.name.focus();return false;}
if(!isNaN(document.from_shipping.name.value)){alert("ขออภัยค่ะกรุณากรอก ชื่อเป็นตัวหนังสือเท่านั้น");document.from_shipping.name.focus();return false;}
if(document.from_shipping.lastname.value==""){alert("ขออภัยค่ะกรุณากรอก นามสกุล");document.from_shipping.lastname.focus();return false;}
if(!isNaN(document.from_shipping.lastname.value)){alert("ขออภัยค่ะกรุณากรอก นามสกุลเป็นตัวหนังสือเท่านั้น");document.from_shipping.lastname.focus();return false;}
/*if(!document.from_shipping.mail.value.match(/^[\w]{1}[\w\.\-_]*@[\w]{1}[\w\-_\.]*\.[\w]{2,6}$/i)){alert("ขออภัยค่ะ รูปแบบ E-mail ของคุณไม่ถูกต้อง");
document.from_shipping.mail.focus();return false;}
*/
testHoldon('sk-circle');
HttPRequest = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
HttPRequest = new XMLHttpRequest();
if (HttPRequest.overrideMimeType) {
HttPRequest.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
HttPRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
HttPRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!HttPRequest) {
alert('Cannot create XMLHTTP instance');
return false;
}
var url = 'order_extra_save.php';
var pmeters =
'g='+document.from_shipping.g_p.value+
'&total='+document.from_shipping.total.value+
'&name='+document.from_shipping.name.value+
'&lastname='+document.from_shipping.lastname.value+
'&address='+document.from_shipping.address.value+
'&province='+document.from_shipping.province.value+
'&zipcode='+document.from_shipping.zipcode.value+
'&phone='+document.from_shipping.phone.value+
'&mail='+document.from_shipping.mail.value;
//var pmeters = 'myName='+document.getElementById("txtName").value+'&my2='; // 2 Parameters
HttPRequest.open('POST',url,true);
HttPRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
HttPRequest.setRequestHeader("Content-length", pmeters.length);
HttPRequest.setRequestHeader("Connection", "close");
HttPRequest.send(pmeters);
HttPRequest.onreadystatechange = function()
{
if(HttPRequest.readyState == 3) // Loading Request
{
document.getElementById("txtHint").innerHTML = "Now is Loading...";
}
if(HttPRequest.readyState == 4) // Return Request
{
testHoldon_cl('sk-circle');
//document.getElementById("txtHint").innerHTML = HttPRequest.responseText;
window.location.href = HttPRequest.responseText;
}
}
/*
HttPRequest.onreadystatechange = call function .... // Call other function
*/
}
function checkform_Shipping_extratttt()
{
//testHoldon('sk-circle');
if(document.from_shipping.name.value==""){alert("ขออภัยค่ะกรุณากรอก ชื่อ");document.from_shipping.name.focus();return false;}
if(!isNaN(document.from_shipping.name.value)){alert("ขออภัยค่ะกรุณากรอก ชื่อเป็นตัวหนังสือเท่านั้น");document.from_shipping.name.focus();return false;}
if(document.from_shipping.lastname.value==""){alert("ขออภัยค่ะกรุณากรอก นามสกุล");document.from_shipping.lastname.focus();return false;}
if(!isNaN(document.from_shipping.lastname.value)){alert("ขออภัยค่ะกรุณากรอก นามสกุลเป็นตัวหนังสือเท่านั้น");document.from_shipping.lastname.focus();return false;}
if(!document.from_shipping.mail.value.match(/^[\w]{1}[\w\.\-_]*@[\w]{1}[\w\-_\.]*\.[\w]{2,6}$/i)){alert("ขออภัยค่ะ รูปแบบ E-mail ของคุณไม่ถูกต้อง");
document.from_shipping.mail.focus();return false;}
//alert(str);
var pmeters =
'name='+document.from_shipping.name.value+
'lastname='+document.from_shipping.lastname.value;
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
//testHoldon_cl('sk-circle');
window.location.href = xmlhttp.responseText;
//document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("POST", "order_extra_save.php", true);
xmlhttp.send(pmeters);
}
</script>
<!-- /.body -->
<div class="container" style="padding-top:25px;">
<div class="row">
<div class="col-md-12">
<div class="head_bg_right"> ตะกร้าสินค้าพิเศษ</div>
<div style="border:0px solid #FFF;padding:10px;">
<?php
$txt = base64_decode(base64_decode($_GET['g']));
//echo $txt;
$txt_arr = explode('/*/',$txt);
$txt_phone = explode('///',$txt_arr[0]);
?>
<form class="form-horizontal" name="from_shipping">
<table width="100%" border="1" align="center" class="tb_cart table" cellpadding="5" cellspacing="0" style="border:1px solid #FFF;">
<tr align="center">
<td>หมายเลขโทรศัพท์</td>
<td>เครือข่าย</td>
<td>ราคา</td>
</tr>
<?php
foreach( $txt_phone as $txt_value )
{
// echo $txt_value;
$txt_s = explode('//',$txt_value);
$phone_arr = explode('n:',$txt_s[0]);
$phone = $phone_arr[1];
$price_arr = explode('p:',$txt_s[1]);
$price = $price_arr[1];
$sql = array('table'=>'phonenumber','where'=>"phonenumber = '". $phone."'");
$view_sql = $view_db->view($sql);
$row = $view_db->q($view_sql);
?>
<tr align="center">
<td><?php echo $Phone_class->phonenumber($phone); ?></td>
<?php
$sql_type = array('table'=>'mobilenetwork','where'=>"id = '". $row['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 $price; ?> บาท
</td>
</tr>
<?php
$p_price = str_replace("," , "" ,$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>
<?php
$delivery_arr = explode('s:',$txt_arr[1]);
//$delivery = $delivery_arr[1];
if($delivery_arr[1] == 'free'){ $delivery = 0;$delivery_name='';}
else
{
$sql_d = array('table'=>'delivery','where'=>"id = '".$delivery_arr[1]."'");
$view_d = $view_db->view($sql_d);
$row_d = $view_db->q($view_d);
$delivery = $row_d['price'];
$delivery_name = $row_d['name'];
}
?>
<td align="right" colspan="2">ค่าจัดส่ง<?php echo $delivery_name; ?></td>
<td align="right"><?php echo number_format($delivery);?> บาท</td>
</tr>
<?php $total = $sum_price + $delivery; ?>
<tr>
<td align="right" colspan="2">ราคารวม</td>
<td align="right"><?php echo number_format($total);?> บาท
<input type="hidden" name="total" value="<?php echo $total?>">
</td>
</tr>
</table>
<div style="color:#FFF;font-size:16px;padding:15px;" align="center">ข้อมูลการจัดส่งสินค้า</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">ชื่อ :*</label>
<div class="col-sm-9">
<input type="text" name="name" class="form-control" id="inputEmail3" value="<?php echo $row['name']?>" placeholder="Name">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">นามสกุล :*</label>
<div class="col-sm-9">
<input type="text" name="lastname" class="form-control" id="inputPassword3" placeholder="Last name" value="<?php echo $row['lastname']?>">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">ที่อยู่ :</label>
<div class="col-sm-9">
<textarea class="form-control" rows="3" name="address"><?php echo $row['address']?></textarea>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">จังหวัด :</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="inputEmail3" name="province" placeholder="Province" value="<?php echo $row['province']?>">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">รหัสไปรษณีย์ :</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="inputEmail3" name="zipcode" placeholder="Zip code" value="<?php echo $row['zipcode']?>">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">โทรศัพท์มือถือ :</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="inputEmail3" name="phone" placeholder="Mobile phone" maxlength="10" value="<?php echo $row['phone']?>">
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">อีเมล :*</label>
<div class="col-sm-9">
<input type="email" class="form-control" id="inputEmail3" name="mail" placeholder="Email" value="<?php echo $row['mail']?>">
</div>
</div>
<div class="form-group" align="center" style="padding-top:15px;">
<div class="col-sm-offset-2 col-sm-10">
<input type="hidden" name="g_p" value="<?php echo $_GET['g']?>">
<input class="btn btn-default corner_cancel bt_login" type="button" value=" ยืนยันการสั่งซื้อ" onClick="checkform_Shipping_extra();" style="color:#FFF;">
</div>
</div>
</form>
<div id="txtHint"></div>
</div>
</div>
</div>
</div>
<div style="height:200px;">
</div>
<!-- /.body -->
<?php include('../include/footer.php')?>
<?php include('../include/footer_js.php')?>