· 7 years ago · Dec 27, 2018, 01:58 PM
1<?php
2include 'config.php';
3
4$secret_key = '34bf63ac06ee92f32d5d05adf6c296a2'; // Set this one, it is provided to you.
5$transaction_id = urldecode($_REQUEST['transaction_id']); // The unique transaction id.
6$id = urldecode($_REQUEST['user_id']); // The member who did the work
7$ms = urldecode($_REQUEST['ms']); // The verification code.
8$credited = urldecode($_REQUEST['amount']); // The amount your member will receive.
9$offer_type = urldecode($_REQUEST['offer_type']); // 1 = Paid to Click, 2 = job, 3 = offer
10$hash = md5($transaction_id.":".$secret_key);
11
12if($multiplicator == "true"){
13 $credited = $credited*$multiplicator_amount;
14}
15
16
17$calc = $credited / 100;
18$calc = $calc * $refshare;
19$calc = floor($calc);
20
21if($myadswall_status == "false"){
22 die("Disabled");
23}
24
25if($hash != $ms){
26 die("0");
27} else {
28 $sql = "SELECT * FROM wallets WHERE id = '$id'";
29 $result = $conn->query($sql);
30 $checko = "0";
31 if ($result->num_rows > 0) {
32 while($row = $result->fetch_assoc()) {
33 $wallet = $row['wallet'];
34 $ref = $row['ref'];
35 $checko = '1';
36 }
37 }
38
39 if($checko == "1"){
40 $sql = "UPDATE wallets SET balance = balance + '$credited' WHERE wallet = '$wallet'";
41 $res = $conn->query($sql);
42 $sql = "INSERT INTO transactions(id, wallet, type, amount)VALUES('', '$wallet', 'MyAdsWall', '$credited')";
43 $runner = $conn->query($sql);
44 }
45
46 if($ref == "none"){
47 die("ok");
48 } else {
49 $sql = "UPDATE wallets SET balance = balance + '$calc' WHERE wallet = '$ref'";
50 $res = $conn->query($sql);
51 $sql = "UPDATE wallets SET refbal = refbal + '$calc' WHERE wallet = '$ref'";
52 $res = $conn->query($sql);
53 $sql = "INSERT INTO transactions(id, wallet, type, amount)VALUES('', '$ref', 'Referral', '$calc')";
54 $runner = $conn->query($sql);
55 }
56
57 die("200");
58}
59?>