| Server IP : 10.200.247.200 / Your IP : 216.73.217.19 Web Server : Apache System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : jeremy ( 1001) PHP Version : 8.4.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/usa_sites/usagrantapplications.org/vsa/ |
Upload File : |
<?php
/*
Copyright (c) 2007-present InnAnTech Industries
Author: Dave Guindon
Web: www.VirtualSmartAgent.com
Support: www.DaveGuindonSupport.com
Please send bug reports, suggestions and/or feedback to the support
website given above.
Virtual Smart Agent is a commercial software. Any distribution is strictly prohibited
unless a resale rights license was delivered along with this software.
*/
include('myauth.php');
include('modfiles/db.php');
include('globals.php');
include('charts/tables.php');
include('charts/html_table.class.php');
include('charts/chartfunctions.php');
include('panelfunctions.php');
//get the posted data
$t = $_GET['t'];
$logid = $_GET['logid'];
$p = $_GET['p'];
$chattype = $_GET['ct'];
$offset = $_GET['o'];
if ((!isset($offset))||($offset=='')){$offset=0;}
//chats per page
if ($_POST['chatsperpage']){
$rows = $_POST['chatsperpage'];
}else{
$rows = $_GET['r'];
}
if ((!isset($rows))||($rows=='')){$rows=10;}
//check to display chat log data for a given chat log
if ($t == 'view'){
$showchatdata = doChatLogDataTable($_SESSION['cid'],$logid);
$showchatdata = '<p>Chat Log Messages | <a href="chats.php?p='.$p.'&ct='.$chattype.'&o='.$offset.'&r='.$rows.'">Back to Chat Log</a></p>'.$showchatdata;
$hide1 = '<!--';
$hide2 = '-->';
}else{
//check if p was posted using GET
if ($p > 0){
$r = GetPeriod1($p);
$sd = $r[0];
$ed = $r[1];
}else if ($_POST['actionbutton']){
//get posted
$p = $_POST['selectperiod'];
$chattype = $_POST['chattype'];
$r = GetPeriod1($p);
$sd = $r[0];
$ed = $r[1];
}else if ($_POST['deletebutton']){
//get posted
$p = $_POST['selectperiod'];
$chattype = $_POST['chattype'];
//go through checkboxes and remove
foreach($_POST as $key=>$value){
if (strpos($key,'clogid') !== false){
//remove the chat log and all chat data for this log id
$sql = "DELETE FROM $chatlogTable WHERE id='$value'";
mysql_query($sql,$conn);mysql_error()?(print(mysql_error())):'';
$sql = "DELETE FROM $chatdataTable WHERE chatlogid='$value'";
mysql_query($sql,$conn);mysql_error()?(print(mysql_error())):'';
}
}
//retain last search
$r = GetPeriod1($p);
$sd = $r[0];
$ed = $r[1];
}else if ($_POST['chatremovebutton']){
$cid = $_SESSION['cid'];
$sql = "DELETE $chatdataTable, $chatlogTable FROM $chatdataTable, $chatlogTable WHERE ".$chatdataTable.".chatlogid = ".$chatlogTable.".id AND ".$chatlogTable.".action = 'closed' AND ".$chatlogTable.".cid = '$cid' AND ".$chatdataTable.".cid = '$cid'";
mysql_query($sql,$conn);mysql_error()?(print(mysql_error())):'';
//retain last search
$r = GetPeriod1($p);
$sd = $r[0];
$ed = $r[1];
}else{
//defaults
$r = GetPeriod1(1);
$sd = $r[0];
$ed = $r[1];
}
}
//update period select
if ((!isset($p))||($p=='')){$p=1;}
$psel[$p] = ' selected="selected"';
//update the status
//$ct = array('All chats','Closed','Interactive','Link followed','Sale');
$ct = array('All actions','Interactive action','Link followed action','Email action','Sale action','No actions','All chats');
$chattype_options = '';
if ((!isset($chattype))||($chattype=='')){$chattype=1;}
foreach ($ct as $key=>$value){
$kk = $key+1;
if ($kk == $chattype){
$chattype_options .= '<option value="'.$kk.'" selected="selected">'.$value.'</option>';
$chattype_text = $value;
}else{
$chattype_options .= '<option value="'.$kk.'">'.$value.'</option>';
}
}
//items per page
$chatsperpage_options = '';
$cp = array(10,20,50,100);
foreach($cp as $value){
if ($value == $rows){
$chatsperpage_options .= '<option value="'.$value.'" selected="selected">'.$value.'</option>';
}else{
$chatsperpage_options .= '<option value="'.$value.'">'.$value.'</option>';
}
}
if ($_POST['chattype'] == '6'){
$showremovebutton = '<input type="submit" name="chatremovebutton" id="chatremovebutton" value="Remove all NO ACTION chats" onClick="return deleteNAChats();" />';
}else{
$showremovebutton = '';
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<LINK href="style.css" type=text/css rel=stylesheet>
<title>Virtual Agent Control Panel</title>
<script language="JavaScript">
function deleteClient(){
var m = 'WARNING: Are you sure you want to remove selected chat log(s) with all associated messages? ';
m = m + 'Click "OK" to remove.'+"\n";
var agree=confirm(m);
if (agree)
return true;
else
return false;
}
function deleteNAChats(){
var m = 'WARNING: Are you sure you want to remove ALL the "No Action"';
m = m + 'chat logs for all time for the currently selected campaign?';
m = m + 'Click "OK" to remove all.'+"\n";
var agree=confirm(m);
if (agree)
return true;
else
return false;
}
function ToggleChecks(total){
var f1 = document.chatform.selectlogs;
//set the checkboxes
for (var i = 1; i <= total; i++){
box = eval("document.chatform.clogid" + i);
if(box){
if (f1.checked){
if (box.checked == false) box.checked = true;
}else{
if (box.checked == true) box.checked = false;
}
}
}
}
</script>
</head>
<body>
<?php echo $menu; ?>
<table width="700" border="0" align="center" cellpadding="10" cellspacing="0" bgcolor="#FFFFFF" class="admin_grey_border">
<tr>
<td><div align="center"><strong>Chat Logs</strong><?php echo $errors; ?></div></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td><p>In this section the you can view all the chat logs between your virtual agents and potential customers. Make sure to consistantly review these chat logs and refine your messages to cover all your customer questions.<br />
</p></td>
</tr>
<tr>
<td><hr class="grey_dashed" /></td>
</tr>
<tr>
<td bgcolor="#<?php echo $sectioncolor; ?>">Chat Logs</td>
</tr>
<tr>
<td>
<?php echo $showchatdata; ?>
<?php echo $hide1; ?>
<form name="chatform" method="post" action="chats.php">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="70" height="28" align="right">Period:</td>
<td width="100"><select name="selectperiod" id="selectperiod" style="width: 140px">
<option value="1"<?php echo $psel[1]; ?>>Today</option>
<option value="2"<?php echo $psel[2]; ?>>Yesterday</option>
<option value="3"<?php echo $psel[3]; ?>>Last 7 Days</option>
<option value="4"<?php echo $psel[4]; ?>>This Month</option>
<option value="5"<?php echo $psel[5]; ?>>Last Month</option>
<option value="6"<?php echo $psel[6]; ?>>This Year</option>
<option value="7"<?php echo $psel[7]; ?>>Last Year</option>
<option value="8"<?php echo $psel[8]; ?>>All Time</option>
</select></td>
<td width="478" rowspan="4"><table width="130" border="0" align="right" cellpadding="2" cellspacing="0">
<tr>
<td colspan="3"><strong>Legend</strong></td>
</tr>
<tr>
<td width="44">IN</td>
<td width="18"><img src="images/checkpink.png" width="18" height="18" /></td>
<td width="82" nowrap="nowrap">: Interaction</td>
</tr>
<tr>
<td>LF</td>
<td><img src="images/checkblue.png" width="18" height="18" /></td>
<td nowrap="nowrap">: Link followed</td>
</tr>
<tr>
<td>SA</td>
<td><img src="images/checkgreen.png" width="18" height="18" /></td>
<td nowrap="nowrap">: Sale</td>
</tr>
<tr>
<td>EM</td>
<td><img src="images/checkgrey.png" width="18" height="18" /></td>
<td nowrap="nowrap">: Email given</td>
</tr>
</table></td>
</tr>
<tr>
<td nowrap="nowrap"><div align="right">Chat type:</div></td>
<td><select name="chattype" id="chattype" style="width: 140px">
<?php echo $chattype_options; ?>
</select> </td>
</tr>
<tr>
<td nowrap="nowrap"><div align="right">Chats/page:</div></td>
<td><select name="chatsperpage" id="chatsperpage" style="width: 140px">
<?php echo $chatsperpage_options; ?>
</select></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="actionbutton" id="actionbutton" value="Display Chat Logs" /></td>
</tr>
</table>
<p><?php echo doChatLogTable($_SESSION['cid'],$sd,$ed,$p,$chattype,$chattype_text,$offset,$rows); ?>
<input type="submit" name="deletebutton" id="deletebutton" value="Remove Selected" onClick="return deleteClient();" />
<?php echo $showremovebutton; ?>
</p>
</form>
<?php echo $hide2; ?> </td>
</tr>
<tr>
<td><hr class="grey_dashed" /></td>
</tr>
</table></td>
</tr>
<tr>
<td><div align="center"><?php echo $copyright; ?><?php echo $bottomlinks; ?></div></td>
</tr>
</table>
<?php echo $cbottom; ?>
</body>
</html>