-
Notifications
You must be signed in to change notification settings - Fork 1
/
payment.php
84 lines (62 loc) · 1.74 KB
/
payment.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
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
<?php
include "connect.php";
if(isset($_POST["q"]))
{?>
<br><br>
<div class="boxm">
<div class="boxmin2" id="OFood">
<h3>Address:</h3>
<?php
$sql= "SELECT * FROM customerdetails WHERE uid=".$_SESSION["uid"];
$res = $db->query($sql);
$rows=mysqli_num_rows($res);
if($rows==0)
{
echo '<p>please enter an address</p>';
echo '<input onclick="location.href = \'profile.php\';" class="btn btn-primary" name="uidMN" type = "submit" value= "GO" />';
}
if($res==True && $rows>0)
{
echo '<form action="paid.php" class="login" method="post"><label for="savedadd">Choose a saved address:</label>
<select name="savedadd" id="savedadd">';
echo '<option name="cardnum" >Select Please</option>';
while ($obj = $res -> fetch_object())
{
echo '<option name="CDID" value="'.$obj->CDid.'">'.$obj->address.'</option>';
}
echo '<br></select>
<br>
';
}
?>
<h3>Payment:</h3>
<?php
$sql= "SELECT * FROM payment WHERE uid=".$_SESSION["uid"];
$res = $db->query($sql);
$rows=mysqli_num_rows($res);
if($rows==0)
{
echo '<p>please enter a payment method</p>';
echo '<input onclick="location.href = \'profile.php\';" class="btn btn-primary" name="uidMN" type = "submit" value= "GO"/>';
}
if($res==True && $rows>0)
{
echo '<label for="savedpay">Choose a saved payment:</label>
<select name="savedpay" id="savedpay">';
echo '<option name="cardnum" >Select Please</option>';
while ($obj = $res -> fetch_object())
{
echo '<option name="PID" value="'.$obj->pid.'">'.$obj->cardNumber.'</option>';
}
echo '<input type="submit" name="pay" value="Pay" />';
echo '</form><br></select>
<br>
';
}
?>
<br>
</div>
</div>
<?php
}
?>