-
Notifications
You must be signed in to change notification settings - Fork 228
/
Copy pathgift_pro.php
46 lines (42 loc) · 1.54 KB
/
gift_pro.php
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
<?php
require_once $_SERVER["DOCUMENT_ROOT"].'/classes/stdf.php';
require_once $_SERVER["DOCUMENT_ROOT"].'/classes/account.php';
require_once $_SERVER["DOCUMENT_ROOT"].'/classes/payed.php';
require_once $_SERVER["DOCUMENT_ROOT"].'/classes/users.php';
DB::setStandby('master', NULL);
$uid = __paramInit("int", "uid", null, 0);
$uid = intval($uid);
$admin = 103;
if ( $uid > 0 ) {
global $DB;
//Åñòü ëè òàêîé íåçàáàíåíûé íå ïðî, çàõîäèâøèé â ïðîñëåäíèé ðàç áîëåå ãîäà íàçàä?
$targetUser = users::userWasInOldYear($uid);
if ( is_array($targetUser) ) {
//Äàåì ïðî íà íåäåëþ
$account = new account();
$payed = new payed();
$op_code = 115; // 52
$tr_id = $account->start_transaction($admin);
$interval = "7 days";
if ( $targetUser["role"][0] == 1 ) {
$interval = "1 month";
}
$success = $payed->GiftOrderedTarif($bill_id, $gift_id, $uid, $admin, $tr_id, $interval, "Àêêàóíò PRO â ïîäàðîê", $op_code);
if( !$success ) {
$rpath = "./";
if (!$fpath) $fpath = "";
$header = ABS_PATH."/header.new.php";
$footer = ABS_PATH."/footer.new.html";
$content = ABS_PATH."/gift_pro_week_error.php";
$page_title = "Îøèáêà ïðè àêòèâàöèè ïîäàðêà";
include("template3.php");
exit;
}
$sql = "UPDATE week_pro_action SET ts = NOW() WHERE uid = {$uid}";
$DB->query($sql);
header("location: /login/");
exit;
}
}
header("location: /404.php");
exit;