| 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/boxes/ |
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('../modfiles/db.php');
include('../globals.php');
//get posted variables
$cid = $_GET['cid'];
//connect to db
$conn = mysql_connect("$dbhost", "$dblogin", "$dbpass") or die ('ERROR');
mysql_select_db($dbname, $conn);
//add new smart agent message
if ($_POST['actionbutton']){
$keywords = $_POST['keywords'];
$message = $_POST['message'];
$cid = $_POST['cid'];
//prepare some variables
$message = trim($message);
$message = addslashes($message);
//need to check for message first then continue
if ((!isset($message))||($message=='')){
$show = 'The message was not entered<br /><br />';
$show .= '<a href="smartaddbox.php?cid='.$cid.'">Click Here to Go Back</a>';
$show = '<span style="color: #FF0000">'.$show.'</span>';
}else if((!isset($keywords))||($keywords=='')){
$show = 'The keywords were not entered<br /><br />';
$show .= '<a href="smartaddbox.php?cid='.$cid.'">Click Here to Go Back</a>';
$show = '<span style="color: #FF0000">'.$show.'</span>';
}else{
//prepare the keywords for db entry
$keywords = trim($keywords);
$tmp = explode("\n",$keywords);
$kw = '';
foreach($tmp as $value){
$value = trim($value);
if($value != ''){
$kw = $kw.$value.', ';
}
}
$kw = trim($kw);
$kw = substr($kw,0,strlen($kw)-1);
$kw = addslashes($kw);
//insert new message
$sql = "INSERT INTO $smartTable VALUES(null,'$cid','$kw','$message')";
mysql_query($sql,$conn);mysql_error()?(print(mysql_error())):'';
$show .= 'The new smart agent message has been added.<br /><br />';
$show .= '<a href="../messages.php" target="_parent">click here to continue</a>';
$show = '<center>'.$show.'</center>';
}
//wrap html in a table and hide the input table
$show = '<table width="100%" cellspacing="0" cellpadding="10"><tr><td>'.$show.'</td></tr></table>';
$hide1 = '<!--';
$hide2 = '-->';
}
//build predefined data codes
$codeoptions = '<option value="0" selected="selected">-- Select --</option>';
foreach($systemcodes as $key=>$value){
if (strpos($key,'date') !== false){
$codeoptions .= '<option value="'.$value[0].'">'.$value[0].' ('.date($value[1]).')</option>';
}else{
$codeoptions .= '<option value="'.$value[0].'">'.$value[0].' ('.$value[1].')</option>';
}
}
//build the links drop-down select
$linkoptions = '<option value="0" selected="selected">-- Select --</option>';
$sql = "SELECT * FROM $linksTable WHERE cid='$cid'";
$result = mysql_query($sql,$conn);mysql_error()?(print(mysql_error())):'';
while(list($id,$ccid,$code,$content,$link,$style)=@mysql_fetch_row($result)){
$linkoptions .= '<option value="'.$code.'">'.$code.'</option>';
}
?>
<!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>campaign</title>
<script language="JavaScript">
function EnterCode(which){
if (which == 0){
var code = document.boxform.codes.value;
}else{
var code = document.boxform.links.value;
}
if ((code != '')&&(code != '0')){
document.boxform.message.value = document.boxform.message.value + code;
document.boxform.codes.selectedIndex =0;
document.boxform.links.selectedIndex =0;
}
}
</script>
</head>
<body>
<?php echo $show; ?>
<?php echo $hide1; ?>
<form name="boxform" action="smartaddbox.php" method="post">
<input type="hidden" name="cid" value="<?php echo $cid; ?>" />
<table width="400" border="0" align="center" cellpadding="10" cellspacing="0">
<tr>
<td width="388"><table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr>
<td colspan="2" valign="top"><div align="center"><strong>Add New Smart Agent Message</strong></div></td>
</tr>
<tr>
<td valign="top" nowrap="nowrap" bgcolor="#E9E9E9"><div align="right">Keywords:<br />
(one keyword or<br />
phrase per line)</div></td>
<td bgcolor="#E9E9E9"><label>
<textarea name="keywords" id="keywords" cols="45" rows="4" style="width: 250px; height: 70px"><?php echo $keywords; ?></textarea>
</label></td>
</tr>
<tr>
<td valign="top" nowrap="nowrap" bgcolor="#E9E9E9"><div align="right">System Code:</div></td>
<td bgcolor="#E9E9E9"><select name="codes" id="codes" style="width: 250px" onchange="EnterCode(0)">
<?php echo $codeoptions; ?>
</select></td>
</tr>
<tr>
<td width="36%" valign="top" nowrap="nowrap" bgcolor="#E9E9E9"><div align="right">Predefined Link:</div></td>
<td width="64%" bgcolor="#E9E9E9"><select name="links" id="links" style="width: 250px" onchange="EnterCode(1)">
<?php echo $linkoptions; ?>
</select></td>
</tr>
<tr>
<td valign="top" nowrap="nowrap" bgcolor="#E9E9E9"><div align="right">Message:</div></td>
<td bgcolor="#E9E9E9"><textarea name="message" id="message" cols="45" rows="8" style="width: 250px; height: 130px"><?php echo $message; ?></textarea> </td>
</tr>
<tr>
<td colspan="2" bgcolor="#E9E9E9"><table width="100" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td><input type="submit" name="actionbutton" value="Add New Message" /></td>
<td><input type="submit" id="Login" value="Cancel" onclick="self.parent.tb_remove();" /></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<?php echo $hide2; ?>
</body>
</html>