0x1668 commited on
Commit
bb6e3b9
1 Parent(s): cab1275

Upload postback.php

Browse files
Files changed (1) hide show
  1. postback.php +62 -0
postback.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $servername = "localhost";
4
+ $username = "username";
5
+ $password = "password";
6
+ $dbname = "localhost_users";
7
+
8
+
9
+ // Create connection
10
+ $conn = new mysqli($servername, $username, $password, $dbname);
11
+ // Check connection
12
+ if ($conn->connect_error) {
13
+ die("Connection failed: " . $conn->connect_error);
14
+ }
15
+
16
+ $campaign_id=$_GET['campaign_id'];
17
+ $campaign_name=$_GET['campaign_name'];
18
+ $sid=$_GET['sid'];
19
+ $sid2=$_GET['sid2'];
20
+ $sid3=$_GET['sid3'];
21
+ $status=intval($_GET['status']);
22
+ $commission=$_GET['commission'];
23
+ $commission=floatval($commission);
24
+ $commission=$commission-$commission*0.3;
25
+ $commission=round($commission, 2);
26
+
27
+ $ip=$_GET['ip'];
28
+ $reversal_reason=$_GET['reversal_reason'];
29
+ $test=$_GET['test'];
30
+ $vc_value=$_GET['vc_value'];
31
+ $leadID=$_GET['leadID'];
32
+ $country=$_GET['country'];
33
+
34
+
35
+
36
+ // $sql = "INSERT INTO `postback` (`campaign_id`, `campaign_name`, `sid`, `sid2`, `sid3`, `status`, `commission`, `ip`, `reversal_reason`,`test`, `vc_value`, `leadID`, `country`) VALUES ('$campaign_id','$campaign_name','$sid','$sid2','$sid3','$status','$commission','$ip','$reversal_reason','$test','$vc_value','$leadID','$country')";
37
+
38
+ //UPDATE Users SET pending_withdrawal=current_balance, current_balance=current_balance-pending_withdrawal
39
+
40
+ //UPDATE Users SET total_withdrawal=total_withdrawal+pending_withdrawal, pending_withdrawal=0
41
+
42
+
43
+
44
+ if($status != 2){
45
+ $sql = "UPDATE Users SET current_balance=current_balance+$commission WHERE pub_id='$sid'";
46
+
47
+
48
+ if ($conn->query($sql) === TRUE) {
49
+
50
+ // echo 'True <br><br>';
51
+
52
+ }
53
+ else{
54
+
55
+ // echo "Error: " . $sql . "<br>" . $conn->error.'<br><br>';
56
+ }
57
+
58
+ }
59
+
60
+ $conn->close();
61
+
62
+ ?>