-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddcart.php
More file actions
85 lines (73 loc) · 2.33 KB
/
addcart.php
File metadata and controls
85 lines (73 loc) · 2.33 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
include('Userc.php');
$object=new Userc;
if (isset($_POST['no'])) {
$ret=$object->insertOrder($_GET['pro_name'],$_GET['amt'],$_SESSION['user'],$_GET['upload_id'],$_POST['no'],$_GET['amt'] * $_POST['no'],$_GET['t_id']);
}
$object->getCartNo($_SESSION['user']);
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, fit-to-shrink=no">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/all.min.css">
</head>
<body>
<?php
include("header2.php");
?>
<div class="container">
<div class="row py-3">
<div class="col-md-6">
<?php
//bringing a response from class
// if (isset($_POST['no'])) {
// echo $ret=$object->insertOrder($_GET['pro_name'],$_GET['amt'],$_SESSION['user'],$_GET['upload_id'],$_POST['no'],$_GET['amt'] * $_POST['no'],$_GET['t_id']);
// }
?>
<h2><?php echo ucwords($_GET['nameb']); ?></h2>
<img src="<?php echo $_GET['Upload']; ?>" alt="order pix" style="width:50%; margin:0px"><br>
<a href="view_work.php" class="btn btn-dark my-2">Continue Shopping</a>
</div>
<div class="col-md-6" style="border-left:2px solid grey">
<h2>Product name: <?php echo $_GET['pro_name']; ?></h2>
<h2>Amount: <?php echo $_GET['amt']; ?></h2>
<form action="" method="post">
<div class="form-group row py-3">
<div class="col-sm-5">
<label>Quantity: </label>
</div>
<div class="col-sm-7">
<input type="number" name="no" class="form-control">
</div>
</div>
<div class="form-group row py-3 mx-auto">
<button class="btn btn-warning mr-3" name="cart" type="submit" id="btn">Add to Cart <i class="fa fa-shopping-cart"></i></button>
<a href="cart.php" class="btn btn-dark">View Cart</a>
</div>
</form>
</div>
</div>
</div>
<script type="text/javascript" src="js/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="js/bootstrap.bundle.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#btn').click(function(){
e.preventDefault;
$.ajax({
url:'showcartn.php',
method:'POST',
dataType:'text',
success:function(resp){
$('#cart').html(resp);
}
});
});
});
</script>
</body>
</html>