-
Notifications
You must be signed in to change notification settings - Fork 2
/
cdr.php
executable file
·66 lines (50 loc) · 1.99 KB
/
cdr.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* index.php
* @package Mod Cdr
* @version 1.70
* @author Machine
* @co-author Capi
* @license http: //opensource.org/licenses/gpl-license.php GNU Public License
*/
if (!defined('IN_SPYOGAME')) die("Hacking attempt");
global $db, $table_prefix, $user_data;
define("TABLE_XTENSE_CALLBACKS", $table_prefix . "xtense_callbacks");
define("T_CDR", $table_prefix . "cdr");
define("M_CDR", $table_prefix . "mod_cdr");
list($version, $root) = $db->sql_fetch_row($db->sql_query("SELECT `version`, `root` FROM " . TABLE_MOD . " WHERE `action` = 'cdr'"));
require_once("mod/{$root}/lang/" . $ui_lang . "/lang_cdr.php");
$req = "SELECT COUNT(`id_user`) FROM " . M_CDR . " WHERE `id_user` =" . $user_data['user_id'];
$req1 = $db->sql_query($req);
list($id_exist) = $db->sql_fetch_row($req1);
require_once("views/page_header.php");
require_once ("mod/cdr/cdr_menu.php");
if (isset($pub_subaction)) {
switch ($pub_subaction) {
case "cdr" :
$req = "SELECT count(`id_user`) FROM " . M_CDR . " WHERE `id_user` = " . $user_data['user_id'];
$req1 = $db->sql_query($req);
list($id_exist) = $db->sql_fetch_row($req1);
if ($id_exist >= 1) {
$req = "SELECT * FROM " . M_CDR . " WHERE `id_user`=" . $user_data['user_id'];
}
else {
$req = "SELECT * FROM " . M_CDR . " WHERE `id_user` = 0";
}
$req1 = $db->sql_query($req);
$tc = $db->sql_fetch_row($req1);
// on supprime les vieux de plus de 2jours
$vieux = (time() - (60 * 60 * 24) * $tc['retention']);
// on fait du nettoyage au cas ou
$query = "DELETE FROM `" . T_CDR . "` WHERE `date`<" . $vieux;
$db->sql_query($query);
?>
<br><br>
<?php
require_once("mod/cdr/cdr_list.php");
break;
case "option" :
require_once("mod/cdr/cdr_options.php");
}
}
require_once("./views/page_tail.php");