-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgatewayck.php
More file actions
101 lines (81 loc) · 2.72 KB
/
gatewayck.php
File metadata and controls
101 lines (81 loc) · 2.72 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
include_once ("z_db.php");
session_start();
if (!empty($_POST))
{
//Fetching Details for user, package and payment gateway
$pgateid=mysqli_real_escape_string($con,$_POST['paymentgateway']);
$userid=mysqli_real_escape_string($con,$_POST['username']);
$query="SELECT id,fname,email,doj,active,username,address,pcktaken,tamount FROM affiliateuser where username = '$userid'";
$result = mysqli_query($con,$query);
while($row = mysqli_fetch_array($result))
{
$aid="$row[id]";
$regdate="$row[doj]";
$name="$row[fname]";
$address="$row[address]";
$acti="$row[active]";
$pck="$row[pcktaken]";
$ear="$row[tamount]";
}
?>
<?php $query="SELECT * FROM packages where id = $pck";
$result = mysqli_query($con,$query);
while($row = mysqli_fetch_array($result))
{
$id="$row[id]";
$pname="$row[name]";
$pprice="$row[price]";
$pcur="$row[currency]";
$ptax="$row[tax]";
$gatewayid="$row[gateway]";
$total=$pprice+$ptax;
// "<option value='$id'>$pname | Price - $pcur $total </option>";
}
// Details fetching end
if($pgateid==2)
{
$queryuser="SELECT id FROM affiliateuser where username = '$userid'";
$resultuser = mysqli_query($con,$queryuser);
while($rowuser = mysqli_fetch_array($resultuser))
{
$uaid="$rowuser[id]";
}
$query=mysqli_query($con,"insert into paypalpayments(orderid,transacid,price,currency,date,cod) values('$uaid','C.O.D','$total','$pcur',NOW(),1)");
$sqlquery="SELECT wlink FROM settings where sno=0"; //fetching website from databse
$rec2=mysqli_query($con,$sqlquery);
$row2 = mysqli_fetch_row($rec2);
$wlink=$row2[0]; //assigning website address
$sqlquery222="SELECT email FROM settings where sno=0"; //fetching website from databse
$rec3=mysqli_query($con,$sqlquery222);
$row222 = mysqli_fetch_row($rec3);
$email=$row222[0]; //assigning website address
$sqlquery111="SELECT etext FROM emailtext where code='NEWMEMBER'"; //fetching website from databse
$rec2111=mysqli_query($con,$sqlquery111);
$row2111 = mysqli_fetch_row($rec2111);
$emailtext=$row2111[0]; //assigning email text for email
// More headers
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: <no-reply@'.$wlink.'>' . "\r\n";
$to=$email;
$subject="New COD Order SignUp | Bingo ";
$message=$emailtext;
mail($to,$subject,$message,$headers);
print "
<script language='javascript'>
window.location = 'finalthankyoufree.php?username=$userid';
</script>
";
}
else if($pgateid==1)
{
$_SESSION['paypalidsession'] = $userid;
print "
<script language='javascript'>
window.location = 'thankyou.php?username=$userid';
</script>
";
}
}
?>