-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpro.php
More file actions
48 lines (42 loc) · 1.92 KB
/
Copy pathpro.php
File metadata and controls
48 lines (42 loc) · 1.92 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
<?php
require_once('./assets/init.php');
if ($_GET['first'] == 'notify' && $_GET['action'] == 'notify') {
if (($_POST['payment_status'] == 'Completed' || $_POST['payment_status'] == 'Processed' || $_POST['payment_status'] == 'In-Progress' || $_POST['payment_status'] == 'Pending') && strpos($_POST['item_name'] , 'user')) {
$user_id = substr($_POST['item_name'], strpos($_POST['item_name'], 'user')+4);
$user = PT_UserData($user_id);
if (!empty($user)) {
$amount = PT_Secure($_POST['mc_gross']);
$is_paid = $db->where('user_id',$user_id)->getOne(T_PAYMENTS);
if ($is_paid) {
if (($is_paid->expire - (60*60*24*30)) +(60*60*24*25) < time()) {
$db->where('user_id',$user_id)->update(T_PAYMENTS,array('expire' => strtotime("+30 days")));
}
}
else{
$payment_data = array(
'user_id' => $user_id,
'type' => 'pro',
'amount' => $amount,
'date' => date('n') . '/' . date('Y'),
'expire' => strtotime("+30 days")
);
if ($db->insert(T_PAYMENTS,$payment_data)) {
$update = array('is_pro' => 1,'verified' => 1);
$go_pro = $db->where('id',$user_id)->update(T_USERS,$update);
$db->where('user_id',$user_id)->update(T_VIDEOS,array('featured' => 1));
}
}
}
}
elseif(($_POST['payment_status'] == 'Declined' || $_POST['payment_status'] == 'Expired' || $_POST['payment_status'] == 'Failed' || $_POST['payment_status'] == 'Refunded' || $_POST['payment_status'] == 'Reversed') && strpos($_POST['item_name'] , 'user')){
$user_id = substr($_POST['item_name'], strpos($_POST['item_name'], 'user')+4);
$user = PT_UserData($user_id);
if (!empty($user)) {
$db->where('user_id',$user_id)->delete(T_PAYMENTS);
$update = array('is_pro' => 0,'verified' => 0);
$go_pro = $db->where('id',$user_id)->update(T_USERS,$update);
$db->where('user_id',$user_id)->update(T_VIDEOS,array('featured' => 0));
}
}
}
?>