forked from libyerman/queue-stats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sesvars.php
executable file
·104 lines (84 loc) · 2.51 KB
/
sesvars.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
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
<?php
/*
Copyright 2007, 2008 Nicolás Gudiño
This file is part of Asternic Call Center Stats.
Asternic Call Center Stats is free software: you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Asternic Call Center Stats is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Asternic Call Center Stats. If not, see
<http://www.gnu.org/licenses/>.
*/
if(isset($_POST['List_Queue'])) {
$queue="";
foreach($_POST['List_Queue'] as $valor) {
$queue.=stripslashes($valor).",";
}
$queue=substr($queue,0,-1);
$_SESSION['QSTATS']['queue']=$queue;
} else {
$queue="'NONE'";
}
if(isset($_POST['List_Agent'])) {
$agent="";
foreach($_POST['List_Agent'] as $valor) {
$agent.=stripslashes($valor).",";
}
$agent=substr($agent,0,-1);
$_SESSION['QSTATS']['agent']=$agent;
} else {
$agent="''";
}
/*
if(isset($_POST['queue'])) {
$queue = stripslashes($_POST['queue']);
$_SESSION['QSTATS']['queue']=$queue;
} else {
$queue="'NONE'";
}
*/
if(isset($_POST['start'])) {
$start = $_POST['start'];
$_SESSION['QSTATS']['start']=$start;
} else {
$start = date('Y-m-d 00:00:00');
}
if(isset($_POST['end'])) {
$end = $_POST['end'];
$_SESSION['QSTATS']['end']=$end;
} else {
$end = date('Y-m-d 23:59:59');
}
if(isset($_SESSION['QSTATS']['start'])) {
$start = $_SESSION['QSTATS']['start'];
}
if(isset($_SESSION['QSTATS']['end'])) {
$end = $_SESSION['QSTATS']['end'];
}
if(isset($_SESSION['QSTATS']['queue'])) {
$queue = $_SESSION['QSTATS']['queue'];
}
if(isset($_SESSION['QSTATS']['agent'])) {
$agent = $_SESSION['QSTATS']['agent'];
}
$fstart_year = substr($start,0,4);
$fstart_month = substr($start,5,2);
$fstart_day = substr($start,8,2);
$fend_year = substr($end,0,4);
$fend_month = substr($end,5,2);
$fend_day = substr($end,8,2);
$timestamp_start = return_timestamp($start);
$timestamp_end = return_timestamp($end);
$elapsed_seconds = $timestamp_end - $timestamp_start;
$period = floor(($elapsed_seconds / 60) / 60 / 24) + 1;
if(!isset($_SESSION['QSTATS']['start'])) {
if(basename($self)<>"index.php") {
Header("Location: ./index.php");
}
}
?>