-
Notifications
You must be signed in to change notification settings - Fork 2
/
payment_options.php
86 lines (43 loc) · 2.04 KB
/
payment_options.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
85
86
<div class="box"><!-- box Starts -->
<?php
$session_email = $_SESSION['customer_email'];
$select_customer = "select * from customers where customer_email='$session_email'";
$run_customer = mysqli_query($con,$select_customer);
$row_customer = mysqli_fetch_array($run_customer);
$customer_id = $row_customer['customer_id'];
?>
<h1 class="text-center">Payment Options For You</h1>
<p class="lead text-center">
<a href="order.php?c_id=<?php echo $customer_id; ?>">Pay Off line</a>
</p>
<center><!-- center Starts -->
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="9PWJZYVQH8KGU">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
<?php
$i = 0;
$ip_add = getRealUserIp();
$get_cart = "select * from cart where ip_add='$ip_add'";
$run_cart = mysqli_query($con,$get_cart);
while($row_cart = mysqli_fetch_array($run_cart)){
$pro_id = $row_cart['p_id'];
$pro_qty = $row_cart['qty'];
$pro_price = $row_cart['p_price'];
$get_products = "select * from products where product_id='$pro_id'";
$run_products = mysqli_query($con,$get_products);
$row_products = mysqli_fetch_array($run_products);
$product_title = $row_products['product_title'];
$i++;
?>
<input type="hidden" name="item_name_<?php echo $i; ?>" value="<?php echo $product_title; ?>" >
<input type="hidden" name="item_number_<?php echo $i; ?>" value="<?php echo $i; ?>" >
<input type="hidden" name="amount_<?php echo $i; ?>" value="<?php echo $pro_price; ?>" >
<input type="hidden" name="quantity_<?php echo $i; ?>" value="<?php echo $pro_qty; ?>" >
<?php } ?>
<input type="image" name="submit" width="500" height="270" src="images/paypal.png" >
</form><!-- form Ends -->
</center><!-- center Ends -->
</div><!-- box Ends -->