-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcallsearch.phtml
105 lines (90 loc) · 2.76 KB
/
callsearch.phtml
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
require '/etc/cdrtool/global.inc';
page_open(
array(
"sess" => "CDRTool_Session",
"auth" => "CDRTool_Auth",
"perm" => "CDRTool_Perm"
)
);
$loginname = $auth->auth["uname"];
$perm->check('callsearch');
$export = isset($_REQUEST['export']) ? $_REQUEST['export'] : '';
$cdr_source = isset($_REQUEST["cdr_source"]) ? $_REQUEST['cdr_source'] : '';
$trace = isset($_REQUEST["trace"])? $_REQUEST['trace'] : '';
$action = isset($_REQUEST["action"])? $_REQUEST['action'] : '';
$previous_page = isset($_REQUEST['previous_page']) ? $_REQUEST['previous_page'] : '';
require 'cdr_generic.php';
require 'rating.php';
set_time_limit(1800);
if (!$export) {
$title="CDRTool call search ";
if (is_readable("/etc/cdrtool/local/header.phtml")) {
include '/etc/cdrtool/local/header.phtml';
} else {
include 'header.phtml';
}
if ($previous_page == 'license_page') {
$db = new DB_CDRTool();
$query = sprintf(
"insert into settings (billing_party, var_module,var_name,var_value) values ('%s','login','I_agree_with_license','True')",
$auth->auth["uname"]
);
$db->query($query);
}
} else {
Header("Content-type: text/plain");
Header("Content-Disposition: inline; filename=cdr.txt");
}
if (isset($CDRTool['dataSourcesAllowed'])) {
foreach ($CDRTool['dataSourcesAllowed'] as $k => $v) {
$cdr_source_els[] = array(
"label" => $DATASOURCES[$v]['name'],
"value" => $v
);
}
if (!$cdr_source) {
$cdr_source = $cdr_source_els[0]['value'];
}
}
$CDR_class = $DATASOURCES[$cdr_source]["class"];
if (!$export && !$trace) {
$layout = new pageLayoutLocal();
if ($CDRTool['filter']['aNumber']) {
$layout->showHeader();
$layout->showTopMenuSubscriber();
} else {
$layout->showTopMenu();
}
}
if (is_array($DATASOURCES[$cdr_source])) {
if (class_exists($CDR_class)) {
$CDRS = new $CDR_class($cdr_source);
if ($action =='edit' || !$action) {
if ($CDRTool['filter']['aNumber']) {
$CDRS->searchFormSubscriber();
} else {
$CDRS->searchForm();
}
} elseif ($action == 'search') {
$CDRS->show();
}
if (!$export && !$trace) {
$layout->showFooter();
}
} else {
$log = sprintf("Error initializing datasource '%s', class '%s' is not defined", $cdr_source, $CDR_class);
print "<p class='alert alert-danger'>$log</p>";
}
} else {
$log = sprintf("Error: datasource '%s' is not defined", $cdr_source);
print "<p class='alert alert-danger'>$log</p>";
}
if (!$export && !$trace) {
print "
</body>
</html>
";
}
page_close();
?>