-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathorder.php
executable file
·38 lines (34 loc) · 1.02 KB
/
order.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<meta charset="utf8"/>
<?php
include 'config.php';
session_start();
$pro_id=$_POST['pro_id'];
$sdt=$_POST['tbPhone'];
$ht=$_POST['tbName'];
$diachi=$_POST['tbAdd'];
$soluong=$_POST['post_qty'];
$thanhtien=$_POST['thanhtien'];
$trangthai="Chờ xác nhận";
$sql = "
INSERT INTO `order`(`product_id`, `sodt`, `hoten`, `diachi`, `soluong`, `thanhtien`, `trangthai`) VALUES ($pro_id,'$sdt','$ht','$diachi',$soluong,$thanhtien,'$trangthai')
";
//echo $sql;
$isdone= mysql_query($sql);
unset($_SESSION['products']);
if($isdone==1){
?>
<script>
alert("Đã đặt hàng thành công !");
window.location="<?php echo HOME?>";
</script>
<?php
}else{
?>
<script>
alert("Đặt hàng thất bại !\nVui lòng thử lại.");
window.location="<?php echo HOME?>";
</script>
<?php
}
?>
<?php mysql_close(); ?>