-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayment_process.php
More file actions
40 lines (35 loc) · 953 Bytes
/
payment_process.php
File metadata and controls
40 lines (35 loc) · 953 Bytes
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
<?php
include('db.php');
session_start();
if(isset($_POST['amt']) && isset($_POST['name']))
{
$amt=$_POST['amt'];
$name=$_POST['name'];
$payment_status="pending";
$added_on=date('Y-m-d h:i:s');
$sql = "insert into Donations(name,amount,payment_status,added_on) values('$name','$amt','$payment_status','$added_on')";
if(mysqli_query($con,$sql))
{
$_SESSION['OID']=mysqli_insert_id($con);
}
else
{
echo "Unable to insert data!!" . mysqli_error($con);
}
}
if(isset($_POST['payment_id']) && isset($_SESSION['OID']))
{
session_start();
$_SESSION['pay_id'] = $_POST['payment_id'];
$payment_id=$_POST['payment_id'];
$sql = "update Donations set payment_status='complete',payment_id='$payment_id' where id='".$_SESSION['OID']."'";
if(mysqli_query($con,$sql))
{
echo "Success!!!";
}
else
{
echo "Unable to insert data!!" . mysqli_error($con);
}
}
?>