-
Notifications
You must be signed in to change notification settings - Fork 6
/
rating_tables.phtml
54 lines (46 loc) · 1.17 KB
/
rating_tables.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
<?php
require("/etc/cdrtool/global.inc");
require('cdr_generic.php');
page_open(
array(
"sess" => "CDRTool_Session",
"auth" => "CDRTool_Auth",
"perm" => "CDRTool_Perm"
)
);
$perm->check("rates");
include("rating.php");
if ($perm->have_perm("readonly")) {
$RatingTables = new RatingTables('readonly');
} else {
$RatingTables = new RatingTables();
}
if (!$_REQUEST['export']) {
$title="Rating tables";
if (is_readable("/etc/cdrtool/local/header.phtml")) {
include '/etc/cdrtool/local/header.phtml';
} else {
include 'header.phtml';
}
$layout = new pageLayoutLocal();
$layout->showTopMenu($title);
} else {
print $RatingTables->table_to_csv_name[$_REQUEST['table']];
Header("Content-type: text/csv");
$h = sprintf("Content-Disposition: inline; filename=%s", $RatingTables->csv_export[$_REQUEST['table']]);
Header($h);
}
if ($_REQUEST['import'] && $_REQUEST['table']) {
$RatingTables->importTable($_REQUEST['table']);
}
$RatingTables->updateTable();
$RatingTables->showTable();
if (!$_REQUEST['export']) {
$layout->showFooter();
print "
</body>
</html>
";
}
page_close();
?>