| 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/kainumber.com/cart/ |
Upload File : |
<?php include('../include/class.php');?>
<?php
//print_r($_POST);
//exit;
//$id_order = 200;
$txt = base64_decode(base64_decode($_POST['g']));
$txt_arr = explode('/*/',$txt);
$txt_phone = explode('///',$txt_arr[0]);
$delivery_arr = explode('s:',$txt_arr[1]);
$delivery = $delivery_arr[1];
if($delivery_arr[1] == 'free'){ $delivery = 0;$delivery_id=0;}
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_id = $delivery_arr[1];
}
$id_order = $order_class->orders_runid();
//exit;
$date = date("Y-m-d H:i:s");
$list = array(
'table'=>'orders',
'id'=>"'".$id_order."'",
'id_mem'=>'',
'name'=>"'".@$_POST['name']."'",
'lastname'=>"'".@$_POST["lastname"]."'",
'mail'=>"'".@$_POST["mail"]."'",
'address'=>"'".@$_POST["address"]."'",
'province'=>"'".@$_POST["province"]."'",
'zipcode'=>"'".@$_POST["zipcode"]."'",
'phone'=>"'".@$_POST["phone"]."'",
'delivery'=>"'".@$delivery."'",
'id_pm'=>'6',
'total'=>"'".@$_POST["total"]."'",
'listnum'=>"'".@$num_phone."'",
'status'=>'1',
'status_op'=>'1',
'date_time'=>"'".$date."'",
'up_date'=>"'".$date."'"
);
/*echo '<pre>';
print_r($list);
echo '</pre>';*/
//exit;
$add_order = $actiondata_db->add_db($list);
$total_pay = number_format($_POST["total"],2,'','');// ราคารวม เช่น 100 เป็น 10000 เติม00ต่อท้าย
$amount = $total_pay;
$firstname = $_POST['name'];
$lastname = $_POST["lastname"];
$mobile = $_POST["phone"];
$email = $_POST["email"];
$pmid = 3;//credit by MPAY
$list_phonetext = '';
$array_cart = array_unique($_SESSION["cart"]);
$num=0;
// เบอร์ กับ ราคา
$num_phone = count($txt_phone);
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_nw = array(
'table'=>'phonenumber,mobilenetwork',
'count'=>'mobilenetwork.image AS mb_image , phonenumber.id AS ph_id',
'where'=>"phonenumber.mobilenetwork = mobilenetwork.id AND phonenumber = '". $phone."'"
);
$view_nw = $view_db->view($sql_nw);
$row_nw = $view_db->q($view_nw);
$list = array(
'table'=>'order_detail',
'id_order'=>"'".$id_order."'",
'id_pho'=>"'".$row_nw['ph_id']."'",
'num'=>'1',
'price'=>"'".$price."'",
);
$add = $actiondata_db->add_db($list);
$p_price = str_replace("," , "" ,$price);
$sum_price = $sum_price + $p_price;
/*echo '<pre>';
print_r($list);
echo '</pre>';*/
$list_phone = '
<tr align="center">
<td>'.$Phone_class->phonenumber($phone).'</td>
<td><img src="../redbag/mobilenetwork/'.$row_nw['mb_image'].'" width="38" height="19"></td>
<td align="right">'.number_format($price).' บาท</td>
</tr>';
$list_phonetext = $list_phonetext . $list_phone;
$list_ph = array(
'table'=>'phonenumber',
'id'=>$row_nw['ph_id'],
'status_number'=>'3',//จองเบอร์
'up_date'=>$date
);
$edit = $actiondata_db->edit_db($list_ph);
/*echo '<pre>';
print_r($list_ph);
echo '</pre>';*/
$Oid_id = $id_order;
$detailproduct_mpay = $detailproduct_mpay . '-'.$phone;
}
//echo $detailproduct_mpay;
if( $add_order['suc'] == 1)//เพิ่ม order สำเร็จ
{
include("../include/mail.php");
$to = $_POST["email"];
$from = '[email protected]';
$sub = 'ยืนยันการสั่งซื้อสินค้า';
$today = date("d/m/Y");
$date_1 = date("d/m/Y",date("U")+ 60*60*24);
$id_order = sprintf("%06d",$id_order);
$msg = '<b>ข้อมูลการสั่งซื้อสินค้า </b><br>'.
'
<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>เลขที่ใบสั่งซื้อ : #'.$id_order.'</td>
</tr>
<tr>
<td>วันที่สั่งสินค้า : '.$today.'</td>
</tr>
<tr>
<td>ชำระเงินภายในวันที่ : '.$date_1.'</td>
</tr>
</table>
'
.
'<div style="border:1px solid #FFF;margin-top:15px;">
<table width="100%" border="0" class="tb_receipt" cellpadding="5">
<tr>
<td>ที่อยู่สำหรับจัดส่งสินค้า</td>
</tr>
<tr>
<td>'.$_POST['name'] .' '. $_POST['lastname'].'</td>
</tr>
<tr>
<td>'.$_POST['address'] .' '. $_POST['province'] .' '. $_POST['zipcode'].'</td>
</tr>
<tr>
<td>โทรศัพท์ '.$Phone_class->phonenumber($_POST['phone']).'</td>
</tr>
</table>
</div>
<br><br>'.
'
<table width="100%" border="1" align="center" class="tb_cart table" cellpadding="5" cellspacing="0">
<tr align="center">
<td>หมายเลขโทรศัพท์</td>
<td>เครือข่าย</td>
<td>ราคา</td>
</tr>'.$list_phonetext.
'
<tr>
<td align="right" colspan="2">รวม</td>
<td align="right">'.number_format($sum_price).' บาท</td>
</tr>
<tr>
<td align="right" colspan="2">ค่าจัดส่ง</td>
<td align="right">'.number_format($delivery).' บาท</td>
</tr>
<tr>
<td align="right" colspan="2">ราคารวม</td>
<td align="right">'.number_format($_POST["total"]).' บาท</td>
</tr>
</table>
<br><br>
เมื่อทางระบบเช็คหมายเลขที่ท่านสั่งซื้อ และส่งหลักฐานการชำระเงิน ทางkainumber จะจัดส่งสินค้าให้ท่าน ภายใน 1-2วัน ทำการ
';
//print_r($msg);
$body = $msg.$contact;
//exit;
$mail->SetFrom($from, $from);
$mail->AddReplyTo($from, $from);
$mail->MsgHTML($body);
$mail->Subject = 'kainumber - เบอร์มงคล :: '.$sub;
$mail->AddAddress($_POST['mail']); // ผู้รับ
$mail->addBCC('[email protected]');// ผู้รับ
//$mail->AddAddress('[email protected]');// ผู้รับ
//$mail->addBCC('[email protected]');// ผู้รับ
//$mail->AddAddress('[email protected]'); // ผู้รับ
$mail->addBCC('[email protected]'); // ผู้รับ
$mail->addBCC('[email protected]'); // ผู้รับ
$mail->addBCC('[email protected]');
if(!$mail->Send())
{
echo 'checkout4.php?s=2';
}
else
{
include('mpay.php');
}
}
else
{
echo 'checkout4.php?s=2';
}
//echo $msg;
exit;
?>