-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
139 lines (132 loc) · 6.84 KB
/
index.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
include('db.inc.php');
session_start();
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") || $_GET['xml']=="true") {
header("Content-type: application/xhtml+xml");
echo '<?xml version="1.0" encoding="utf-8"?>'."\n";}
else {header("Content-type: text/html");}
if(isset($_REQUEST['eid']) and is_numeric($_REQUEST['eid'])){
$eid = $_REQUEST['eid'];
$_SESSION['eid'] = $_REQUEST['eid'];}
elseif(isset($_SESSION['eid']) and is_numeric($_SESSION['eid']) and !(isset($_REQUEST['eid']) and $_REQUEST['eid'] == "all")) $eid = $_SESSION['eid'];
else $eid = NULL;
if(isset($_REQUEST['coid']) and is_numeric($_REQUEST['coid'])){
$coid = $_REQUEST['coid'];
$_SESSION['coid'] = $_REQUEST['coid'];}
elseif(isset($_SESSION['coid']) and is_numeric($_SESSION['coid']) and !(isset($_REQUEST['coid']) and $_REQUEST['coid'] == "all")) $coid = $_SESSION['coid'];
else $coid = NULL;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Perceptionist, Inc. - Home</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml;charset=utf-8" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="Description" content="Perceptionist, Inc. Bringing Everyone Together" />
<meta name="Keywords" content="receptionist, call center, secretary, professional" />
<meta name="Author" content="3AM Productions" />
<meta name="Copyright" content="2005" />
<link rel="Shortcut Icon" href="favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="constant.css" type="text/css" media="screen" />
<link rel="stylesheet" href="perceptionist.css" type="text/css" media="screen" />
<script type="text/javascript" src="scripts/countdown.js"></script>
<!--<script type="text/javascript" src="scripts/login.js"></script>
<script type="text/javascript" src="scripts/cssjs.js"></script>-->
</head>
<body>
<div id="header"></div> <!--Header-->
<div id="container">
<div id="titlebar"></div> <!--titlebar-->
<div id="main">
<div id="navfill">
<h1>Money At Your Fingertips</h1>
This page contains information regarding those customers which were not able to reach a customer representative at your organization. It lists their name, the reason they called and the time that has elapsed since last contact. Please click on their name for more information. Clicking on the dollar sign will mark a call as resolved and remove it form this page.
</div><!--navfill-->
<ul id="nav">
<li><a href="index.php" accesskey="h"><em>h</em>ome</a></li>
<li><a href="report.php#complaints" accesskey="c"><em>c</em>omplaints</a></li>
<li><a href="report.php#unresolved" accesskey="u"><em>u</em>nresolved calls</a></li>
<li><a href="contact.php" accesskey="o">c<em>o</em>ntact list</a></li>
<li><a href="report.php" accesskey="r"><em>r</em>eport</a></li>
</ul> <!--nav-->
<br style="clear:both;" />
<!--<span id="username"></span>-->
<div id="tablewrapper">
<table id="calls">
<tbody>
<?php
//$sql = 'SELECT DISTINCT call.call_id,flow.employee_id,customer.fname,customer.lname,call.request,customer.customer_id,TIME_FORMAT(call.call_time,\'%D:%T\') AS time FROM customer LEFT JOIN call ON (customer.customer_id = call.customer_id) LEFT JOIN flow ON (call.call_id = flow.call_id) WHERE '.$company.'(call.resolved != 1) AND (TO_DAYS(NOW()) - TO_DAYS(call.call_time) <= 1)'.$sort.' GROUP BY call.call_id ORDER BY call.call_time';
//$sql = 'SELECT DISTINCT call.call_id,flow.employee_id,customer.fname,customer.lname,call.request,customer.customer_id,call.call_time FROM customer LEFT JOIN call ON (customer.customer_id = call.customer_id) LEFT JOIN flow ON (call.call_id = flow.call_id) WHERE '.$company.'(call.resolved != 1) AND (TO_DAYS(NOW()) - TO_DAYS(call.call_time) <= 1)'.$sort.' GROUP BY call.call_id ORDER BY call.call_time';
$sql = 'SELECT DISTINCT call.call_id,flow.employee_id,customer.fname,customer.lname,call.request,customer.customer_id,call.call_time FROM call LEFT JOIN customer ON (customer.customer_id = call.customer_id) LEFT JOIN flow ON (call.call_id = flow.call_id) WHERE true';
$params = [];
if(!is_null($eid)){
array_push($params, $eid);
$sql.=' AND employee_id = $'.sizeof($params);
}
if(!is_null($coid)){
array_push($params, $coid);
$sql.=' AND company_id = $'.sizeof($params);
}
$sql.=' ORDER By call_time';
$result = pg_query_params($db, $sql, $params);
$counter = 1;
while ($row = pg_fetch_assoc($result))
{
// trim request
$request = $row['request'];
if(strlen($request) > 50){
$request = substr($request,0,50);
$pos = strrpos ($request,'.');
if($pos !== false) $request = substr($request,0,$pos+1 );
else {
$pos = strrpos ($request,' ');
if($pos !== false) $request = substr($request,0,$pos) . '...';
else $request .= '...';
}
}
// format call time
$time = $row['call_time']; $d = substr($time,6,2); $h = substr($time,8,2); $m = substr($time,10,2); $s = substr($time,12,2); $time = "$d:$h:$m:$s";
echo "<tr>\n";
echo ' <td class="one"><a href="customer.php?cid='.$row['customer_id'].'&call_id='.$row['call_id'].'">'.$row['fname'].' '.$row['lname'].'</a></td>'."\n";
echo ' <td class="two">Request: '.$request.'</td>'."\n";
echo ' <td class="three"> -<span id="countdown'.$counter.'">'.$row['call_time'].'</span></td>'."\n";
echo ' <td class="four"><a href="resolve.php?call_id='.$row['call_id'].'" title="Click to resolve this call." onclick="return confirm(\'Click \\\'OK\\\' if '.$row['fname'].' '.$row['lname'].'\\\'s call has been resolved.\');"><img src="images/resolve.gif" alt="Resolve Call" /></a></td>';
echo '</tr>'."\n";
$counter++;
}
?>
</tbody>
</table>
</div><!--tablewrapper-->
<div id="sort">Sort By:
<?php
$sql = 'SELECT employee.employee_id,employee.employee_fname FROM employee WHERE true';
$params = [];
if(!is_null($coid)) {
array_push($params, $coid);
$sql.=' AND company_id = $'.sizeof($params);
}
$result = pg_query_params($db, $sql, $params);
while($row = pg_fetch_assoc($result)){
echo '<a href="?eid='.$row['employee_id'].'">'.$row['employee_fname'].'</a> | '."\n";
}
echo '<a href="?eid=all">SHOW ALL</a>'."\n";
// TEMP BELOW ***********************************
echo '<div>Choose Company: ';
$result = pg_query_params($db, 'SELECT company_id FROM company', []);
while($row = pg_fetch_assoc($result)){echo '<a href="?coid='.$row['company_id'].'">CO.'.$row['company_id'].'</a> | ';}
echo '<a href="?coid=all">SHOW ALL</a></div>';
// END TEMP *************************************
?>
</div><!--sort-->
<a href="http://student.cob.ohio-state.edu/velasquez_13">
<span id="innerfooter">
<span class="ifootertop">Does your compnay have a web presence?</span>
<span class="ifooterbottom">Click here to find out why you need one and how 3AM can help you get there...</span>
</span><!--innerfooter-->
</a>
</div><!-- main -->
</div><!-- container -->
<div id="footer"></div><!--footer-->
</body>
</html>