updated translation files for agent translations

updated agent translations for Spanish(es) and Italian(it)

git-svn-id: svn://192.168.202.10@1487 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2010-07-29 03:36:39 +00:00
parent ccca095ac2
commit 1328d92618
36 changed files with 6049 additions and 582 deletions
@@ -145,7 +145,7 @@ if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') )
{
header ("Content-type: text/html; charset=utf-8");
echo "<title>web client astGUIclient: Conexión</title>\n";
echo "<title>web client astGUIclient: Login</title>\n";
echo "</head>\n";
echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
echo "<TABLE><TR><TD></TD>\n";
@@ -0,0 +1,95 @@
/* calendar icon */
img.tcalIcon {
cursor: pointer;
margin-left: 1px;
vertical-align: middle;
}
/* calendar container element */
div#tcal {
position: absolute;
visibility: hidden;
z-index: 100;
width: 158px;
padding: 2px 0 0 0;
}
/* all tables in calendar */
div#tcal table {
width: 100%;
border: 1px solid silver;
border-collapse: collapse;
background-color: white;
}
/* navigation table */
div#tcal table.ctrl {
border-bottom: 0;
}
/* navigation buttons */
div#tcal table.ctrl td {
width: 15px;
height: 20px;
}
/* month year header */
div#tcal table.ctrl th {
background-color: white;
color: black;
border: 0;
}
/* week days header */
div#tcal th {
border: 1px solid silver;
border-collapse: collapse;
text-align: center;
padding: 3px 0;
font-family: tahoma, verdana, arial;
font-size: 10px;
background-color: gray;
color: white;
}
/* date cells */
div#tcal td {
border: 0;
border-collapse: collapse;
text-align: center;
padding: 2px 0;
font-family: tahoma, verdana, arial;
font-size: 11px;
width: 22px;
cursor: pointer;
}
/* date highlight
in case of conflicting settings order here determines the priority from least to most important */
div#tcal td.othermonth {
color: silver;
}
div#tcal td.weekend {
background-color: #ACD6F5;
}
div#tcal td.today {
border: 1px solid red;
}
div#tcal td.selected {
background-color: #FFB3BE;
}
/* iframe element used to suppress windowed controls in IE5/6 */
iframe#tcalIF {
position: absolute;
visibility: hidden;
z-index: 98;
border: 0;
}
/* transparent shadow */
div#tcalShade {
position: absolute;
visibility: hidden;
z-index: 99;
}
div#tcalShade table {
border: 0;
border-collapse: collapse;
width: 100%;
}
div#tcalShade table td {
border: 0;
border-collapse: collapse;
padding: 0;
}
@@ -0,0 +1,335 @@
// Tigra Calendar v4.0.2 (2009-01-12) Database (yyyy-mm-dd)
// http://www.softcomplex.com/products/tigra_calendar/
// Public Domain Software... You're welcome.
// default settins
var A_TCALDEF = {
'months' : ['Enero', 'February', 'Marcha', 'Abril', 'Puede', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
'yearscroll': true, // show year scroller
'weekstart': 0, // first day of week: 0-Su or 1-Mo
'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx.
'imgpath' : '../agc/images/' // directory with calendar images
}
// date parsing function
function f_tcalParseDate (s_date) {
var re_date = /^\s*(\d{2,4})\-(\d{1,2})\-(\d{1,2})\s*$/;
if (!re_date.exec(s_date))
return alert ("Inválido date: '" + s_date + "'.\nAccepted format is yyyy-mm-dd.")
var n_day = Number(RegExp.$3),
n_month = Number(RegExp.$2),
n_year = Number(RegExp.$1);
if (n_year < 100)
n_year += (n_year < this.a_tpl.centyear ? 2000 : 1900);
if (n_month < 1 || n_month > 12)
return alert ("Inválido month value: '" + n_month + "'.\nAllowed range is 01-12.");
var d_numdays = new Date(n_year, n_month, 0);
if (n_day > d_numdays.getDate())
return alert("Inválido day of month value: '" + n_day + "'.\nAllowed range for selected month is 01 - " + d_numdays.getDate() + ".");
return new Date (n_year, n_month - 1, n_day);
}
// date generating function
function f_tcalGenerDate (d_date) {
return (
d_date.getFullYear() + "-"
+ (d_date.getMonth() < 9 ? '0' : '') + (d_date.getMonth() + 1) + "-"
+ (d_date.getDate() < 10 ? '0' : '') + d_date.getDate()
);
}
// implementation
function tcal (a_cfg, a_tpl) {
// apply default template if not specified
if (!a_tpl)
a_tpl = A_TCALDEF;
// register in global collections
if (!window.A_TCALS)
window.A_TCALS = [];
if (!window.A_TCALSIDX)
window.A_TCALSIDX = [];
this.s_id = a_cfg.id ? a_cfg.id : A_TCALS.length;
window.A_TCALS[this.s_id] = this;
window.A_TCALSIDX[window.A_TCALSIDX.length] = this;
// assign methods
this.f_show = f_tcal_show;
this.f_hide = f_tcal_hide;
this.f_toggle = f_tcalToggle;
this.f_update = f_tcalUpdate;
this.f_relDate = f_tcalRelDate;
this.f_parseDate = f_tcalParseDate;
this.f_generDate = f_tcalGenerDate;
// create calendar icon
this.s_iconId = 'tcalico_' + this.s_id;
this.e_icon = f_getElement(this.s_iconId);
if (!this.e_icon) {
document.write('<img src="' + a_tpl.imgpath + 'cal.gif" id="' + this.s_iconId + '" onclick="A_TCALS[\'' + this.s_id + '\'].f_toggle()" class="tcalIcon" alt="Open Calendar" />');
this.e_icon = f_getElement(this.s_iconId);
}
// save received parameters
this.a_cfg = a_cfg;
this.a_tpl = a_tpl;
}
function f_tcal_show (d_date) {
// find input field
if (!this.a_cfg.controlname)
throw("TC: control name is not specified");
if (this.a_cfg.formname) {
var e_form = document.forms[this.a_cfg.formname];
if (!e_form)
throw("TC: form '" + this.a_cfg.formname + "' can not be found");
this.e_input = e_form.elements[this.a_cfg.controlname];
}
else
this.e_input = f_getElement(this.a_cfg.controlname);
if (!this.e_input || !this.e_input.tagName || this.e_input.tagName != 'INPUT')
throw("TC: element '" + this.a_cfg.controlname + "' does not exist in "
+ (this.a_cfg.formname ? "form '" + this.a_cfg.controlname + "'" : 'this document'));
// dynamically create HTML elements if needed
this.e_div = f_getElement('tcal');
if (!this.e_div) {
this.e_div = document.createElement("DIV");
this.e_div.id = 'tcal';
document.body.appendChild(this.e_div);
}
this.e_shade = f_getElement('tcalShade');
if (!this.e_shade) {
this.e_shade = document.createElement("DIV");
this.e_shade.id = 'tcalShade';
document.body.appendChild(this.e_shade);
}
this.e_iframe = f_getElement('tcalIF')
if (b_ieFix && !this.e_iframe) {
this.e_iframe = document.createElement("IFRAME");
this.e_iframe.style.filter = 'alpha(opacity=0)';
this.e_iframe.id = 'tcalIF';
this.e_iframe.src = this.a_tpl.imgpath + 'pixel.gif';
document.body.appendChild(this.e_iframe);
}
// hide all calendars
f_tcal_hideAll();
// generate HTML and show calendar
this.e_icon = f_getElement(this.s_iconId);
if (!this.f_update())
return;
this.e_div.style.visibility = 'visible';
this.e_shade.style.visibility = 'visible';
if (this.e_iframe)
this.e_iframe.style.visibility = 'visible';
// change icon and status
this.e_icon.src = this.a_tpl.imgpath + 'no_cal.gif';
this.e_icon.title = 'Close Calendar';
this.b_visible = true;
}
function f_tcal_hide (n_date) {
if (n_date)
this.e_input.value = this.f_generDate(new Date(n_date));
// no action if not visible
if (!this.b_visible)
return;
// hide elements
if (this.e_iframe)
this.e_iframe.style.visibility = 'hidden';
if (this.e_shade)
this.e_shade.style.visibility = 'hidden';
this.e_div.style.visibility = 'hidden';
// change icon and status
this.e_icon = f_getElement(this.s_iconId);
this.e_icon.src = this.a_tpl.imgpath + 'cal.gif';
this.e_icon.title = 'Open Calendar';
this.b_visible = false;
}
function f_tcalToggle () {
return this.b_visible ? this.f_hide() : this.f_show();
}
function f_tcalUpdate (d_date) {
var d_today = this.a_cfg.today ? this.f_parseDate(this.a_cfg.today) : f_tcalResetTime(new Date());
var d_selected = this.e_input.value == ''
? (this.a_cfg.selected ? this.f_parseDate(this.a_cfg.selected) : d_today)
: this.f_parseDate(this.e_input.value);
// figure out date to display
if (!d_date)
// selected by default
d_date = d_selected;
else if (typeof(d_date) == 'number')
// get from number
d_date = f_tcalResetTime(new Date(d_date));
else if (typeof(d_date) == 'string')
// parse from string
this.f_parseDate(d_date);
if (!d_date) return false;
// first date to display
var d_firstday = new Date(d_date);
d_firstday.setDate(1);
d_firstday.setDate(1 - (7 + d_firstday.getDay() - this.a_tpl.weekstart) % 7);
var a_class, s_html = '<table class="ctrl"><tbody><tr>'
+ (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, -1, 'y') + ' title="Previous Year"><img src="' + this.a_tpl.imgpath + 'prev_year.gif" /></td>' : '')
+ '<td' + this.f_relDate(d_date, -1) + ' title="Previous Month"><img src="' + this.a_tpl.imgpath + 'prev_mon.gif" /></td><th>'
+ this.a_tpl.months[d_date.getMonth()] + ' ' + d_date.getFullYear()
+ '</th><td' + this.f_relDate(d_date, 1) + ' title="Next Month"><img src="' + this.a_tpl.imgpath + 'next_mon.gif" /></td>'
+ (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, 1, 'y') + ' title="Next Year"><img src="' + this.a_tpl.imgpath + 'next_year.gif" /></td></td>' : '')
+ '</tr></tbody></table><table><tbody><tr class="wd">';
// print weekdays titles
for (var i = 0; i < 7; i++)
s_html += '<th>' + this.a_tpl.weekdays[(this.a_tpl.weekstart + i) % 7] + '</th>';
s_html += '</tr>' ;
// print calendar table
var n_date, n_month, d_current = new Date(d_firstday);
while (d_current.getMonth() == d_date.getMonth() ||
d_current.getMonth() == d_firstday.getMonth()) {
// print row heder
s_html +='<tr>';
for (var n_wday = 0; n_wday < 7; n_wday++) {
a_class = [];
n_date = d_current.getDate();
n_month = d_current.getMonth();
// other month
if (d_current.getMonth() != d_date.getMonth())
a_class[a_class.length] = 'othermonth';
// weekend
if (d_current.getDay() == 0 || d_current.getDay() == 6)
a_class[a_class.length] = 'weekend';
// today
if (d_current.valueOf() == d_today.valueOf())
a_class[a_class.length] = 'today';
// selected
if (d_current.valueOf() == d_selected.valueOf())
a_class[a_class.length] = 'selected';
s_html += '<td onclick="A_TCALS[\'' + this.s_id + '\'].f_hide(' + d_current.valueOf() + ')"' + (a_class.length ? ' class="' + a_class.join(' ') + '">' : '>') + n_date + '</td>'
d_current.setDate(++n_date);
while (d_current.getDate() != n_date && d_current.getMonth() == n_month) {
d_current.setHours(d_current.getHours + 1);
d_current = f_tcalResetTime(d_current);
}
}
// print row footer
s_html +='</tr>';
}
s_html +='</tbody></table>';
// update HTML, positions and sizes
this.e_div.innerHTML = s_html;
var n_width = this.e_div.offsetWidth;
var n_height = this.e_div.offsetHeight;
var n_top = f_getPosition (this.e_icon, 'Top') + this.e_icon.offsetHeight;
var n_left = f_getPosition (this.e_icon, 'Left') - n_width + this.e_icon.offsetWidth;
if (n_left < 0) n_left = 0;
this.e_div.style.left = n_left + 'px';
this.e_div.style.top = n_top + 'px';
this.e_shade.style.width = (n_width + 8) + 'px';
this.e_shade.style.left = (n_left - 1) + 'px';
this.e_shade.style.top = (n_top - 1) + 'px';
this.e_shade.innerHTML = b_ieFix
? '<table><tbody><tr><td rowspan="2" colspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_tr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td height="' + (n_height - 7) + '" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_mr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td width="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bl.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bm.png\', sizingMethod=\'scale\');" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_br.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tbody></table>'
: '<table><tbody><tr><td rowspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td rowspan="2"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7"><img src="' + this.a_tpl.imgpath + 'shade_tr.png"></td></tr><tr><td background="' + this.a_tpl.imgpath + 'shade_mr.png" height="' + (n_height - 7) + '"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td><img src="' + this.a_tpl.imgpath + 'shade_bl.png"></td><td background="' + this.a_tpl.imgpath + 'shade_bm.png" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td><img src="' + this.a_tpl.imgpath + 'shade_br.png"></td></tr><tbody></table>';
if (this.e_iframe) {
this.e_iframe.style.left = n_left + 'px';
this.e_iframe.style.top = n_top + 'px';
this.e_iframe.style.width = (n_width + 6) + 'px';
this.e_iframe.style.height = (n_height + 6) +'px';
}
return true;
}
function f_getPosition (e_elemRef, s_coord) {
var n_pos = 0, n_offset,
e_elem = e_elemRef;
while (e_elem) {
n_offset = e_elem["offset" + s_coord];
n_pos += n_offset;
e_elem = e_elem.offsetParent;
}
// margin correction in some browsers
if (b_ieMac)
n_pos += parseInt(document.body[s_coord.toLowerCase() + 'Margin']);
else if (b_safari)
n_pos -= n_offset;
e_elem = e_elemRef;
while (e_elem != document.body) {
n_offset = e_elem["scroll" + s_coord];
if (n_offset && e_elem.style.overflow == 'scroll')
n_pos -= n_offset;
e_elem = e_elem.parentNode;
}
return n_pos;
}
function f_tcalRelDate (d_date, d_diff, s_units) {
var s_units = (s_units == 'y' ? 'FullYear' : 'Month');
var d_result = new Date(d_date);
d_result['set' + s_units](d_date['get' + s_units]() + d_diff);
if (d_result.getDate() != d_date.getDate())
d_result.setDate(0);
return ' onclick="A_TCALS[\'' + this.s_id + '\'].f_update(' + d_result.valueOf() + ')"';
}
function f_tcal_hideAll () {
for (var i = 0; i < window.A_TCALSIDX.length; i++)
window.A_TCALSIDX[i].f_hide();
}
function f_tcalResetTime (d_date) {
d_date.setHours(0);
d_date.setMinutes(0);
d_date.setSeconds(0);
d_date.setMilliseconds(0);
return d_date;
}
f_getElement = document.all ?
function (s_id) { return document.all[s_id] } :
function (s_id) { return document.getElementById(s_id) };
if (document.addEventListener)
window.addEventListener('scroll', f_tcal_hideAll, false);
if (window.attachEvent)
window.attachEvent('onscroll', f_tcal_hideAll);
// global variables
var s_userAgent = navigator.userAgent.toLowerCase(),
re_webkit = /WebKit\/(\d+)/i;
var b_mac = s_userAgent.indexOf('mac') != -1,
b_ie5 = s_userAgent.indexOf('msie 5') != -1,
b_ie6 = s_userAgent.indexOf('msie 6') != -1 && s_userAgent.indexOf('opera') == -1;
var b_ieFix = b_ie5 || b_ie6,
b_ieMac = b_mac && b_ie5,
b_safari = b_mac && re_webkit.exec(s_userAgent) && Number(RegExp.$1) < 500;
@@ -1,7 +1,7 @@
<?php
# conf_exten_check.php version 2.2.0
# conf_exten_check.php version 2.4
#
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to send whether the meetme conference has live channels connected and which they are
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
@@ -50,10 +50,12 @@
# 91130-2022 - Added code for manager override of in-group selection
# 91228-1341 - Added API fields update functions
# 100109-1337 - Fixed Manual dial live call detection
# 100527-0957 - Added send_dtmf, transfer_conference and park_call API functions
# 100727-2209 - Added timer actions for hangup, extension, callmenu and ingroup as well as destination
#
$version = '2.2.0-25';
$build = '100109-1337';
$version = '2.4-27';
$build = '100727-2209';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=32;
$one_mysql_log=0;
@@ -387,7 +389,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
}
### grab the API hangup and API dispo fields in vicidial_live_agents
$stmt="SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_update_fields_data,external_timer_action,external_timer_action_message,external_timer_action_seconds from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
$stmt="SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_update_fields_data,external_timer_action,external_timer_action_message,external_timer_action_seconds,external_dtmf,external_transferconf,external_park,external_timer_action_destination from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03010',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -401,6 +403,10 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
$timer_action = $row[6];
$timer_action_message = $row[7];
$timer_action_seconds = $row[8];
$external_dtmf = $row[9];
$external_transferconf = $row[10];
$external_park = $row[11];
$timer_action_destination = $row[12];
if (strlen($external_status)<1) {$external_status = '::::::::::';}
@@ -570,7 +576,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
if ($Ashift_logout > 0)
{$Alogin='SHIFT_LOGOUT';}
echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Estado: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . '|DEADcall: ' . $DEADcustomer . '|InGroupChange: ' . $InGroupChangeDetails . '|APIFields: ' . $external_update_fields . '|APIFieldsData: ' . $external_update_fields_data . '|APITimerAction: ' . $timer_action . '|APITimerMessage: ' . $timer_action_message . '|APITimerSeconds: ' . $timer_action_seconds . "\n";
echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Estado: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . '|DEADcall: ' . $DEADcustomer . '|InGroupChange: ' . $InGroupChangeDetails . '|APIFields: ' . $external_update_fields . '|APIFieldsData: ' . $external_update_fields_data . '|APITimerAction: ' . $timer_action . '|APITimerMessage: ' . $timer_action_message . '|APITimerSeconds: ' . $timer_action_seconds . '|APIdtmf: ' . $external_dtmf . '|APItransferconf: ' . $external_transferconf . '|APIpark: ' . $external_park . '|APITimerDestination: ' . $timer_action_destination . "\n";
if (strlen($timer_action) > 3)
{
+504
View File
@@ -0,0 +1,504 @@
<?php
#
# functions.php version 2.4
#
# functions for agent scripts
#
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
#
# CHANGES:
# 100629-1201 - First Build
#
##### BEGIN gather values for display of custom list fields for a lead #####
function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user)
{
$STARTtime = date("U");
$TODAY = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|';
require("dbconnect.php");
$CFoutput='';
$stmt="SHOW TABLES LIKE \"custom_$list_id\";";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05002',$user,$server_ip,$session_name,$one_mysql_log);}
$tablecount_to_print = mysql_num_rows($rslt);
if ($tablecount_to_print > 0)
{
$stmt="SELECT count(*) from custom_$list_id;";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05003',$user,$server_ip,$session_name,$one_mysql_log);}
$fieldscount_to_print = mysql_num_rows($rslt);
if ($fieldscount_to_print > 0)
{
$rowx=mysql_fetch_row($rslt);
$custom_records_count = $rowx[0];
$select_SQL='';
$stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05004',$user,$server_ip,$session_name,$one_mysql_log);}
$fields_to_print = mysql_num_rows($rslt);
$fields_list='';
$o=0;
while ($fields_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$A_field_id[$o] = $rowx[0];
$A_field_label[$o] = $rowx[1];
$A_field_name[$o] = $rowx[2];
$A_field_description[$o] = $rowx[3];
$A_field_rank[$o] = $rowx[4];
$A_field_help[$o] = $rowx[5];
$A_field_type[$o] = $rowx[6];
$A_field_options[$o] = $rowx[7];
$A_field_size[$o] = $rowx[8];
$A_field_max[$o] = $rowx[9];
$A_field_default[$o] = $rowx[10];
$A_field_cost[$o] = $rowx[11];
$A_field_required[$o] = $rowx[12];
$A_multi_position[$o] = $rowx[13];
$A_name_position[$o] = $rowx[14];
$A_field_order[$o] = $rowx[15];
$A_field_value[$o] = '';
if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields))
{
if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') )
{
$select_SQL .= "8,";
$A_field_select[$o]='----EMPTY----';
}
else
{
$select_SQL .= "$A_field_label[$o],";
$A_field_select[$o]=$A_field_label[$o];
}
}
else
{
$select_SQL .= "8,";
$A_field_value[$o] = '--A--' . $A_field_label[$o] . '--B--';
}
$o++;
$rank_select .= "<option>$o</option>";
}
$o++;
$rank_select .= "<option>$o</option>";
$last_rank = $o;
$select_SQL = preg_replace("/.$/",'',$select_SQL);
##### BEGIN grab the data from custom table for the lead_id
$stmt="SELECT $select_SQL FROM custom_$list_id where lead_id='$lead_id' LIMIT 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05005',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$list_lead_ct = mysql_num_rows($rslt);
if ($list_lead_ct > 0)
{
$row=mysql_fetch_row($rslt);
$o=0;
while ($fields_to_print >= $o)
{
$A_field_value[$o] = trim("$row[$o]");
if ($A_field_select[$o]=='----EMPTY----')
{$A_field_value[$o]='';}
if (preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields))
{$A_field_value[$o] = '--A--' . $A_field_label[$o] . '--B--';}
$o++;
}
}
else
{
if ($DB) {echo "ERROR: no custom data for this lead: $lead_id\n";}
}
##### END grab the data from custom table for the lead_id
$CFoutput .= "<input type=hidden name=stage id=stage value=\"SUBMIT\">\n";
$CFoutput .= "<center><TABLE cellspacing=2 cellpadding=2>\n";
if ($fields_to_print < 1)
{$CFoutput .= "<tr bgcolor=white align=center><td colspan=4><font size=1>There are no custom fields for this list</td></tr>";}
$o=0;
$last_field_rank=0;
while ($fields_to_print > $o)
{
$helpHTML='';
if (strlen($A_field_help[$o])>0)
{$helpHTML="&nbsp; <a href=\"javascript:open_help('HELP_$A_field_label[$o]','$A_field_help[$o]');\">help+</a>";}
if ($last_field_rank=="$A_field_rank[$o]")
{$CFoutput .= " &nbsp; &nbsp; &nbsp; &nbsp; ";}
else
{
$CFoutput .= "</td></tr>\n";
$CFoutput .= "<tr bgcolor=white><td align=";
if ( ($A_name_position[$o]=='TOP') or ($A_field_type[$o]=='SCRIPT') )
{$CFoutput .= "left colspan=2";}
else
{$CFoutput .= "right";}
$CFoutput .= "><font size=2>";
}
if ($A_field_type[$o]!='SCRIPT')
{$CFoutput .= "<B>$A_field_name[$o]</B>";}
if ( ($A_name_position[$o]=='TOP') or ($A_field_type[$o]=='SCRIPT') )
{$CFoutput .= " &nbsp; <span style=\"position:static;\" id=P_HELP_$A_field_label[$o]></span><span style=\"position:static;background:white;\" id=HELP_$A_field_label[$o]> $helpHTML</span><BR>";}
else
{
if ($last_field_rank=="$A_field_rank[$o]")
{$CFoutput .= " &nbsp;";}
else
{$CFoutput .= "</td><td align=left><font size=2>";}
}
$field_HTML='';
if ($A_field_type[$o]=='SELECT')
{
$field_HTML .= "<select size=1 name=$A_field_label[$o] id=$A_field_label[$o]>\n";
}
if ($A_field_type[$o]=='MULTI')
{
$field_HTML .= "<select MULTIPLE size=$A_field_size[$o] name=$A_field_label[$o][] id=$A_field_label[$o][]>\n";
}
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') )
{
$field_options_array = explode("\n",$A_field_options[$o]);
$field_options_count = count($field_options_array);
$te=0;
while ($te < $field_options_count)
{
if (preg_match("/,/",$field_options_array[$te]))
{
$field_selected='';
$field_options_value_array = explode(",",$field_options_array[$te]);
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') )
{
if (strlen($A_field_value[$o]) > 0)
{
if (preg_match("/$field_options_value_array[0]/",$A_field_value[$o]))
{$field_selected = 'SELECTED';}
}
else
{
if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'SELECTED';}
}
$field_HTML .= "<option value=\"$field_options_value_array[0]\" $field_selected>$field_options_value_array[1]</option>\n";
}
if ( ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') )
{
if ($A_multi_position[$o]=='VERTICAL')
{$field_HTML .= " &nbsp; ";}
if (strlen($A_field_value[$o]) > 0)
{
if (preg_match("/$field_options_value_array[0]/",$A_field_value[$o]))
{$field_selected = 'CHECKED';}
}
else
{
if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'CHECKED';}
}
$field_HTML .= "<input type=$A_field_type[$o] name=$A_field_label[$o][] id=$A_field_label[$o][] value=\"$field_options_value_array[0]\" $field_selected> $field_options_value_array[1]\n";
if ($A_multi_position[$o]=='VERTICAL')
{$field_HTML .= "<BR>\n";}
}
}
$te++;
}
}
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') )
{
$field_HTML .= "</select>\n";
}
if ($A_field_type[$o]=='TEXT')
{
if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';}
if (strlen($A_field_value[$o]) < 1) {$A_field_value[$o] = $A_field_default[$o];}
$field_HTML .= "<input type=text size=$A_field_size[$o] maxlength=$A_field_max[$o] name=$A_field_label[$o] id=$A_field_label[$o] value=\"$A_field_value[$o]\">\n";
}
if ($A_field_type[$o]=='AREA')
{
if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';}
if (strlen($A_field_value[$o]) < 1) {$A_field_value[$o] = $A_field_default[$o];}
$field_HTML .= "<textarea name=$A_field_label[$o] id=$A_field_label[$o] ROWS=$A_field_max[$o] COLS=$A_field_size[$o]>$A_field_value[$o]</textarea>";
}
if ($A_field_type[$o]=='DISPLAY')
{
if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';}
$field_HTML .= "$A_field_default[$o]\n";
}
if ($A_field_type[$o]=='SCRIPT')
{
if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';}
$field_HTML .= "$A_field_options[$o]\n";
}
if ($A_field_type[$o]=='DATE')
{
if ( (strlen($A_field_default[$o])<1) or ($A_field_default[$o]=='NULL') ) {$A_field_default[$o]=0;}
$day_diff = $A_field_default[$o];
$default_date = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+$day_diff,date("Y")));
if (strlen($A_field_value[$o]) > 0) {$default_date = $A_field_value[$o];}
$field_HTML .= "<input type=text size=11 maxlength=10 name=$A_field_label[$o] id=$A_field_label[$o] value=\"$default_date\" onclick=\"f_tcalToggle()\">\n";
$field_HTML .= "<script language=\"JavaScript\">\n";
$field_HTML .= "var o_cal = new tcal ({\n";
$field_HTML .= " 'formname': 'form_custom_fields',\n";
$field_HTML .= " 'controlname': '$A_field_label[$o]'});\n";
$field_HTML .= "o_cal.a_tpl.yearscroll = false;\n";
$field_HTML .= "</script>\n";
}
if ($A_field_type[$o]=='TIME')
{
$minute_diff = $A_field_default[$o];
$default_time = date("H:i:s", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y")));
$default_hour = date("H", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y")));
$default_minute = date("i", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y")));
if (strlen($A_field_value[$o]) > 2)
{
$default_time = $A_field_value[$o];
$time_field_value = explode(':',$default_time);
$default_hour = $time_field_value[0];
$default_minute = $time_field_value[1];
}
$field_HTML .= "<input type=hidden name=$A_field_label[$o] id=$A_field_label[$o] value=\"$default_time\">";
$field_HTML .= "<SELECT name=HOUR_$A_field_label[$o] id=HOUR_$A_field_label[$o]>";
$field_HTML .= "<option>00</option>";
$field_HTML .= "<option>01</option>";
$field_HTML .= "<option>02</option>";
$field_HTML .= "<option>03</option>";
$field_HTML .= "<option>04</option>";
$field_HTML .= "<option>05</option>";
$field_HTML .= "<option>06</option>";
$field_HTML .= "<option>07</option>";
$field_HTML .= "<option>08</option>";
$field_HTML .= "<option>09</option>";
$field_HTML .= "<option>10</option>";
$field_HTML .= "<option>11</option>";
$field_HTML .= "<option>12</option>";
$field_HTML .= "<option>13</option>";
$field_HTML .= "<option>14</option>";
$field_HTML .= "<option>15</option>";
$field_HTML .= "<option>16</option>";
$field_HTML .= "<option>17</option>";
$field_HTML .= "<option>18</option>";
$field_HTML .= "<option>19</option>";
$field_HTML .= "<option>20</option>";
$field_HTML .= "<option>21</option>";
$field_HTML .= "<option>22</option>";
$field_HTML .= "<option>23</option>";
$field_HTML .= "<OPTION value=\"$default_hour\" selected>$default_hour</OPTION>";
$field_HTML .= "</SELECT>";
$field_HTML .= "<SELECT name=MINUTE_$A_field_label[$o] id=MINUTE_$A_field_label[$o]>";
$field_HTML .= "<option>00</option>";
$field_HTML .= "<option>05</option>";
$field_HTML .= "<option>10</option>";
$field_HTML .= "<option>15</option>";
$field_HTML .= "<option>20</option>";
$field_HTML .= "<option>25</option>";
$field_HTML .= "<option>30</option>";
$field_HTML .= "<option>35</option>";
$field_HTML .= "<option>40</option>";
$field_HTML .= "<option>45</option>";
$field_HTML .= "<option>50</option>";
$field_HTML .= "<option>55</option>";
$field_HTML .= "<OPTION value=\"$default_minute\" selected>$default_minute</OPTION>";
$field_HTML .= "</SELECT>";
}
if ( ($A_name_position[$o]=='LEFT') and ($A_field_type[$o]!='SCRIPT') )
{
$CFoutput .= " $field_HTML <span style=\"position:static;\" id=P_HELP_$A_field_label[$o]></span><span style=\"position:static;background:white;\" id=HELP_$A_field_label[$o]> $helpHTML</span>";
}
else
{
$CFoutput .= " $field_HTML\n";
}
$last_field_rank=$A_field_rank[$o];
$o++;
}
$CFoutput .= "</td></tr></table>\n";
}
else
{$CFoutput .= "ERROR: no custom list fields\n";}
}
else
{$CFoutput .= "ERROR: no custom list fields table\n";}
##### BEGIN parsing for vicidial variables #####
if (preg_match("/--A--/",$CFoutput))
{
if ( (eregi('--A--user_custom_',$CFoutput)) or (eregi('--A--fullname',$CFoutput)) )
{
$stmt = "select custom_one,custom_two,custom_three,custom_four,custom_five,full_name from vicidial_users where user='$user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05006',$user,$server_ip,$session_name,$one_mysql_log);}
$VUC_ct = mysql_num_rows($rslt);
if ($VUC_ct > 0)
{
$row=mysql_fetch_row($rslt);
$user_custom_one = trim($row[0]);
$user_custom_two = trim($row[1]);
$user_custom_three = trim($row[2]);
$user_custom_four = trim($row[3]);
$user_custom_five = trim($row[4]);
$fullname = trim($row[5]);
}
}
if (eregi('--A--dialed_',$CFoutput))
{
$dialed_number = $phone_number;
$dialed_label = 'NONE';
### find the dialed number and label for this call
$stmt = "SELECT phone_number,alt_dial from vicidial_log where uniqueid='$uniqueid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05008',$user,$server_ip,$session_name,$one_mysql_log);}
$vl_dialed_ct = mysql_num_rows($rslt);
if ($vl_dialed_ct > 0)
{
$row=mysql_fetch_row($rslt);
$dialed_number = $row[0];
$dialed_label = $row[1];
}
}
##### grab the data from vicidial_list for the lead_id
$stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner FROM vicidial_list where lead_id='$lead_id' LIMIT 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05007',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$list_lead_ct = mysql_num_rows($rslt);
if ($list_lead_ct > 0)
{
$row=mysql_fetch_row($rslt);
$dispo = trim($row[3]);
$tsr = trim($row[4]);
$vendor_id = trim($row[5]);
$vendor_lead_code = trim($row[5]);
$source_id = trim($row[6]);
$list_id = trim($row[7]);
$gmt_offset_now = trim($row[8]);
$phone_code = trim($row[10]);
$phone_number = trim($row[11]);
$title = trim($row[12]);
$first_name = trim($row[13]);
$middle_initial = trim($row[14]);
$last_name = trim($row[15]);
$address1 = trim($row[16]);
$address2 = trim($row[17]);
$address3 = trim($row[18]);
$city = trim($row[19]);
$state = trim($row[20]);
$province = trim($row[21]);
$postal_code = trim($row[22]);
$country_code = trim($row[23]);
$gender = trim($row[24]);
$date_of_birth = trim($row[25]);
$alt_phone = trim($row[26]);
$email = trim($row[27]);
$security = trim($row[28]);
$comments = trim($row[29]);
$called_count = trim($row[30]);
$rank = trim($row[32]);
$owner = trim($row[33]);
}
$CFoutput = eregi_replace('--A--lead_id--B--',"$lead_id",$CFoutput);
$CFoutput = eregi_replace('--A--vendor_id--B--',"$vendor_id",$CFoutput);
$CFoutput = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$CFoutput);
$CFoutput = eregi_replace('--A--list_id--B--',"$list_id",$CFoutput);
$CFoutput = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$CFoutput);
$CFoutput = eregi_replace('--A--phone_code--B--',"$phone_code",$CFoutput);
$CFoutput = eregi_replace('--A--phone_number--B--',"$phone_number",$CFoutput);
$CFoutput = eregi_replace('--A--title--B--',"$title",$CFoutput);
$CFoutput = eregi_replace('--A--first_name--B--',"$first_name",$CFoutput);
$CFoutput = eregi_replace('--A--middle_initial--B--',"$middle_initial",$CFoutput);
$CFoutput = eregi_replace('--A--last_name--B--',"$last_name",$CFoutput);
$CFoutput = eregi_replace('--A--address1--B--',"$address1",$CFoutput);
$CFoutput = eregi_replace('--A--address2--B--',"$address2",$CFoutput);
$CFoutput = eregi_replace('--A--address3--B--',"$address3",$CFoutput);
$CFoutput = eregi_replace('--A--city--B--',"$city",$CFoutput);
$CFoutput = eregi_replace('--A--state--B--',"$state",$CFoutput);
$CFoutput = eregi_replace('--A--province--B--',"$province",$CFoutput);
$CFoutput = eregi_replace('--A--postal_code--B--',"$postal_code",$CFoutput);
$CFoutput = eregi_replace('--A--country_code--B--',"$country_code",$CFoutput);
$CFoutput = eregi_replace('--A--gender--B--',"$gender",$CFoutput);
$CFoutput = eregi_replace('--A--date_of_birth--B--',"$date_of_birth",$CFoutput);
$CFoutput = eregi_replace('--A--alt_phone--B--',"$alt_phone",$CFoutput);
$CFoutput = eregi_replace('--A--email--B--',"$email",$CFoutput);
$CFoutput = eregi_replace('--A--security_phrase--B--',"$security_phrase",$CFoutput);
$CFoutput = eregi_replace('--A--comments--B--',"$comments",$CFoutput);
$CFoutput = eregi_replace('--A--user--B--',"$user",$CFoutput);
$CFoutput = eregi_replace('--A--pass--B--',"$pass",$CFoutput);
$CFoutput = eregi_replace('--A--campaign--B--',"$campaign",$CFoutput);
$CFoutput = eregi_replace('--A--server_ip--B--',"$server_ip",$CFoutput);
$CFoutput = eregi_replace('--A--session_id--B--',"$session_id",$CFoutput);
$CFoutput = eregi_replace('--A--dialed_number--B--',"$dialed_number",$CFoutput);
$CFoutput = eregi_replace('--A--dialed_label--B--',"$dialed_label",$CFoutput);
$CFoutput = eregi_replace('--A--source_id--B--',"$source_id",$CFoutput);
$CFoutput = eregi_replace('--A--rank--B--',"$rank",$CFoutput);
$CFoutput = eregi_replace('--A--owner--B--',"$owner",$CFoutput);
$CFoutput = eregi_replace('--A--fullname--B--',"$fullname",$CFoutput);
$CFoutput = eregi_replace('--A--uniqueid--B--',"$uniqueid",$CFoutput);
$CFoutput = eregi_replace('--A--user_custom_one--B--',"$user_custom_one",$CFoutput);
$CFoutput = eregi_replace('--A--user_custom_two--B--',"$user_custom_two",$CFoutput);
$CFoutput = eregi_replace('--A--user_custom_three--B--',"$user_custom_three",$CFoutput);
$CFoutput = eregi_replace('--A--user_custom_four--B--',"$user_custom_four",$CFoutput);
$CFoutput = eregi_replace('--A--user_custom_five--B--',"$user_custom_five",$CFoutput);
# custom fields replacement
$o=0;
while ($fields_to_print > $o)
{
$CFoutput = eregi_replace("--A--$A_field_label[$o]--B--","$A_field_value[$o]",$CFoutput);
$o++;
}
if ($DB > 0) {echo "$CFoutput<BR>\n";}
}
##### END parsing for vicidial variables #####
return $CFoutput;
}
##### END gather values for display of custom list fields for a lead #####
##### MySQL Error Logging #####
function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log)
{
$NOW_TIME = date("Y-m-d H:i:s");
# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log);
$errno=''; $error='';
if ( ($mel > 0) or ($one_mysql_log > 0) )
{
$errno = mysql_errno($link);
if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) )
{
$error = mysql_error($link);
$efp = fopen ("./vicidial_mysql_errors.txt", "a");
fwrite ($efp, "$NOW_TIME|vdc_db_query|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n");
fclose($efp);
}
}
$one_mysql_log=0;
return $errno;
}
?>
+36 -39
View File
@@ -1,7 +1,7 @@
<?php
# manager_send.php version 2.2.0
# manager_send.php version 2.4
#
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
@@ -12,7 +12,7 @@
# - $user
# - $pass
# optional variables:
# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectXtraCX','RedirectVD','HangupConfDial','VolumeControl','OriginateVDRelogin')
# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','SysCIDdtmfOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectXtraCX','RedirectVD','HangupConfDial','VolumeControl','OriginateVDRelogin')
# - $queryCID - ('CN012345678901234567',...)
# - $format - ('text','debug')
# - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...)
@@ -41,6 +41,7 @@
# - $agent_dialed_number - ('1','')
# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...)
# - $nodeletevdac - ('0','1')
# - $alertCID - ('0','1')
#
# CHANGELOG:
# 50401-1002 - First build of script, Hangup function only
@@ -94,10 +95,13 @@
# 91112-1110 - Added CALLOUTBOUND value to QM entry lookup
# 91205-2103 - Code cleanup
# 91213-1208 - Added queue_position to queue_log COMPLETE... records
# 100327-0846 - Fix for list_id override answering machine message
# 100423-2304 - Added alertCID
# 100527-1014 - Added SysCIDdtmfOriginate function
#
$version = '2.2.0-46';
$build = '91213-1208';
$version = '2.4-49';
$build = '100527-1014';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=85;
$one_mysql_log=0;
@@ -185,6 +189,8 @@ if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_diale
elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];}
if (isset($_GET["nodeletevdac"])) {$nodeletevdac=$_GET["nodeletevdac"];}
elseif (isset($_POST["nodeletevdac"])) {$nodeletevdac=$_POST["nodeletevdac"];}
if (isset($_GET["alertCID"])) {$alertCID=$_GET["alertCID"];}
elseif (isset($_POST["alertCID"])) {$alertCID=$_POST["alertCID"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -289,6 +295,20 @@ if ($format=='debug')
######################
# ACTION=SysCIDdtmfOriginate - prep the send dtmf command
######################
if ($ACTION=="SysCIDdtmfOriginate")
{
$stmt="UPDATE vicidial_live_agents SET external_dtmf='' where user='$user';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);}
$ACTION="SysCIDOriginate";
}
######################
# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls
@@ -390,7 +410,7 @@ if ($ACTION=="OriginateVDRelogin")
if ($ACTION=="Originate")
{
if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) )
if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or ( (strlen($queryCID)<10) && ($alertCID < 1) ) )
{
echo "ERROR Exten $exten No es válido or queryCID $queryCID No es válido, Originate comando no insertado\n";
}
@@ -734,39 +754,6 @@ if ($ACTION=="RedirectVD")
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02024',$user,$server_ip,$session_name,$one_mysql_log);}
}
else
{
if (strlen($lead_id) > 1)
{
$list_id='';
$stmt = "SELECT list_id FROM vicidial_list where lead_id='$lead_id';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02084',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$lio_ct = mysql_num_rows($rslt);
if ($lio_ct > 0)
{
$row=mysql_fetch_row($rslt);
$list_id = $row[0];
if (strlen($list_id) > 1)
{
$stmt = "SELECT am_message_exten_override FROM vicidial_lists where list_id='$list_id';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02085',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$lio_ct = mysql_num_rows($rslt);
if ($lio_ct > 0)
{
$row=mysql_fetch_row($rslt);
$am_message_exten_override = $row[0];
if (strlen($am_message_exten_override) > 0) {$exten = "$am_message_exten_override";}
}
}
}
}
}
$ACTION="Redirect";
}
}
@@ -799,6 +786,11 @@ if ($ACTION=="RedirectToPark")
# fwrite ($fp, "$NOW_TIME|MS_LOG_0|$queryCID|$stmt|\n");
# fclose($fp);
}
$stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);}
}
if ($ACTION=="RedirectFromPark")
@@ -823,6 +815,11 @@ if ($ACTION=="RedirectFromPark")
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);}
$ACTION="Redirect";
}
$stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);}
}
if ($ACTION=="RedirectName")
+8 -6
View File
@@ -9,10 +9,11 @@
# 80525-2351 - Added an audit log that is not to be editable
# 80602-0641 - Fixed status update bug
# 90508-0727 - Changed to PHP long tags
# 100621-1023 - Added admin_web_directory variable
#
$version = '2.2.0-5';
$build = '90508-0727';
$version = '2.2.0-6';
$build = '100621-1023';
$StarTtimE = date("U");
$NOW_TIME = date("Y-m-d H:i:s");
@@ -87,7 +88,7 @@ require("dbconnect.php");
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,admin_home_url FROM system_settings;";
$stmt = "SELECT use_non_latin,admin_home_url,admin_web_directory FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
@@ -95,8 +96,9 @@ $i=0;
while ($i < $qm_conf_ct)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$welcomeURL = $row[1];
$non_latin = $row[0];
$welcomeURL = $row[1];
$admin_web_directory = $row[2];
$i++;
}
##### END SETTINGS LOOKUP #####
@@ -338,7 +340,7 @@ if ( ($stage == 'login') or ($stage == 'logout') )
if ($referrer=='agent')
{$BACKlink = "<A HREF=\"./vicidial.php?pl=$phone_login&pp=$phone_pass&VD_login=$user\"><font color=\"#003333\">VOLVER a la pantalla de Inicio</font></A>";}
if ($referrer=='admin')
{$BACKlink = "<A HREF=\"../vicidial/admin.php\"><font color=\"#003333\">VOLVER a la Administración</font></A>";}
{$BACKlink = "<A HREF=\"/$admin_web_directory/admin.php\"><font color=\"#003333\">VOLVER a la Administración</font></A>";}
if ($referrer=='welcome')
{$BACKlink = "<A HREF=\"$welcomeURL\"><font color=\"#003333\">VOLVER a la pantalla de bienvenida</font></A>";}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,359 @@
<?php
# vdc_form_display.php
#
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed display the contents of the FORM tab in the agent
# interface, as well as take submission of the form submission when the agent
# dispositions the call
#
# CHANGELOG:
# 100630-1119 - First build of script
# 100703-1124 - Added submit_button,admin_submit fields, which will log to admin log
# 100712-2322 - Added code to log vicidial_list.entry_list_id field if data altered
#
$version = '2.4-3';
$build = '100712-2322';
require("dbconnect.php");
require("functions.php");
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];}
elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];}
if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];}
elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];}
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
if (isset($_GET["submit_button"])) {$submit_button=$_GET["submit_button"];}
elseif (isset($_POST["submit_button"])) {$submit_button=$_POST["submit_button"];}
if (isset($_GET["admin_submit"])) {$admin_submit=$_GET["admin_submit"];}
elseif (isset($_POST["admin_submit"])) {$admin_submit=$_POST["admin_submit"];}
if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];}
elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
$txt = '.txt';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$CIDdate = date("mdHis");
$ENTRYdate = date("YmdHis");
$MT[0]='';
$agents='@agents';
$script_height = ($script_height - 20);
if (strlen($bgcolor) < 6) {$bgcolor='FFFFFF';}
$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|';
$IFRAME=0;
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,custom_fields_enabled FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$timeclock_end_of_day = $row[1];
$agentonly_callback_campaign_lock = $row[2];
$custom_fields_enabled = $row[3];
}
##### END SETTINGS LOOKUP #####
###########################################
if ($non_latin < 1)
{
$user=ereg_replace("[^-_0-9a-zA-Z]","",$user);
$pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass);
$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec);
$phone_code = ereg_replace("[^0-9]","",$phone_code);
$phone_number = ereg_replace("[^0-9]","",$phone_number);
}
else
{
$user = ereg_replace("'|\"|\\\\|;","",$user);
$pass = ereg_replace("'|\"|\\\\|;","",$pass);
}
# default optional vars if not set
if (!isset($format)) {$format="text";}
if ($format == 'debug') {$DB=1;}
if (!isset($ACTION)) {$ACTION="refresh";}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
if ($DB) {echo "|$stmt|\n";}
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and modify_leads='1';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$VUmodify=$row[0];
$stmt="SELECT count(*) from vicidial_live_agents where user='$user';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$LVAactive=$row[0];
if ($custom_fields_enabled < 1)
{
echo "Custom Fields Disabled: |$custom_fields_enabled|\n";
echo "<form action=./vdc_form_display.php method=POST name=form_custom_fields id=form_custom_fields>\n";
echo "<input type=hidden name=user id=user value=\"$user\">\n";
echo "</form>\n";
exit;
}
if ( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) or ( ($LVAactive < 1) and ($VUmodify < 1) ) )
{
echo "Invalid Username/Password: |$user|$pass|\n";
echo "<form action=./vdc_form_display.php method=POST name=form_custom_fields id=form_custom_fields>\n";
echo "<input type=hidden name=user id=user value=\"$user\">\n";
echo "</form>\n";
exit;
}
else
{
# do nothing for now
}
### BEGIN parse submission of the custom fields form ###
if ($stage=='SUBMIT')
{
$update_sent=0;
$CFoutput='';
$stmt="SHOW TABLES LIKE \"custom_$list_id\";";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06001',$user,$server_ip,$session_name,$one_mysql_log);}
$tablecount_to_print = mysql_num_rows($rslt);
if ($tablecount_to_print > 0)
{
$update_SQL='';
$VL_update_SQL='';
$stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06003',$user,$server_ip,$session_name,$one_mysql_log);}
$fields_to_print = mysql_num_rows($rslt);
$fields_list='';
$o=0;
while ($fields_to_print > $o)
{
$new_field_value='';
$form_field_value='';
$rowx=mysql_fetch_row($rslt);
$A_field_id[$o] = $rowx[0];
$A_field_label[$o] = $rowx[1];
$A_field_name[$o] = $rowx[2];
$A_field_type[$o] = $rowx[6];
$A_field_size[$o] = $rowx[8];
$A_field_max[$o] = $rowx[9];
$A_field_required[$o] = $rowx[12];
$A_field_value[$o] = '';
$field_name_id = $A_field_label[$o];
if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];}
elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];}
if ( ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='CHECKBOX') or ($A_field_type[$o]=='RADIO') )
{
$k=0;
$multi_count = count($form_field_value);
$multi_array = $form_field_value;
while ($k < $multi_count)
{
$new_field_value .= "$multi_array[$k],";
$k++;
}
$form_field_value = preg_replace("/,$/","",$new_field_value);
}
if ($A_field_type[$o]=='TIME')
{
if (isset($_GET["MINUTE_$field_name_id"])) {$form_field_valueM=$_GET["MINUTE_$field_name_id"];}
elseif (isset($_POST["MINUTE_$field_name_id"])) {$form_field_valueM=$_POST["MINUTE_$field_name_id"];}
if (isset($_GET["HOUR_$field_name_id"])) {$form_field_valueH=$_GET["HOUR_$field_name_id"];}
elseif (isset($_POST["HOUR_$field_name_id"])) {$form_field_valueH=$_POST["HOUR_$field_name_id"];}
$form_field_value = "$form_field_valueH:$form_field_valueM:00";
}
$A_field_value[$o] = $form_field_value;
if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') )
{
$A_field_value[$o]='----IGNORE----';
}
else
{
if (preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields))
{
$VL_update_SQL .= "$A_field_label[$o]='$A_field_value[$o]',";
}
else
{
$update_SQL .= "$A_field_label[$o]='$A_field_value[$o]',";
}
$SUBMIT_output .= "<b>$A_field_name[$o]:</b> $A_field_value[$o]<BR>";
}
$o++;
}
$custom_update_count=0;
if (strlen($update_SQL)>3)
{
$custom_record_lead_count=0;
$stmt="SELECT count(*) from custom_$list_id where lead_id='$lead_id';";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06004',$user,$server_ip,$session_name,$one_mysql_log);}
$fieldleadcount_to_print = mysql_num_rows($rslt);
if ($fieldleadcount_to_print > 0)
{
$rowx=mysql_fetch_row($rslt);
$custom_record_lead_count = $rowx[0];
}
$update_SQL = preg_replace("/,$/","",$update_SQL);
$custom_table_update_SQL = "INSERT INTO custom_$list_id SET lead_id='$lead_id',$update_SQL;";
if ($custom_record_lead_count > 0)
{$custom_table_update_SQL = "UPDATE custom_$list_id SET $update_SQL where lead_id='$lead_id';";}
$rslt=mysql_query($custom_table_update_SQL, $link);
$custom_update_count = mysql_affected_rows($link);
if ($DB) {echo "$custom_update_count|$custom_table_update_SQL\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$update_sent++;
}
if (strlen($VL_update_SQL)>3)
{
$custom_update_vl_SQL='';
if ($custom_update_count > 0)
{$custom_update_vl_SQL = "entry_list_id='$list_id',";}
$VL_update_SQL = preg_replace("/,$/","",$VL_update_SQL);
$list_table_update_SQL = "UPDATE vicidial_list SET $custom_update_vl_SQL $VL_update_SQL where lead_id='$lead_id';";
$rslt=mysql_query($list_table_update_SQL, $link);
$list_update_count = mysql_affected_rows($link);
if ($DB) {echo "$list_update_count|$list_table_update_SQL\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$update_sent++;
}
else
{
if ($custom_update_count > 0)
{
$list_table_update_SQL = "UPDATE vicidial_list SET entry_list_id='$list_id' where lead_id='$lead_id';";
$rslt=mysql_query($list_table_update_SQL, $link);
$list_update_count = mysql_affected_rows($link);
if ($DB) {echo "$list_update_count|$list_table_update_SQL\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
}
}
if ( ($admin_submit=='YES') and ($update_sent > 0) )
{
### LOG INSERTION Admin Log Table ###
$ip = getenv("REMOTE_ADDR");
$SQL_log = "$list_table_update_SQL|$custom_table_update_SQL|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='LEADS', event_type='MODIFY', record_id='$lead_id', event_code='ADMIN MODIFY CUSTOM LEAD', event_sql=\"$SQL_log\", event_notes='$custom_update_count|$list_update_count';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{$CFoutput .= "ERROR: no custom list fields table\n";}
echo "Custom Form Output:\n<BR>\n";
echo "$SUBMIT_output";
echo "<form action=./vdc_form_display.php method=POST name=form_custom_fields id=form_custom_fields>\n";
echo "<input type=hidden name=user id=user value=\"$user\">\n";
echo "</form>\n";
}
### END parse submission of the custom fields form ###
else
{
echo "<html>\n";
echo "<head>\n";
echo "<!-- VERSION: $version BUILD: $build USER: $user server_ip: $server_ip-->\n";
echo "<title>ViciDial Form Display Script";
echo "</title>\n";
echo "<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
echo " <link rel=\"stylesheet\" href=\"calendar.css\">\n";
echo " <script language=\"Javascript\">\n";
echo " function open_help(taskspan,taskhelp) \n";
echo " {\n";
echo " document.getElementById(\"P_\" + taskspan).innerHTML = \" &nbsp; <a href=\\\"javascript:close_help('\" + taskspan + \"','\" + taskhelp + \"');\\\">help-</a><BR> &nbsp; \";\n";
echo " document.getElementById(taskspan).innerHTML = \"<B>\" + taskhelp + \"</B>\";\n";
echo " document.getElementById(taskspan).style.background = \"#FFFF99\";\n";
echo " }\n";
echo " function close_help(taskspan,taskhelp) \n";
echo " {\n";
echo " document.getElementById(\"P_\" + taskspan).innerHTML = \"\";\n";
echo " document.getElementById(taskspan).innerHTML = \" &nbsp; <a href=\\\"javascript:open_help('\" + taskspan + \"','\" + taskhelp + \"');\\\">help+</a>\";\n";
echo " document.getElementById(taskspan).style.background = \"white\";\n";
echo " }\n";
echo " </script>\n";
echo " <META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo "</head>\n";
echo '<BODY BGCOLOR="#' . $bgcolor . '" marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>';
echo "\n";
echo "<form action=./vdc_form_display.php method=POST name=form_custom_fields id=form_custom_fields>\n";
echo "<input type=hidden name=lead_id id=lead_id value=\"$lead_id\">\n";
echo "<input type=hidden name=list_id id=list_id value=\"$list_id\">\n";
echo "<input type=hidden name=user id=user value=\"$user\">\n";
echo "<input type=hidden name=pass id=pass value=\"$pass\">\n";
echo "\n";
require("functions.php");
$CFoutput = custom_list_fields_values($lead_id,$list_id,$uniqueid,$user);
echo "$CFoutput";
if ($submit_button=='YES')
{
echo "<input type=hidden name=admin_submit id=admin_submit value=\"YES\">\n";
echo "<BR><BR><input type=submit name=VCformSubmit id=VCformSubmit value=submit>\n";
}
echo "</form></center><BR><BR>\n";
echo "</BODY></HTML>\n";
}
exit;
?>
@@ -275,6 +275,12 @@ if ($ignore_list_script < 1)
{$call_script = $agent_script_override;}
}
$stmt="SELECT list_name,list_description from vicidial_lists where list_id='$list_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$list_name = $row[0];
$list_description = $row[1];
$stmt="SELECT script_name,script_text from vicidial_scripts where script_id='$call_script';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
@@ -288,6 +294,8 @@ if (eregi("iframe src",$script_text))
$vendor_id = eregi_replace(' ','+',$vendor_id);
$vendor_lead_code = eregi_replace(' ','+',$vendor_lead_code);
$list_id = eregi_replace(' ','+',$list_id);
$list_name = eregi_replace(' ','+',$list_name);
$list_description = eregi_replace(' ','+',$list_description);
$gmt_offset_now = eregi_replace(' ','+',$gmt_offset_now);
$phone_code = eregi_replace(' ','+',$phone_code);
$phone_number = eregi_replace(' ','+',$phone_number);
@@ -361,6 +369,8 @@ $script_text = eregi_replace('--A--lead_id--B--',"$lead_id",$script_text);
$script_text = eregi_replace('--A--vendor_id--B--',"$vendor_id",$script_text);
$script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text);
$script_text = eregi_replace('--A--list_id--B--',"$list_id",$script_text);
$script_text = eregi_replace('--A--list_name--B--',"$list_name",$script_text);
$script_text = eregi_replace('--A--list_description--B--',"$list_description",$script_text);
$script_text = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$script_text);
$script_text = eregi_replace('--A--phone_code--B--',"$phone_code",$script_text);
$script_text = eregi_replace('--A--phone_number--B--',"$phone_number",$script_text);
@@ -0,0 +1,648 @@
<?php
# vdc_script_notes.php
#
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed open in the SCRIPT tab in the agent interface through
# an IFRAME. It will create a new record for every SUBMIT
#
# Example of a ViciDial agent SCRIPT using this script:
# <iframe src="./vdc_script_notes.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&pass=--A--pass--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&rank=--A--rank--B--&owner=--A--owner--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--" style="background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="--A--script_width--B--" height="--A--script_height--B--" STYLE="z-index:17"> </iframe>
#
# CHANGELOG:
# 100215-0744 - First build of script
# 100622-2230 - Added field labels
#
$version = '2.4-2';
$build = '100622-2230';
require("dbconnect.php");
if (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
elseif (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
if (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];}
elseif (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];}
$vendor_lead_code = $vendor_id;
if (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
elseif (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
if (isset($_POST["gmt_offset_now"])) {$gmt_offset_now=$_POST["gmt_offset_now"];}
elseif (isset($_GET["gmt_offset_now"])) {$gmt_offset_now=$_GET["gmt_offset_now"];}
if (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];}
elseif (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];}
if (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];}
elseif (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];}
if (isset($_POST["title"])) {$title=$_POST["title"];}
elseif (isset($_GET["title"])) {$title=$_GET["title"];}
if (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];}
elseif (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];}
if (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];}
elseif (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];}
if (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];}
elseif (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];}
if (isset($_POST["address1"])) {$address1=$_POST["address1"];}
elseif (isset($_GET["address1"])) {$address1=$_GET["address1"];}
if (isset($_POST["address2"])) {$address2=$_POST["address2"];}
elseif (isset($_GET["address2"])) {$address2=$_GET["address2"];}
if (isset($_POST["address3"])) {$address3=$_POST["address3"];}
elseif (isset($_GET["address3"])) {$address3=$_GET["address3"];}
if (isset($_POST["city"])) {$city=$_POST["city"];}
elseif (isset($_GET["city"])) {$city=$_GET["city"];}
if (isset($_POST["state"])) {$state=$_POST["state"];}
elseif (isset($_GET["state"])) {$state=$_GET["state"];}
if (isset($_POST["province"])) {$province=$_POST["province"];}
elseif (isset($_GET["province"])) {$province=$_GET["province"];}
if (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];}
elseif (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];}
if (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];}
elseif (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];}
if (isset($_POST["gender"])) {$gender=$_POST["gender"];}
elseif (isset($_GET["gender"])) {$gender=$_GET["gender"];}
if (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];}
elseif (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];}
if (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];}
elseif (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];}
if (isset($_POST["email"])) {$email=$_POST["email"];}
elseif (isset($_GET["email"])) {$email=$_GET["email"];}
if (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];}
elseif (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];}
if (isset($_POST["comments"])) {$comments=$_POST["comments"];}
elseif (isset($_GET["comments"])) {$comments=$_GET["comments"];}
if (isset($_POST["user"])) {$user=$_POST["user"];}
elseif (isset($_GET["user"])) {$user=$_GET["user"];}
if (isset($_POST["pass"])) {$pass=$_POST["pass"];}
elseif (isset($_GET["pass"])) {$pass=$_GET["pass"];}
if (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];}
elseif (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];}
if (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];}
elseif (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];}
if (isset($_POST["original_phone_login"])) {$original_phone_login=$_POST["original_phone_login"];}
elseif (isset($_GET["original_phone_login"])) {$original_phone_login=$_GET["original_phone_login"];}
if (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];}
elseif (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];}
if (isset($_POST["fronter"])) {$fronter=$_POST["fronter"];}
elseif (isset($_GET["fronter"])) {$fronter=$_GET["fronter"];}
if (isset($_POST["closer"])) {$closer=$_POST["closer"];}
elseif (isset($_GET["closer"])) {$closer=$_GET["closer"];}
if (isset($_POST["group"])) {$group=$_POST["group"];}
elseif (isset($_GET["group"])) {$group=$_GET["group"];}
if (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];}
elseif (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];}
if (isset($_POST["SQLdate"])) {$SQLdate=$_POST["SQLdate"];}
elseif (isset($_GET["SQLdate"])) {$SQLdate=$_GET["SQLdate"];}
if (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];}
elseif (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];}
if (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];}
elseif (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];}
if (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];}
elseif (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];}
if (isset($_POST["customer_server_ip"])) {$customer_server_ip=$_POST["customer_server_ip"];}
elseif (isset($_GET["customer_server_ip"])) {$customer_server_ip=$_GET["customer_server_ip"];}
if (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
elseif (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
if (isset($_POST["SIPexten"])) {$SIPexten=$_POST["SIPexten"];}
elseif (isset($_GET["SIPexten"])) {$SIPexten=$_GET["SIPexten"];}
if (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];}
elseif (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];}
if (isset($_POST["phone"])) {$phone=$_POST["phone"];}
elseif (isset($_GET["phone"])) {$phone=$_GET["phone"];}
if (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];}
elseif (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];}
if (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];}
elseif (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];}
if (isset($_POST["dialed_number"])) {$dialed_number=$_POST["dialed_number"];}
elseif (isset($_GET["dialed_number"])) {$dialed_number=$_GET["dialed_number"];}
if (isset($_POST["dialed_label"])) {$dialed_label=$_POST["dialed_label"];}
elseif (isset($_GET["dialed_label"])) {$dialed_label=$_GET["dialed_label"];}
if (isset($_POST["source_id"])) {$source_id=$_POST["source_id"];}
elseif (isset($_GET["source_id"])) {$source_id=$_GET["source_id"];}
if (isset($_POST["rank"])) {$rank=$_POST["rank"];}
elseif (isset($_GET["rank"])) {$rank=$_GET["rank"];}
if (isset($_POST["owner"])) {$owner=$_POST["owner"];}
elseif (isset($_GET["owner"])) {$owner=$_GET["owner"];}
if (isset($_POST["camp_script"])) {$camp_script=$_POST["camp_script"];}
elseif (isset($_GET["camp_script"])) {$camp_script=$_GET["camp_script"];}
if (isset($_POST["in_script"])) {$in_script=$_POST["in_script"];}
elseif (isset($_GET["in_script"])) {$in_script=$_GET["in_script"];}
if (isset($_POST["script_width"])) {$script_width=$_POST["script_width"];}
elseif (isset($_GET["script_width"])) {$script_width=$_GET["script_width"];}
if (isset($_POST["script_height"])) {$script_height=$_POST["script_height"];}
elseif (isset($_GET["script_height"])) {$script_height=$_GET["script_height"];}
if (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];}
elseif (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];}
if (isset($_POST["recording_filename"])) {$recording_filename=$_POST["recording_filename"];}
elseif (isset($_GET["recording_filename"])) {$recording_filename=$_GET["recording_filename"];}
if (isset($_POST["recording_id"])) {$recording_id=$_POST["recording_id"];}
elseif (isset($_GET["recording_id"])) {$recording_id=$_GET["recording_id"];}
if (isset($_POST["user_custom_one"])) {$user_custom_one=$_POST["user_custom_one"];}
elseif (isset($_GET["user_custom_one"])) {$user_custom_one=$_GET["user_custom_one"];}
if (isset($_POST["user_custom_two"])) {$user_custom_two=$_POST["user_custom_two"];}
elseif (isset($_GET["user_custom_two"])) {$user_custom_two=$_GET["user_custom_two"];}
if (isset($_POST["user_custom_three"])) {$user_custom_three=$_POST["user_custom_three"];}
elseif (isset($_GET["user_custom_three"])) {$user_custom_three=$_GET["user_custom_three"];}
if (isset($_POST["user_custom_four"])) {$user_custom_four=$_POST["user_custom_four"];}
elseif (isset($_GET["user_custom_four"])) {$user_custom_four=$_GET["user_custom_four"];}
if (isset($_POST["user_custom_five"])) {$user_custom_five=$_POST["user_custom_five"];}
elseif (isset($_GET["user_custom_five"])) {$user_custom_five=$_GET["user_custom_five"];}
if (isset($_POST["preset_number_a"])) {$preset_number_a=$_POST["preset_number_a"];}
elseif (isset($_GET["preset_number_a"])) {$preset_number_a=$_GET["preset_number_a"];}
if (isset($_POST["preset_number_b"])) {$preset_number_b=$_POST["preset_number_b"];}
elseif (isset($_GET["preset_number_b"])) {$preset_number_b=$_GET["preset_number_b"];}
if (isset($_POST["preset_number_c"])) {$preset_number_c=$_POST["preset_number_c"];}
elseif (isset($_GET["preset_number_c"])) {$preset_number_c=$_GET["preset_number_c"];}
if (isset($_POST["preset_number_d"])) {$preset_number_d=$_POST["preset_number_d"];}
elseif (isset($_GET["preset_number_d"])) {$preset_number_d=$_GET["preset_number_d"];}
if (isset($_POST["preset_number_e"])) {$preset_number_e=$_POST["preset_number_e"];}
elseif (isset($_GET["preset_number_e"])) {$preset_number_e=$_GET["preset_number_e"];}
if (isset($_POST["preset_number_f"])) {$preset_number_f=$_POST["preset_number_f"];}
elseif (isset($_GET["preset_number_f"])) {$preset_number_f=$_GET["preset_number_f"];}
if (isset($_POST["preset_dtmf_a"])) {$preset_dtmf_a=$_POST["preset_dtmf_a"];}
elseif (isset($_GET["preset_dtmf_a"])) {$preset_dtmf_a=$_GET["preset_dtmf_a"];}
if (isset($_POST["preset_dtmf_b"])) {$preset_dtmf_b=$_POST["preset_dtmf_b"];}
elseif (isset($_GET["preset_dtmf_b"])) {$preset_dtmf_b=$_GET["preset_dtmf_b"];}
if (isset($_POST["ScrollDIV"])) {$ScrollDIV=$_POST["ScrollDIV"];}
elseif (isset($_GET["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];}
if (isset($_POST["ignore_list_script"])) {$ignore_list_script=$_POST["ignore_list_script"];}
elseif (isset($_GET["ignore_list_script"])) {$ignore_list_script=$_GET["ignore_list_script"];}
if (isset($_POST["DB"])) {$DB=$_POST["DB"];}
elseif (isset($_GET["DB"])) {$DB=$_GET["DB"];}
if (isset($_POST["process"])) {$process=$_POST["process"];}
elseif (isset($_GET["process"])) {$process=$_GET["process"];}
if (isset($_POST["vicidial_id"])) {$vicidial_id=$_POST["vicidial_id"];}
elseif (isset($_GET["vicidial_id"])) {$vicidial_id=$_GET["vicidial_id"];}
if (isset($_POST["call_date"])) {$call_date=$_POST["call_date"];}
elseif (isset($_GET["call_date"])) {$call_date=$_GET["call_date"];}
if (isset($_POST["order_id"])) {$order_id=$_POST["order_id"];}
elseif (isset($_GET["order_id"])) {$order_id=$_GET["order_id"];}
if (isset($_POST["appointment_date"])) {$appointment_date=$_POST["appointment_date"];}
elseif (isset($_GET["appointment_date"])) {$appointment_date=$_GET["appointment_date"];}
if (isset($_POST["appointment_time"])) {$appointment_time=$_POST["appointment_time"];}
elseif (isset($_GET["appointment_time"])) {$appointment_time=$_GET["appointment_time"];}
if (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];}
elseif (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];}
if (isset($_POST["notesid"])) {$notesid=$_POST["notesid"];}
elseif (isset($_GET["notesid"])) {$notesid=$_GET["notesid"];}
if ($notesid < 100)
{$notesid=0;}
if (strlen($vicidial_id) < 1)
{$vicidial_id = $uniqueid;}
if (strlen($appointment_time) < 1)
{$appointment_time = '12:00:00';}
$appointment_timeARRAY = explode(":",$appointment_time);
$appointment_hour = $appointment_timeARRAY[0];
$appointment_min = $appointment_timeARRAY[1];
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
$txt = '.txt';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$CIDdate = date("mdHis");
$ENTRYdate = date("YmdHis");
$MT[0]='';
$agents='@agents';
if (strlen($call_date) < 1)
{$call_date = $NOW_TIME;}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$timeclock_end_of_day = $row[1];
$agentonly_callback_campaign_lock = $row[2];
}
##### END SETTINGS LOOKUP #####
###########################################
if ($non_latin < 1)
{
$user=ereg_replace("[^-_0-9a-zA-Z]","",$user);
$pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass);
$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec);
$phone_code = ereg_replace("[^0-9]","",$phone_code);
$phone_number = ereg_replace("[^0-9]","",$phone_number);
}
else
{
$user = ereg_replace("'|\"|\\\\|;","",$user);
$pass = ereg_replace("'|\"|\\\\|;","",$pass);
}
if ($DB > 0)
{
echo "<BR>$lead_id|$entry_date|$modify_date|$status|$user|$vendor_lead_code|$source_id|$list_id|$gmt_offset_now|$called_since_last_reset|$phone_code|$phone_number|$title|$first_name|$middle_initial|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country_code|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$comments|$called_count|$last_local_call_time|$rank|$owner|\n<BR>";
}
### BEGIN find any custom field labels ###
$label_title = 'Título';
$label_first_name = 'Primero';
$label_middle_initial = 'MI';
$label_last_name = 'Último';
$label_address1 = 'Dirección1';
$label_address2 = 'Dirección2';
$label_address3 = 'Dirección3';
$label_city = 'Ciudad';
$label_state = 'Estado';
$label_province = 'Provincia';
$label_postal_code = 'CódigoPostal';
$label_vendor_lead_code = 'VendedorID';
$label_gender = 'Gender';
$label_phone_number = 'Teléfono';
$label_phone_code = 'Código Del Dial';
$label_alt_phone = 'Teléfono Alt';
$label_security_phrase = 'Demostración';
$label_email = 'Email';
$label_comments = 'Comentarios';
$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if (strlen($row[0])>0) {$label_title = $row[0];}
if (strlen($row[1])>0) {$label_first_name = $row[1];}
if (strlen($row[2])>0) {$label_middle_initial = $row[2];}
if (strlen($row[3])>0) {$label_last_name = $row[3];}
if (strlen($row[4])>0) {$label_address1 = $row[4];}
if (strlen($row[5])>0) {$label_address2 = $row[5];}
if (strlen($row[6])>0) {$label_address3 = $row[6];}
if (strlen($row[7])>0) {$label_city = $row[7];}
if (strlen($row[8])>0) {$label_state = $row[8];}
if (strlen($row[9])>0) {$label_province = $row[9];}
if (strlen($row[10])>0) {$label_postal_code = $row[10];}
if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];}
if (strlen($row[12])>0) {$label_gender = $row[12];}
if (strlen($row[13])>0) {$label_phone_number = $row[13];}
if (strlen($row[14])>0) {$label_phone_code = $row[14];}
if (strlen($row[15])>0) {$label_alt_phone = $row[15];}
if (strlen($row[16])>0) {$label_security_phrase = $row[16];}
if (strlen($row[17])>0) {$label_email = $row[17];}
if (strlen($row[18])>0) {$label_comments = $row[18];}
### END find any custom field labels ###
# default optional vars if not set
if (!isset($format)) {$format="text";}
if ($format == 'debug') {$DB=1;}
if (!isset($ACTION)) {$ACTION="refresh";}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
if ($DB) {echo "|$stmt|\n";}
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
{
echo "Inválido Nombre del usuario/Contraseña: |$user|$pass|\n";
exit;
}
else
{
# do nothing for now
}
echo "<HTML>\n";
echo "<head>\n";
echo "<!-- VERSIÓN: $version CONSTRUCCION: $build USER: $user server_ip: $server_ip-->\n";
echo "<title>ViciDial Notas";
echo "</title>\n";
echo "<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
echo "<link rel=\"stylesheet\" href=\"calendar.css\">\n";
?>
<?php
echo "</head>\n";
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
if ($process > 0)
{
#Update vicidial_list record
$stmt="UPDATE vicidial_list SET vendor_lead_code='$vendor_lead_code',title='$title',first_name='$first_name',middle_initial='$middle_initial',last_name='$last_name',address1='$address1',address2='$address2',address3='$address3',city='$city',state='$state',province='$province',postal_code='$postal_code',phone_code='$phone_code',phone_number='$phone_number',gender='$gender',date_of_birth='$date_of_birth',alt_phone='$alt_phone',email='$email',security_phrase='$security_phrase',comments='$comments',rank='$rank',owner='$owner' where lead_id='$lead_id';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
#Update the agent screen with new data
$stmt="UPDATE vicidial_live_agents set external_update_fields='1',external_update_fields_data='vendor_lead_code,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,phone_code,phone_number,gender,date_of_birth,alt_phone,email,security_phrase,comments,rank,owner' where user='$user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
if ($notesid < 100)
{
# Insert into vicidial_call_notes
$stmt="INSERT INTO vicidial_call_notes set lead_id='$lead_id',vicidial_id='$vicidial_id',call_date='$call_date',order_id='$order_id',appointment_date='$appointment_date',appointment_time='$appointment_time',call_notes='$call_notes';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
$notesid = mysql_insert_id($link);
}
else
{
# update vicidial_call_notes record
$stmt="UPDATE vicidial_call_notes set order_id='$order_id',appointment_date='$appointment_date',appointment_time='$appointment_time',call_notes='$call_notes' where notesid='$notesid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
}
echo "<BR><b>Data Changes Accepted</b><BR><BR>";
}
$URLarray = explode("?", $PHP_SELF);
$URLsubmit = $URLarray[0];
?>
<TABLE Border=0 CELLPADDING=0 CELLSPACING=2 WIDTH=450>
<TR><TD COLSPAN=2 ALIGN=CENTER>
<FORM METHOD=POST NAME=vsn ID=vsn ACTION="<?php echo $URLsubmit ?>">
<input type=hidden name=DB id=DB value=<?php echo $DB ?>>
<input type=hidden name=process id=process value=1>
<input type=hidden name=lead_id id=lead_id value="<?php echo $lead_id ?>">
<input type=hidden name=user id=user value="<?php echo $user ?>">
<input type=hidden name=pass id=user value="<?php echo $pass ?>">
<input type=hidden name=notesid id=notesid value="<?php echo $notesid ?>">
<input type=hidden name=vendor_id id=vendor_id value="<?php echo $vendor_id ?>">
<input type=hidden name=title id=title value="<?php echo $title ?>">
<input type=hidden name=middle_initial id=middle_initial value="<?php echo $middle_initial ?>">
<input type=hidden name=province id=province value="<?php echo $middle_initial ?>">
<input type=hidden name=phone_code id=phone_code value="<?php echo $phone_code ?>">
<input type=hidden name=gender id=gender value="<?php echo $gender ?>">
<input type=hidden name=date_of_birth id=date_of_birth value="<?php echo $date_of_birth ?>">
<input type=hidden name=alt_phone id=alt_phone value="<?php echo $alt_phone ?>">
<input type=hidden name=email id=email value="<?php echo $email ?>">
<input type=hidden name=security_phrase id=security_phrase value="<?php echo $security_phrase ?>">
<input type=hidden name=comments id=comments value="<?php echo $comments ?>">
<input type=hidden name=rank id=rank value="<?php echo $rank ?>">
<input type=hidden name=owner id=owner value="<?php echo $owner ?>">
</TD></TR>
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">VendedorID: </TD><TD ALIGN=LEFT><input type=text name=vendor_id id=vendor_id size=20 maxlength=20 value="<?php echo $vendor_id ?>"></TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Source ID: </TD><TD ALIGN=LEFT>$source_id<input type=hidden name=source_id id=source_id value="<?php echo $source_id ?>"></TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Título: </TD><TD ALIGN=LEFT><input type=text name=title id=title size=5 maxlength=4 value="<?php echo $title ?>"></TD>
</TR> -->
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_first_name ?>: </TD><TD ALIGN=LEFT><input type=text name=first_name id=first_name size=30 maxlength=30 value="<?php echo $first_name ?>"> *</TD>
</TR>
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Middle Initial: </TD><TD ALIGN=LEFT><input type=text name=middle_initial id=middle_initial size=2 maxlength=1 value="<?php echo $middle_initial ?>"></TD>
</TR> -->
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_last_name ?>: </TD><TD ALIGN=LEFT><input type=text name=last_name id=last_name size=30 maxlength=30 value="<?php echo $last_name ?>"> *</TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_address1 ?>: </TD><TD ALIGN=LEFT><input type=text name=address1 id=address1 size=30 maxlength=100 value="<?php echo $address1 ?>"> *</TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_address2 ?>: </TD><TD ALIGN=LEFT><input type=text name=address2 id=address2 size=30 maxlength=100 value="<?php echo $address2 ?>"></TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_address3 ?>: </TD><TD ALIGN=LEFT><input type=text name=address3 id=address3 size=30 maxlength=100 value="<?php echo $address3 ?>"></TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_city ?>: </TD><TD ALIGN=LEFT><input type=text name=city id=city size=30 maxlength=50 value="<?php echo $city ?>"> *</TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_state ?>: </TD><TD ALIGN=LEFT>
<SELECT name="state" id=state>
<OPTION value="<?php echo $state ?>" selected><?php echo $state ?></OPTION>
<OPTGROUP label="United Estados">
<OPTION value="AL">Alabama</OPTION>
<OPTION value="AK">Alaska</OPTION>
<OPTION value="AZ">Arizona</OPTION>
<OPTION value="AR">Arkansas</OPTION>
<OPTION value="CA">California</OPTION>
<OPTION value="CO">Colorado</OPTION>
<OPTION value="CT">Connecticut</OPTION>
<OPTION value="DE">Delaware</OPTION>
<OPTION value="FL">Florida</OPTION>
<OPTION value="GA">Georgia</OPTION>
<OPTION value="HI">Hawaii</OPTION>
<OPTION value="ID">Idaho</OPTION>
<OPTION value="IL">Illinois</OPTION>
<OPTION value="IN">Indiana</OPTION>
<OPTION value="IA">Iowa</OPTION>
<OPTION value="KS">Kansas</OPTION>
<OPTION value="KY">Kentucky</OPTION>
<OPTION value="LA">Louisiana</OPTION>
<OPTION value="ME">Maine</OPTION>
<OPTION value="MD">Maryland</OPTION>
<OPTION value="MA">Massachusetts</OPTION>
<OPTION value="MI">Michigan</OPTION>
<OPTION value="MN">Minnesota</OPTION>
<OPTION value="MS">Mississippi</OPTION>
<OPTION value="MO">Missouri</OPTION>
<OPTION value="MT">Montana</OPTION>
<OPTION value="NE">Nebraska</OPTION>
<OPTION value="NV">Nevada</OPTION>
<OPTION value="NH">New Hampshire</OPTION>
<OPTION value="NJ">New Jersey</OPTION>
<OPTION value="NM">New Mexico</OPTION>
<OPTION value="NY">New York</OPTION>
<OPTION value="NC">North Carolina</OPTION>
<OPTION value="ND">North Dakota</OPTION>
<OPTION value="OH">Ohio</OPTION>
<OPTION value="OK">Oklahoma</OPTION>
<OPTION value="OR">Oregon</OPTION>
<OPTION value="PA">Pennsylvania</OPTION>
<OPTION value="RI">Rhode Island</OPTION>
<OPTION value="SC">South Carolina</OPTION>
<OPTION value="SD">South Dakota</OPTION>
<OPTION value="TN">Tennessee</OPTION>
<OPTION value="TX">Texas</OPTION>
<OPTION value="UT">Utah</OPTION>
<OPTION value="VT">Vermont</OPTION>
<OPTION value="VA">Virginia</OPTION>
<OPTION value="WA">Washington</OPTION>
<OPTION value="DC">Washington, DC</OPTION>
<OPTION value="WV">West Virginia</OPTION>
<OPTION value="WI">Wisconsin</OPTION>
<OPTION value="WY">Wyoming</OPTION>
</OPTGROUP>
<!--
<OPTGROUP label="Canada">
<OPTION value="AB">ALBERTA</OPTION>
<OPTION value="NT">NORTHWEST TERRITORY</OPTION>
<OPTION value="BC">BRITISH COLUMBIA</OPTION>
<OPTION value="ON">ONTARIO</OPTION>
<OPTION value="LB">LABRADOR</OPTION>
<OPTION value="PE">PRINCE EDWARDISLAND</OPTION>
<OPTION value="MB">MANITOBA</OPTION>
<OPTION value="PQ">QUEBEC</OPTION>
<OPTION value="NB">NEW BRUNSWICK</OPTION>
<OPTION value="SK">SASKATCHEWAN</OPTION>
<OPTION value="NF">NEWFOUNDLAND</OPTION>
<OPTION value="YT">YUKON TERRITORY</OPTION>
<OPTION value="NS">NOVA SCOTIA</OPTION>
</OPTGROUP>
-->
</SELECT> *</TD>
</TR>
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Provincia: </TD><TD ALIGN=LEFT><input type=text name=province id=province size=20 maxlength=50 value="<?php echo $province ?>"></TD>
</TR> -->
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_postal_code ?>: </TD><TD ALIGN=LEFT><input type=text name=postal_code id=postal_code size=6 maxlength=5 value="<?php echo $postal_code ?>"> *</TD>
</TR>
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Teléfono Code: </TD><TD ALIGN=LEFT><input type=text name=phone_code id=phone_code size=10 maxlength=10 value="<?php echo $phone_code ?>"></TD>
</TR> -->
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_phone_number ?>: </TD><TD ALIGN=LEFT><input type=text name=phone_number id=phone_number size=18 maxlength=18 value="<?php echo $phone_number ?>"> *</TD>
</TR>
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Género:</TD><TD ALIGN=LEFT><input type=text name=gender id=gender size=2 maxlength=1 value="<?php echo $gender ?>"></TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Fecha de nacimiento:</TD><TD ALIGN=LEFT><input type=text name=date_if_birth id=date_if_birth size=12 maxlength=12 value="<?php echo $date_of_birth ?>"></TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Teléfono Alt: </TD><TD ALIGN=LEFT><input type=text name=alt_phone id=alt_phone size=12 maxlength=12 value="<?php echo $alt_phone ?>"> *</TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Email: </TD><TD ALIGN=LEFT><input type=text name=email id=email size=30 maxlength=70 value="<?php echo $email ?>"> *</TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Demostración: </TD><TD ALIGN=LEFT><input type=text name=security_phrase id=security_phrase size=30 maxlength=100 value="<?php echo $security_phrase ?>"> *</TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Comentarios:</TD><TD ALIGN=LEFT><input type=text name=comments id=comments size=40 maxlength=255 value="<?php echo $comments ?>"> *</TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Rank: </TD><TD ALIGN=LEFT><input type=text name=rank id=rank size=5 maxlength=5 value="<?php echo $rank ?>"> *</TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Owner: </TD><TD ALIGN=LEFT><input type=text name=owner id=owner size=20 maxlength=20 value="<?php echo $owner ?>"> *</TD>
</TR> -->
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Order ID: </TD><TD ALIGN=LEFT><input type=text name=order_id id=order_id size=20 maxlength=20 value="<?php echo $order_id ?>"></TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Appointment Date/Time: </TD><TD ALIGN=LEFT><input type=text name=appointment_date id=appointment_date size=10 maxlength=10 value="<?php echo $appointment_date ?>">
<script language="JavaScript">
var o_cal = new tcal ({
// form name
'formname': 'vsn',
// input name
'controlname': 'appointment_date'
});
o_cal.a_tpl.yearscroll = false;
// o_cal.a_tpl.weekstart = 1; // Monday week start
</script>
<input type=hidden name=appointment_time id=appointment_time value="<?php echo $appointment_time ?>">
<SELECT name=appointment_hour id=appointment_hour>
<option>00</option>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<OPTION value="<?php echo $appointment_hour ?>" selected><?php echo $appointment_hour ?></OPTION>
</SELECT>
<SELECT name=appointment_min id=appointment_min>
<option>00</option>
<option>05</option>
<option>10</option>
<option>15</option>
<option>20</option>
<option>25</option>
<option>30</option>
<option>35</option>
<option>40</option>
<option>45</option>
<option>50</option>
<option>55</option>
<OPTION value="<?php echo $appointment_min ?>" selected><?php echo $appointment_min ?></OPTION>
</SELECT>
</TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=CENTER COLSPAN=2><FONT FACE="ARIAL,HELVETICA" size=2>Appointment Notas:<BR><TEXTAREA NAME=call_notes ID=call_notes ROWS=5 COLS=50><?php echo $call_notes ?></TEXTAREA></font><br>
</TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=CENTER COLSPAN=2><FONT FACE="ARIAL,HELVETICA" size=1>Please click ENVIAR to commit the changes, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * denotes required fields</font><br>
</TD>
</TR>
<TR BGCOLOR=white>
<TD ALIGN=CENTER COLSPAN=2>
<SCRIPT LANGUAGE="JavaScript">
function submit_form()
{
var appointment_hourFORM = document.getElementById('appointment_hour');
var appointment_hourVALUE = appointment_hourFORM[appointment_hourFORM.selectedIndex].text;
var appointment_minFORM = document.getElementById('appointment_min');
var appointment_minVALUE = appointment_minFORM[appointment_minFORM.selectedIndex].text;
document.vsn.appointment_time.value = appointment_hourVALUE + ":" + appointment_minVALUE + ":00";
document.vsn.submit();
}
</SCRIPT>
<input type=button value="ENVIAR" name=smt id=smt onClick="submit_form()">
</TD>
</TR>
</TABLE>
</FORM>
</CENTER>
</B></FONT>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,95 @@
/* calendar icon */
img.tcalIcon {
cursor: pointer;
margin-left: 1px;
vertical-align: middle;
}
/* calendar container element */
div#tcal {
position: absolute;
visibility: hidden;
z-index: 100;
width: 158px;
padding: 2px 0 0 0;
}
/* all tables in calendar */
div#tcal table {
width: 100%;
border: 1px solid silver;
border-collapse: collapse;
background-color: white;
}
/* navigation table */
div#tcal table.ctrl {
border-bottom: 0;
}
/* navigation buttons */
div#tcal table.ctrl td {
width: 15px;
height: 20px;
}
/* month year header */
div#tcal table.ctrl th {
background-color: white;
color: black;
border: 0;
}
/* week days header */
div#tcal th {
border: 1px solid silver;
border-collapse: collapse;
text-align: center;
padding: 3px 0;
font-family: tahoma, verdana, arial;
font-size: 10px;
background-color: gray;
color: white;
}
/* date cells */
div#tcal td {
border: 0;
border-collapse: collapse;
text-align: center;
padding: 2px 0;
font-family: tahoma, verdana, arial;
font-size: 11px;
width: 22px;
cursor: pointer;
}
/* date highlight
in case of conflicting settings order here determines the priority from least to most important */
div#tcal td.othermonth {
color: silver;
}
div#tcal td.weekend {
background-color: #ACD6F5;
}
div#tcal td.today {
border: 1px solid red;
}
div#tcal td.selected {
background-color: #FFB3BE;
}
/* iframe element used to suppress windowed controls in IE5/6 */
iframe#tcalIF {
position: absolute;
visibility: hidden;
z-index: 98;
border: 0;
}
/* transparent shadow */
div#tcalShade {
position: absolute;
visibility: hidden;
z-index: 99;
}
div#tcalShade table {
border: 0;
border-collapse: collapse;
width: 100%;
}
div#tcalShade table td {
border: 0;
border-collapse: collapse;
padding: 0;
}
@@ -0,0 +1,335 @@
// Tigra Calendar v4.0.2 (2009-01-12) Database (yyyy-mm-dd)
// http://www.softcomplex.com/products/tigra_calendar/
// Public Domain Software... You're welcome.
// default settins
var A_TCALDEF = {
'months' : ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'],
'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
'yearscroll': true, // show year scroller
'weekstart': 0, // first day of week: 0-Su or 1-Mo
'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx.
'imgpath' : '../agc/images/' // directory with calendar images
}
// date parsing function
function f_tcalParseDate (s_date) {
var re_date = /^\s*(\d{2,4})\-(\d{1,2})\-(\d{1,2})\s*$/;
if (!re_date.exec(s_date))
return alert ("Non valido date: '" + s_date + "'.\nAccepted format is yyyy-mm-dd.")
var n_day = Number(RegExp.$3),
n_month = Number(RegExp.$2),
n_year = Number(RegExp.$1);
if (n_year < 100)
n_year += (n_year < this.a_tpl.centyear ? 2000 : 1900);
if (n_month < 1 || n_month > 12)
return alert ("Non valido month value: '" + n_month + "'.\nAllowed range is 01-12.");
var d_numdays = new Date(n_year, n_month, 0);
if (n_day > d_numdays.getDate())
return alert("Non valido day of month value: '" + n_day + "'.\nAllowed range for selected month is 01 - " + d_numdays.getDate() + ".");
return new Date (n_year, n_month - 1, n_day);
}
// date generating function
function f_tcalGenerDate (d_date) {
return (
d_date.getFullYear() + "-"
+ (d_date.getMonth() < 9 ? '0' : '') + (d_date.getMonth() + 1) + "-"
+ (d_date.getDate() < 10 ? '0' : '') + d_date.getDate()
);
}
// implementation
function tcal (a_cfg, a_tpl) {
// apply default template if not specified
if (!a_tpl)
a_tpl = A_TCALDEF;
// register in global collections
if (!window.A_TCALS)
window.A_TCALS = [];
if (!window.A_TCALSIDX)
window.A_TCALSIDX = [];
this.s_id = a_cfg.id ? a_cfg.id : A_TCALS.length;
window.A_TCALS[this.s_id] = this;
window.A_TCALSIDX[window.A_TCALSIDX.length] = this;
// assign methods
this.f_show = f_tcal_show;
this.f_hide = f_tcal_hide;
this.f_toggle = f_tcalToggle;
this.f_update = f_tcalUpdate;
this.f_relDate = f_tcalRelDate;
this.f_parseDate = f_tcalParseDate;
this.f_generDate = f_tcalGenerDate;
// create calendar icon
this.s_iconId = 'tcalico_' + this.s_id;
this.e_icon = f_getElement(this.s_iconId);
if (!this.e_icon) {
document.write('<img src="' + a_tpl.imgpath + 'cal.gif" id="' + this.s_iconId + '" onclick="A_TCALS[\'' + this.s_id + '\'].f_toggle()" class="tcalIcon" alt="Open Calendar" />');
this.e_icon = f_getElement(this.s_iconId);
}
// save received parameters
this.a_cfg = a_cfg;
this.a_tpl = a_tpl;
}
function f_tcal_show (d_date) {
// find input field
if (!this.a_cfg.controlname)
throw("TC: control name is not specified");
if (this.a_cfg.formname) {
var e_form = document.forms[this.a_cfg.formname];
if (!e_form)
throw("TC: form '" + this.a_cfg.formname + "' can not be found");
this.e_input = e_form.elements[this.a_cfg.controlname];
}
else
this.e_input = f_getElement(this.a_cfg.controlname);
if (!this.e_input || !this.e_input.tagName || this.e_input.tagName != 'INPUT')
throw("TC: element '" + this.a_cfg.controlname + "' does not exist in "
+ (this.a_cfg.formname ? "form '" + this.a_cfg.controlname + "'" : 'this document'));
// dynamically create HTML elements if needed
this.e_div = f_getElement('tcal');
if (!this.e_div) {
this.e_div = document.createElement("DIV");
this.e_div.id = 'tcal';
document.body.appendChild(this.e_div);
}
this.e_shade = f_getElement('tcalShade');
if (!this.e_shade) {
this.e_shade = document.createElement("DIV");
this.e_shade.id = 'tcalShade';
document.body.appendChild(this.e_shade);
}
this.e_iframe = f_getElement('tcalIF')
if (b_ieFix && !this.e_iframe) {
this.e_iframe = document.createElement("IFRAME");
this.e_iframe.style.filter = 'alpha(opacity=0)';
this.e_iframe.id = 'tcalIF';
this.e_iframe.src = this.a_tpl.imgpath + 'pixel.gif';
document.body.appendChild(this.e_iframe);
}
// hide all calendars
f_tcal_hideAll();
// generate HTML and show calendar
this.e_icon = f_getElement(this.s_iconId);
if (!this.f_update())
return;
this.e_div.style.visibility = 'visible';
this.e_shade.style.visibility = 'visible';
if (this.e_iframe)
this.e_iframe.style.visibility = 'visible';
// change icon and status
this.e_icon.src = this.a_tpl.imgpath + 'no_cal.gif';
this.e_icon.title = 'Close Calendar';
this.b_visible = true;
}
function f_tcal_hide (n_date) {
if (n_date)
this.e_input.value = this.f_generDate(new Date(n_date));
// no action if not visible
if (!this.b_visible)
return;
// hide elements
if (this.e_iframe)
this.e_iframe.style.visibility = 'hidden';
if (this.e_shade)
this.e_shade.style.visibility = 'hidden';
this.e_div.style.visibility = 'hidden';
// change icon and status
this.e_icon = f_getElement(this.s_iconId);
this.e_icon.src = this.a_tpl.imgpath + 'cal.gif';
this.e_icon.title = 'Open Calendar';
this.b_visible = false;
}
function f_tcalToggle () {
return this.b_visible ? this.f_hide() : this.f_show();
}
function f_tcalUpdate (d_date) {
var d_today = this.a_cfg.today ? this.f_parseDate(this.a_cfg.today) : f_tcalResetTime(new Date());
var d_selected = this.e_input.value == ''
? (this.a_cfg.selected ? this.f_parseDate(this.a_cfg.selected) : d_today)
: this.f_parseDate(this.e_input.value);
// figure out date to display
if (!d_date)
// selected by default
d_date = d_selected;
else if (typeof(d_date) == 'number')
// get from number
d_date = f_tcalResetTime(new Date(d_date));
else if (typeof(d_date) == 'string')
// parse from string
this.f_parseDate(d_date);
if (!d_date) return false;
// first date to display
var d_firstday = new Date(d_date);
d_firstday.setDate(1);
d_firstday.setDate(1 - (7 + d_firstday.getDay() - this.a_tpl.weekstart) % 7);
var a_class, s_html = '<table class="ctrl"><tbody><tr>'
+ (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, -1, 'y') + ' title="Previous Year"><img src="' + this.a_tpl.imgpath + 'prev_year.gif" /></td>' : '')
+ '<td' + this.f_relDate(d_date, -1) + ' title="Previous Month"><img src="' + this.a_tpl.imgpath + 'prev_mon.gif" /></td><th>'
+ this.a_tpl.months[d_date.getMonth()] + ' ' + d_date.getFullYear()
+ '</th><td' + this.f_relDate(d_date, 1) + ' title="Next Month"><img src="' + this.a_tpl.imgpath + 'next_mon.gif" /></td>'
+ (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, 1, 'y') + ' title="Next Year"><img src="' + this.a_tpl.imgpath + 'next_year.gif" /></td></td>' : '')
+ '</tr></tbody></table><table><tbody><tr class="wd">';
// print weekdays titles
for (var i = 0; i < 7; i++)
s_html += '<th>' + this.a_tpl.weekdays[(this.a_tpl.weekstart + i) % 7] + '</th>';
s_html += '</tr>' ;
// print calendar table
var n_date, n_month, d_current = new Date(d_firstday);
while (d_current.getMonth() == d_date.getMonth() ||
d_current.getMonth() == d_firstday.getMonth()) {
// print row heder
s_html +='<tr>';
for (var n_wday = 0; n_wday < 7; n_wday++) {
a_class = [];
n_date = d_current.getDate();
n_month = d_current.getMonth();
// other month
if (d_current.getMonth() != d_date.getMonth())
a_class[a_class.length] = 'othermonth';
// weekend
if (d_current.getDay() == 0 || d_current.getDay() == 6)
a_class[a_class.length] = 'weekend';
// today
if (d_current.valueOf() == d_today.valueOf())
a_class[a_class.length] = 'today';
// selected
if (d_current.valueOf() == d_selected.valueOf())
a_class[a_class.length] = 'selected';
s_html += '<td onclick="A_TCALS[\'' + this.s_id + '\'].f_hide(' + d_current.valueOf() + ')"' + (a_class.length ? ' class="' + a_class.join(' ') + '">' : '>') + n_date + '</td>'
d_current.setDate(++n_date);
while (d_current.getDate() != n_date && d_current.getMonth() == n_month) {
d_current.setHours(d_current.getHours + 1);
d_current = f_tcalResetTime(d_current);
}
}
// print row footer
s_html +='</tr>';
}
s_html +='</tbody></table>';
// update HTML, positions and sizes
this.e_div.innerHTML = s_html;
var n_width = this.e_div.offsetWidth;
var n_height = this.e_div.offsetHeight;
var n_top = f_getPosition (this.e_icon, 'Top') + this.e_icon.offsetHeight;
var n_left = f_getPosition (this.e_icon, 'Left') - n_width + this.e_icon.offsetWidth;
if (n_left < 0) n_left = 0;
this.e_div.style.left = n_left + 'px';
this.e_div.style.top = n_top + 'px';
this.e_shade.style.width = (n_width + 8) + 'px';
this.e_shade.style.left = (n_left - 1) + 'px';
this.e_shade.style.top = (n_top - 1) + 'px';
this.e_shade.innerHTML = b_ieFix
? '<table><tbody><tr><td rowspan="2" colspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_tr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td height="' + (n_height - 7) + '" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_mr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td width="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bl.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bm.png\', sizingMethod=\'scale\');" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_br.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tbody></table>'
: '<table><tbody><tr><td rowspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td rowspan="2"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7"><img src="' + this.a_tpl.imgpath + 'shade_tr.png"></td></tr><tr><td background="' + this.a_tpl.imgpath + 'shade_mr.png" height="' + (n_height - 7) + '"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td><img src="' + this.a_tpl.imgpath + 'shade_bl.png"></td><td background="' + this.a_tpl.imgpath + 'shade_bm.png" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td><img src="' + this.a_tpl.imgpath + 'shade_br.png"></td></tr><tbody></table>';
if (this.e_iframe) {
this.e_iframe.style.left = n_left + 'px';
this.e_iframe.style.top = n_top + 'px';
this.e_iframe.style.width = (n_width + 6) + 'px';
this.e_iframe.style.height = (n_height + 6) +'px';
}
return true;
}
function f_getPosition (e_elemRef, s_coord) {
var n_pos = 0, n_offset,
e_elem = e_elemRef;
while (e_elem) {
n_offset = e_elem["offset" + s_coord];
n_pos += n_offset;
e_elem = e_elem.offsetParent;
}
// margin correction in some browsers
if (b_ieMac)
n_pos += parseInt(document.body[s_coord.toLowerCase() + 'Margin']);
else if (b_safari)
n_pos -= n_offset;
e_elem = e_elemRef;
while (e_elem != document.body) {
n_offset = e_elem["scroll" + s_coord];
if (n_offset && e_elem.style.overflow == 'scroll')
n_pos -= n_offset;
e_elem = e_elem.parentNode;
}
return n_pos;
}
function f_tcalRelDate (d_date, d_diff, s_units) {
var s_units = (s_units == 'y' ? 'FullYear' : 'Month');
var d_result = new Date(d_date);
d_result['set' + s_units](d_date['get' + s_units]() + d_diff);
if (d_result.getDate() != d_date.getDate())
d_result.setDate(0);
return ' onclick="A_TCALS[\'' + this.s_id + '\'].f_update(' + d_result.valueOf() + ')"';
}
function f_tcal_hideAll () {
for (var i = 0; i < window.A_TCALSIDX.length; i++)
window.A_TCALSIDX[i].f_hide();
}
function f_tcalResetTime (d_date) {
d_date.setHours(0);
d_date.setMinutes(0);
d_date.setSeconds(0);
d_date.setMilliseconds(0);
return d_date;
}
f_getElement = document.all ?
function (s_id) { return document.all[s_id] } :
function (s_id) { return document.getElementById(s_id) };
if (document.addEventListener)
window.addEventListener('scroll', f_tcal_hideAll, false);
if (window.attachEvent)
window.attachEvent('onscroll', f_tcal_hideAll);
// global variables
var s_userAgent = navigator.userAgent.toLowerCase(),
re_webkit = /WebKit\/(\d+)/i;
var b_mac = s_userAgent.indexOf('mac') != -1,
b_ie5 = s_userAgent.indexOf('msie 5') != -1,
b_ie6 = s_userAgent.indexOf('msie 6') != -1 && s_userAgent.indexOf('opera') == -1;
var b_ieFix = b_ie5 || b_ie6,
b_ieMac = b_mac && b_ie5,
b_safari = b_mac && re_webkit.exec(s_userAgent) && Number(RegExp.$1) < 500;
@@ -1,7 +1,7 @@
<?php
# conf_exten_check.php version 2.2.0
# conf_exten_check.php version 2.4
#
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to send whether the meetme conference has live channels connected and which they are
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
@@ -50,10 +50,12 @@
# 91130-2022 - Added code for manager override of in-group selection
# 91228-1341 - Added API fields update functions
# 100109-1337 - Fixed Manual dial live call detection
# 100527-0957 - Added send_dtmf, transfer_conference and park_call API functions
# 100727-2209 - Added timer actions for hangup, extension, callmenu and ingroup as well as destination
#
$version = '2.2.0-25';
$build = '100109-1337';
$version = '2.4-27';
$build = '100727-2209';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=32;
$one_mysql_log=0;
@@ -387,7 +389,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
}
### grab the API hangup and API dispo fields in vicidial_live_agents
$stmt="SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_update_fields_data,external_timer_action,external_timer_action_message,external_timer_action_seconds from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
$stmt="SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_update_fields_data,external_timer_action,external_timer_action_message,external_timer_action_seconds,external_dtmf,external_transferconf,external_park,external_timer_action_destination from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03010',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -401,6 +403,10 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
$timer_action = $row[6];
$timer_action_message = $row[7];
$timer_action_seconds = $row[8];
$external_dtmf = $row[9];
$external_transferconf = $row[10];
$external_park = $row[11];
$timer_action_destination = $row[12];
if (strlen($external_status)<1) {$external_status = '::::::::::';}
@@ -570,7 +576,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
if ($Ashift_logout > 0)
{$Alogin='SHIFT_LOGOUT';}
echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Stato: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . '|DEADcall: ' . $DEADcustomer . '|InGroupChange: ' . $InGroupChangeDetails . '|APIFields: ' . $external_update_fields . '|APIFieldsData: ' . $external_update_fields_data . '|APITimerAction: ' . $timer_action . '|APITimerMessage: ' . $timer_action_message . '|APITimerSeconds: ' . $timer_action_seconds . "\n";
echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Stato: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . '|DEADcall: ' . $DEADcustomer . '|InGroupChange: ' . $InGroupChangeDetails . '|APIFields: ' . $external_update_fields . '|APIFieldsData: ' . $external_update_fields_data . '|APITimerAction: ' . $timer_action . '|APITimerMessage: ' . $timer_action_message . '|APITimerSeconds: ' . $timer_action_seconds . '|APIdtmf: ' . $external_dtmf . '|APItransferconf: ' . $external_transferconf . '|APIpark: ' . $external_park . '|APITimerDestination: ' . $timer_action_destination . "\n";
if (strlen($timer_action) > 3)
{
+504
View File
@@ -0,0 +1,504 @@
<?php
#
# functions.php version 2.4
#
# functions for agent scripts
#
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
#
# CHANGES:
# 100629-1201 - First Build
#
##### BEGIN gather values for display of custom list fields for a lead #####
function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user)
{
$STARTtime = date("U");
$TODAY = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|';
require("dbconnect.php");
$CFoutput='';
$stmt="SHOW TABLES LIKE \"custom_$list_id\";";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05002',$user,$server_ip,$session_name,$one_mysql_log);}
$tablecount_to_print = mysql_num_rows($rslt);
if ($tablecount_to_print > 0)
{
$stmt="SELECT count(*) from custom_$list_id;";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05003',$user,$server_ip,$session_name,$one_mysql_log);}
$fieldscount_to_print = mysql_num_rows($rslt);
if ($fieldscount_to_print > 0)
{
$rowx=mysql_fetch_row($rslt);
$custom_records_count = $rowx[0];
$select_SQL='';
$stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05004',$user,$server_ip,$session_name,$one_mysql_log);}
$fields_to_print = mysql_num_rows($rslt);
$fields_list='';
$o=0;
while ($fields_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$A_field_id[$o] = $rowx[0];
$A_field_label[$o] = $rowx[1];
$A_field_name[$o] = $rowx[2];
$A_field_description[$o] = $rowx[3];
$A_field_rank[$o] = $rowx[4];
$A_field_help[$o] = $rowx[5];
$A_field_type[$o] = $rowx[6];
$A_field_options[$o] = $rowx[7];
$A_field_size[$o] = $rowx[8];
$A_field_max[$o] = $rowx[9];
$A_field_default[$o] = $rowx[10];
$A_field_cost[$o] = $rowx[11];
$A_field_required[$o] = $rowx[12];
$A_multi_position[$o] = $rowx[13];
$A_name_position[$o] = $rowx[14];
$A_field_order[$o] = $rowx[15];
$A_field_value[$o] = '';
if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields))
{
if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') )
{
$select_SQL .= "8,";
$A_field_select[$o]='----EMPTY----';
}
else
{
$select_SQL .= "$A_field_label[$o],";
$A_field_select[$o]=$A_field_label[$o];
}
}
else
{
$select_SQL .= "8,";
$A_field_value[$o] = '--A--' . $A_field_label[$o] . '--B--';
}
$o++;
$rank_select .= "<option>$o</option>";
}
$o++;
$rank_select .= "<option>$o</option>";
$last_rank = $o;
$select_SQL = preg_replace("/.$/",'',$select_SQL);
##### BEGIN grab the data from custom table for the lead_id
$stmt="SELECT $select_SQL FROM custom_$list_id where lead_id='$lead_id' LIMIT 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05005',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$list_lead_ct = mysql_num_rows($rslt);
if ($list_lead_ct > 0)
{
$row=mysql_fetch_row($rslt);
$o=0;
while ($fields_to_print >= $o)
{
$A_field_value[$o] = trim("$row[$o]");
if ($A_field_select[$o]=='----EMPTY----')
{$A_field_value[$o]='';}
if (preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields))
{$A_field_value[$o] = '--A--' . $A_field_label[$o] . '--B--';}
$o++;
}
}
else
{
if ($DB) {echo "ERROR: no custom data for this lead: $lead_id\n";}
}
##### END grab the data from custom table for the lead_id
$CFoutput .= "<input type=hidden name=stage id=stage value=\"SUBMIT\">\n";
$CFoutput .= "<center><TABLE cellspacing=2 cellpadding=2>\n";
if ($fields_to_print < 1)
{$CFoutput .= "<tr bgcolor=white align=center><td colspan=4><font size=1>There are no custom fields for this list</td></tr>";}
$o=0;
$last_field_rank=0;
while ($fields_to_print > $o)
{
$helpHTML='';
if (strlen($A_field_help[$o])>0)
{$helpHTML="&nbsp; <a href=\"javascript:open_help('HELP_$A_field_label[$o]','$A_field_help[$o]');\">help+</a>";}
if ($last_field_rank=="$A_field_rank[$o]")
{$CFoutput .= " &nbsp; &nbsp; &nbsp; &nbsp; ";}
else
{
$CFoutput .= "</td></tr>\n";
$CFoutput .= "<tr bgcolor=white><td align=";
if ( ($A_name_position[$o]=='TOP') or ($A_field_type[$o]=='SCRIPT') )
{$CFoutput .= "left colspan=2";}
else
{$CFoutput .= "right";}
$CFoutput .= "><font size=2>";
}
if ($A_field_type[$o]!='SCRIPT')
{$CFoutput .= "<B>$A_field_name[$o]</B>";}
if ( ($A_name_position[$o]=='TOP') or ($A_field_type[$o]=='SCRIPT') )
{$CFoutput .= " &nbsp; <span style=\"position:static;\" id=P_HELP_$A_field_label[$o]></span><span style=\"position:static;background:white;\" id=HELP_$A_field_label[$o]> $helpHTML</span><BR>";}
else
{
if ($last_field_rank=="$A_field_rank[$o]")
{$CFoutput .= " &nbsp;";}
else
{$CFoutput .= "</td><td align=left><font size=2>";}
}
$field_HTML='';
if ($A_field_type[$o]=='SELECT')
{
$field_HTML .= "<select size=1 name=$A_field_label[$o] id=$A_field_label[$o]>\n";
}
if ($A_field_type[$o]=='MULTI')
{
$field_HTML .= "<select MULTIPLE size=$A_field_size[$o] name=$A_field_label[$o][] id=$A_field_label[$o][]>\n";
}
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') )
{
$field_options_array = explode("\n",$A_field_options[$o]);
$field_options_count = count($field_options_array);
$te=0;
while ($te < $field_options_count)
{
if (preg_match("/,/",$field_options_array[$te]))
{
$field_selected='';
$field_options_value_array = explode(",",$field_options_array[$te]);
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') )
{
if (strlen($A_field_value[$o]) > 0)
{
if (preg_match("/$field_options_value_array[0]/",$A_field_value[$o]))
{$field_selected = 'SELECTED';}
}
else
{
if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'SELECTED';}
}
$field_HTML .= "<option value=\"$field_options_value_array[0]\" $field_selected>$field_options_value_array[1]</option>\n";
}
if ( ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') )
{
if ($A_multi_position[$o]=='VERTICAL')
{$field_HTML .= " &nbsp; ";}
if (strlen($A_field_value[$o]) > 0)
{
if (preg_match("/$field_options_value_array[0]/",$A_field_value[$o]))
{$field_selected = 'CHECKED';}
}
else
{
if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'CHECKED';}
}
$field_HTML .= "<input type=$A_field_type[$o] name=$A_field_label[$o][] id=$A_field_label[$o][] value=\"$field_options_value_array[0]\" $field_selected> $field_options_value_array[1]\n";
if ($A_multi_position[$o]=='VERTICAL')
{$field_HTML .= "<BR>\n";}
}
}
$te++;
}
}
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') )
{
$field_HTML .= "</select>\n";
}
if ($A_field_type[$o]=='TEXT')
{
if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';}
if (strlen($A_field_value[$o]) < 1) {$A_field_value[$o] = $A_field_default[$o];}
$field_HTML .= "<input type=text size=$A_field_size[$o] maxlength=$A_field_max[$o] name=$A_field_label[$o] id=$A_field_label[$o] value=\"$A_field_value[$o]\">\n";
}
if ($A_field_type[$o]=='AREA')
{
if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';}
if (strlen($A_field_value[$o]) < 1) {$A_field_value[$o] = $A_field_default[$o];}
$field_HTML .= "<textarea name=$A_field_label[$o] id=$A_field_label[$o] ROWS=$A_field_max[$o] COLS=$A_field_size[$o]>$A_field_value[$o]</textarea>";
}
if ($A_field_type[$o]=='DISPLAY')
{
if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';}
$field_HTML .= "$A_field_default[$o]\n";
}
if ($A_field_type[$o]=='SCRIPT')
{
if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';}
$field_HTML .= "$A_field_options[$o]\n";
}
if ($A_field_type[$o]=='DATE')
{
if ( (strlen($A_field_default[$o])<1) or ($A_field_default[$o]=='NULL') ) {$A_field_default[$o]=0;}
$day_diff = $A_field_default[$o];
$default_date = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+$day_diff,date("Y")));
if (strlen($A_field_value[$o]) > 0) {$default_date = $A_field_value[$o];}
$field_HTML .= "<input type=text size=11 maxlength=10 name=$A_field_label[$o] id=$A_field_label[$o] value=\"$default_date\" onclick=\"f_tcalToggle()\">\n";
$field_HTML .= "<script language=\"JavaScript\">\n";
$field_HTML .= "var o_cal = new tcal ({\n";
$field_HTML .= " 'formname': 'form_custom_fields',\n";
$field_HTML .= " 'controlname': '$A_field_label[$o]'});\n";
$field_HTML .= "o_cal.a_tpl.yearscroll = false;\n";
$field_HTML .= "</script>\n";
}
if ($A_field_type[$o]=='TIME')
{
$minute_diff = $A_field_default[$o];
$default_time = date("H:i:s", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y")));
$default_hour = date("H", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y")));
$default_minute = date("i", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y")));
if (strlen($A_field_value[$o]) > 2)
{
$default_time = $A_field_value[$o];
$time_field_value = explode(':',$default_time);
$default_hour = $time_field_value[0];
$default_minute = $time_field_value[1];
}
$field_HTML .= "<input type=hidden name=$A_field_label[$o] id=$A_field_label[$o] value=\"$default_time\">";
$field_HTML .= "<SELECT name=HOUR_$A_field_label[$o] id=HOUR_$A_field_label[$o]>";
$field_HTML .= "<option>00</option>";
$field_HTML .= "<option>01</option>";
$field_HTML .= "<option>02</option>";
$field_HTML .= "<option>03</option>";
$field_HTML .= "<option>04</option>";
$field_HTML .= "<option>05</option>";
$field_HTML .= "<option>06</option>";
$field_HTML .= "<option>07</option>";
$field_HTML .= "<option>08</option>";
$field_HTML .= "<option>09</option>";
$field_HTML .= "<option>10</option>";
$field_HTML .= "<option>11</option>";
$field_HTML .= "<option>12</option>";
$field_HTML .= "<option>13</option>";
$field_HTML .= "<option>14</option>";
$field_HTML .= "<option>15</option>";
$field_HTML .= "<option>16</option>";
$field_HTML .= "<option>17</option>";
$field_HTML .= "<option>18</option>";
$field_HTML .= "<option>19</option>";
$field_HTML .= "<option>20</option>";
$field_HTML .= "<option>21</option>";
$field_HTML .= "<option>22</option>";
$field_HTML .= "<option>23</option>";
$field_HTML .= "<OPTION value=\"$default_hour\" selected>$default_hour</OPTION>";
$field_HTML .= "</SELECT>";
$field_HTML .= "<SELECT name=MINUTE_$A_field_label[$o] id=MINUTE_$A_field_label[$o]>";
$field_HTML .= "<option>00</option>";
$field_HTML .= "<option>05</option>";
$field_HTML .= "<option>10</option>";
$field_HTML .= "<option>15</option>";
$field_HTML .= "<option>20</option>";
$field_HTML .= "<option>25</option>";
$field_HTML .= "<option>30</option>";
$field_HTML .= "<option>35</option>";
$field_HTML .= "<option>40</option>";
$field_HTML .= "<option>45</option>";
$field_HTML .= "<option>50</option>";
$field_HTML .= "<option>55</option>";
$field_HTML .= "<OPTION value=\"$default_minute\" selected>$default_minute</OPTION>";
$field_HTML .= "</SELECT>";
}
if ( ($A_name_position[$o]=='LEFT') and ($A_field_type[$o]!='SCRIPT') )
{
$CFoutput .= " $field_HTML <span style=\"position:static;\" id=P_HELP_$A_field_label[$o]></span><span style=\"position:static;background:white;\" id=HELP_$A_field_label[$o]> $helpHTML</span>";
}
else
{
$CFoutput .= " $field_HTML\n";
}
$last_field_rank=$A_field_rank[$o];
$o++;
}
$CFoutput .= "</td></tr></table>\n";
}
else
{$CFoutput .= "ERROR: no custom list fields\n";}
}
else
{$CFoutput .= "ERROR: no custom list fields table\n";}
##### BEGIN parsing for vicidial variables #####
if (preg_match("/--A--/",$CFoutput))
{
if ( (eregi('--A--user_custom_',$CFoutput)) or (eregi('--A--fullname',$CFoutput)) )
{
$stmt = "select custom_one,custom_two,custom_three,custom_four,custom_five,full_name from vicidial_users where user='$user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05006',$user,$server_ip,$session_name,$one_mysql_log);}
$VUC_ct = mysql_num_rows($rslt);
if ($VUC_ct > 0)
{
$row=mysql_fetch_row($rslt);
$user_custom_one = trim($row[0]);
$user_custom_two = trim($row[1]);
$user_custom_three = trim($row[2]);
$user_custom_four = trim($row[3]);
$user_custom_five = trim($row[4]);
$fullname = trim($row[5]);
}
}
if (eregi('--A--dialed_',$CFoutput))
{
$dialed_number = $phone_number;
$dialed_label = 'NONE';
### find the dialed number and label for this call
$stmt = "SELECT phone_number,alt_dial from vicidial_log where uniqueid='$uniqueid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05008',$user,$server_ip,$session_name,$one_mysql_log);}
$vl_dialed_ct = mysql_num_rows($rslt);
if ($vl_dialed_ct > 0)
{
$row=mysql_fetch_row($rslt);
$dialed_number = $row[0];
$dialed_label = $row[1];
}
}
##### grab the data from vicidial_list for the lead_id
$stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner FROM vicidial_list where lead_id='$lead_id' LIMIT 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05007',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$list_lead_ct = mysql_num_rows($rslt);
if ($list_lead_ct > 0)
{
$row=mysql_fetch_row($rslt);
$dispo = trim($row[3]);
$tsr = trim($row[4]);
$vendor_id = trim($row[5]);
$vendor_lead_code = trim($row[5]);
$source_id = trim($row[6]);
$list_id = trim($row[7]);
$gmt_offset_now = trim($row[8]);
$phone_code = trim($row[10]);
$phone_number = trim($row[11]);
$title = trim($row[12]);
$first_name = trim($row[13]);
$middle_initial = trim($row[14]);
$last_name = trim($row[15]);
$address1 = trim($row[16]);
$address2 = trim($row[17]);
$address3 = trim($row[18]);
$city = trim($row[19]);
$state = trim($row[20]);
$province = trim($row[21]);
$postal_code = trim($row[22]);
$country_code = trim($row[23]);
$gender = trim($row[24]);
$date_of_birth = trim($row[25]);
$alt_phone = trim($row[26]);
$email = trim($row[27]);
$security = trim($row[28]);
$comments = trim($row[29]);
$called_count = trim($row[30]);
$rank = trim($row[32]);
$owner = trim($row[33]);
}
$CFoutput = eregi_replace('--A--lead_id--B--',"$lead_id",$CFoutput);
$CFoutput = eregi_replace('--A--vendor_id--B--',"$vendor_id",$CFoutput);
$CFoutput = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$CFoutput);
$CFoutput = eregi_replace('--A--list_id--B--',"$list_id",$CFoutput);
$CFoutput = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$CFoutput);
$CFoutput = eregi_replace('--A--phone_code--B--',"$phone_code",$CFoutput);
$CFoutput = eregi_replace('--A--phone_number--B--',"$phone_number",$CFoutput);
$CFoutput = eregi_replace('--A--title--B--',"$title",$CFoutput);
$CFoutput = eregi_replace('--A--first_name--B--',"$first_name",$CFoutput);
$CFoutput = eregi_replace('--A--middle_initial--B--',"$middle_initial",$CFoutput);
$CFoutput = eregi_replace('--A--last_name--B--',"$last_name",$CFoutput);
$CFoutput = eregi_replace('--A--address1--B--',"$address1",$CFoutput);
$CFoutput = eregi_replace('--A--address2--B--',"$address2",$CFoutput);
$CFoutput = eregi_replace('--A--address3--B--',"$address3",$CFoutput);
$CFoutput = eregi_replace('--A--city--B--',"$city",$CFoutput);
$CFoutput = eregi_replace('--A--state--B--',"$state",$CFoutput);
$CFoutput = eregi_replace('--A--province--B--',"$province",$CFoutput);
$CFoutput = eregi_replace('--A--postal_code--B--',"$postal_code",$CFoutput);
$CFoutput = eregi_replace('--A--country_code--B--',"$country_code",$CFoutput);
$CFoutput = eregi_replace('--A--gender--B--',"$gender",$CFoutput);
$CFoutput = eregi_replace('--A--date_of_birth--B--',"$date_of_birth",$CFoutput);
$CFoutput = eregi_replace('--A--alt_phone--B--',"$alt_phone",$CFoutput);
$CFoutput = eregi_replace('--A--email--B--',"$email",$CFoutput);
$CFoutput = eregi_replace('--A--security_phrase--B--',"$security_phrase",$CFoutput);
$CFoutput = eregi_replace('--A--comments--B--',"$comments",$CFoutput);
$CFoutput = eregi_replace('--A--user--B--',"$user",$CFoutput);
$CFoutput = eregi_replace('--A--pass--B--',"$pass",$CFoutput);
$CFoutput = eregi_replace('--A--campaign--B--',"$campaign",$CFoutput);
$CFoutput = eregi_replace('--A--server_ip--B--',"$server_ip",$CFoutput);
$CFoutput = eregi_replace('--A--session_id--B--',"$session_id",$CFoutput);
$CFoutput = eregi_replace('--A--dialed_number--B--',"$dialed_number",$CFoutput);
$CFoutput = eregi_replace('--A--dialed_label--B--',"$dialed_label",$CFoutput);
$CFoutput = eregi_replace('--A--source_id--B--',"$source_id",$CFoutput);
$CFoutput = eregi_replace('--A--rank--B--',"$rank",$CFoutput);
$CFoutput = eregi_replace('--A--owner--B--',"$owner",$CFoutput);
$CFoutput = eregi_replace('--A--fullname--B--',"$fullname",$CFoutput);
$CFoutput = eregi_replace('--A--uniqueid--B--',"$uniqueid",$CFoutput);
$CFoutput = eregi_replace('--A--user_custom_one--B--',"$user_custom_one",$CFoutput);
$CFoutput = eregi_replace('--A--user_custom_two--B--',"$user_custom_two",$CFoutput);
$CFoutput = eregi_replace('--A--user_custom_three--B--',"$user_custom_three",$CFoutput);
$CFoutput = eregi_replace('--A--user_custom_four--B--',"$user_custom_four",$CFoutput);
$CFoutput = eregi_replace('--A--user_custom_five--B--',"$user_custom_five",$CFoutput);
# custom fields replacement
$o=0;
while ($fields_to_print > $o)
{
$CFoutput = eregi_replace("--A--$A_field_label[$o]--B--","$A_field_value[$o]",$CFoutput);
$o++;
}
if ($DB > 0) {echo "$CFoutput<BR>\n";}
}
##### END parsing for vicidial variables #####
return $CFoutput;
}
##### END gather values for display of custom list fields for a lead #####
##### MySQL Error Logging #####
function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log)
{
$NOW_TIME = date("Y-m-d H:i:s");
# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log);
$errno=''; $error='';
if ( ($mel > 0) or ($one_mysql_log > 0) )
{
$errno = mysql_errno($link);
if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) )
{
$error = mysql_error($link);
$efp = fopen ("./vicidial_mysql_errors.txt", "a");
fwrite ($efp, "$NOW_TIME|vdc_db_query|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n");
fclose($efp);
}
}
$one_mysql_log=0;
return $errno;
}
?>
+29 -4
View File
@@ -1,5 +1,5 @@
<?php
# manager_send.php version 2.2.0
# manager_send.php version 2.4
#
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
@@ -12,7 +12,7 @@
# - $user
# - $pass
# optional variables:
# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectXtraCX','RedirectVD','HangupConfDial','VolumeControl','OriginateVDRelogin')
# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','SysCIDdtmfOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectXtraCX','RedirectVD','HangupConfDial','VolumeControl','OriginateVDRelogin')
# - $queryCID - ('CN012345678901234567',...)
# - $format - ('text','debug')
# - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...)
@@ -97,10 +97,11 @@
# 91213-1208 - Added queue_position to queue_log COMPLETE... records
# 100327-0846 - Fix for list_id override answering machine message
# 100423-2304 - Added alertCID
# 100527-1014 - Added SysCIDdtmfOriginate function
#
$version = '2.2.0-48';
$build = '100423-2304';
$version = '2.4-49';
$build = '100527-1014';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=85;
$one_mysql_log=0;
@@ -294,6 +295,20 @@ if ($format=='debug')
######################
# ACTION=SysCIDdtmfOriginate - prep the send dtmf command
######################
if ($ACTION=="SysCIDdtmfOriginate")
{
$stmt="UPDATE vicidial_live_agents SET external_dtmf='' where user='$user';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);}
$ACTION="SysCIDOriginate";
}
######################
# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls
@@ -771,6 +786,11 @@ if ($ACTION=="RedirectToPark")
# fwrite ($fp, "$NOW_TIME|MS_LOG_0|$queryCID|$stmt|\n");
# fclose($fp);
}
$stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);}
}
if ($ACTION=="RedirectFromPark")
@@ -795,6 +815,11 @@ if ($ACTION=="RedirectFromPark")
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);}
$ACTION="Redirect";
}
$stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);}
}
if ($ACTION=="RedirectName")
+8 -6
View File
@@ -9,10 +9,11 @@
# 80525-2351 - Added an audit log that is not to be editable
# 80602-0641 - Fixed status update bug
# 90508-0727 - Changed to PHP long tags
# 100621-1023 - Added admin_web_directory variable
#
$version = '2.2.0-5';
$build = '90508-0727';
$version = '2.2.0-6';
$build = '100621-1023';
$StarTtimE = date("U");
$NOW_TIME = date("Y-m-d H:i:s");
@@ -87,7 +88,7 @@ require("dbconnect.php");
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,admin_home_url FROM system_settings;";
$stmt = "SELECT use_non_latin,admin_home_url,admin_web_directory FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
@@ -95,8 +96,9 @@ $i=0;
while ($i < $qm_conf_ct)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$welcomeURL = $row[1];
$non_latin = $row[0];
$welcomeURL = $row[1];
$admin_web_directory = $row[2];
$i++;
}
##### END SETTINGS LOOKUP #####
@@ -338,7 +340,7 @@ if ( ($stage == 'login') or ($stage == 'logout') )
if ($referrer=='agent')
{$BACKlink = "<A HREF=\"./vicidial.php?pl=$phone_login&pp=$phone_pass&VD_login=$user\"><font color=\"#003333\">Torna alla schermata di Login</font></A>";}
if ($referrer=='admin')
{$BACKlink = "<A HREF=\"../vicidial/admin.php\"><font color=\"#003333\">Torna ad Amministrazione</font></A>";}
{$BACKlink = "<A HREF=\"/$admin_web_directory/admin.php\"><font color=\"#003333\">Torna ad Amministrazione</font></A>";}
if ($referrer=='welcome')
{$BACKlink = "<A HREF=\"$welcomeURL\"><font color=\"#003333\">Torna alla schermata iniziale</font></A>";}
+173 -51
View File
@@ -246,10 +246,14 @@
# 100413-1341 - Fixes for extended alt-dial
# 100420-1006 - Added option for LIVE-only callback count
# 100424-1630 - Added uniqueid display options
# 100622-2217 - Added field labels
# 100624-1401 - Fix for dispo call url bug related to dialed number and label
# 100625-0915 - Fix for auto-dial bug for presets and timer actions
# 100712-1447 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any
#
$version = '2.4-153';
$build = '100424-1630';
$version = '2.4-157';
$build = '100712-1447';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=333;
$one_mysql_log=0;
@@ -1670,7 +1674,7 @@ if ($ACTION == 'manDiaLnextCaLL')
if ($affected_rows > 0)
{
$stmt="SELECT lead_id,list_id,gmt_offset_now,state FROM vicidial_list where status='QUEUE' and user='$user' order by modify_date desc LIMIT 1;";
$stmt="SELECT lead_id,list_id,gmt_offset_now,state,entry_list_id FROM vicidial_list where status='QUEUE' and user='$user' order by modify_date desc LIMIT 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00243',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -1682,6 +1686,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$list_id = $row[1];
$gmt_offset_now = $row[2];
$state = $row[3];
$entry_list_id = $row[4];
$stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='QUEUE',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='MAIN',user='$user',priority='0';";
if ($DB) {echo "$stmt\n";}
@@ -1716,7 +1721,7 @@ if ($ACTION == 'manDiaLnextCaLL')
}
##### grab the data from vicidial_list for the lead_id
$stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner FROM vicidial_list where lead_id='$lead_id' LIMIT 1;";
$stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id FROM vicidial_list where lead_id='$lead_id' LIMIT 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00026',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -1756,6 +1761,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$called_count = trim("$row[30]");
$rank = trim("$row[32]");
$owner = trim("$row[33]");
$entry_list_id = trim("$row[34]");
}
$called_count++;
@@ -2186,6 +2192,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$LeaD_InfO .= $VDCL_xferconf_c_number . "\n";
$LeaD_InfO .= $VDCL_xferconf_d_number . "\n";
$LeaD_InfO .= $VDCL_xferconf_e_number . "\n";
$LeaD_InfO .= $entry_list_id . "\n";
echo $LeaD_InfO;
}
@@ -3182,7 +3189,7 @@ if ($stage == "end")
{$Xlast=0;}
$VD_altdialx='';
$stmt="SELECT gmt_offset_now,state,list_id FROM vicidial_list where lead_id='$lead_id';";
$stmt="SELECT gmt_offset_now,state,list_id,entry_list_id FROM vicidial_list where lead_id='$lead_id';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00073',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -3193,6 +3200,7 @@ if ($stage == "end")
$EA_gmt_offset_now = $row[0];
$EA_state = $row[1];
$EA_list_id = $row[2];
$EA_entry_list_id = $row[3];
}
$alt_dial_phones_count=0;
$stmt="SELECT count(*) FROM vicidial_list_alt_phones where lead_id='$lead_id';";
@@ -3961,7 +3969,7 @@ if ($ACTION == 'VDADcheckINCOMING')
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00107',$user,$server_ip,$session_name,$one_mysql_log);}
##### grab the data from vicidial_list for the lead_id
$stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner FROM vicidial_list where lead_id='$lead_id' LIMIT 1;";
$stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id FROM vicidial_list where lead_id='$lead_id' LIMIT 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00108',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -3999,6 +4007,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$called_count = trim("$row[30]");
$rank = trim("$row[32]");
$owner = trim("$row[33]");
$entry_list_id = trim("$row[34]");
}
##### if lead is a callback, grab the callback comments
@@ -4160,7 +4169,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$script_recording_delay = $row[0];
}
$stmt = "SELECT campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$campaign';";
$stmt = "SELECT campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,timer_action,timer_action_message,timer_action_seconds,timer_action_destination from vicidial_campaigns where campaign_id='$campaign';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00114',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -4168,19 +4177,23 @@ if ($ACTION == 'VDADcheckINCOMING')
if ($VDIG_cid_ct > 0)
{
$row=mysql_fetch_row($rslt);
$VDCL_campaign_script = $row[0];
$VDCL_get_call_launch = $row[1];
$VDCL_xferconf_a_dtmf = $row[2];
$VDCL_xferconf_a_number = $row[3];
$VDCL_xferconf_b_dtmf = $row[4];
$VDCL_xferconf_b_number = $row[5];
$VDCL_default_xfer_group = $row[6];
$VDCL_campaign_script = $row[0];
$VDCL_get_call_launch = $row[1];
$VDCL_xferconf_a_dtmf = $row[2];
$VDCL_xferconf_a_number = $row[3];
$VDCL_xferconf_b_dtmf = $row[4];
$VDCL_xferconf_b_number = $row[5];
$VDCL_default_xfer_group = $row[6];
if (strlen($VDCL_default_xfer_group)<2) {$VDCL_default_xfer_group='X';}
$VDCL_start_call_url = $row[7];
$VDCL_dispo_call_url = $row[8];
$VDCL_xferconf_c_number = $row[9];
$VDCL_xferconf_d_number = $row[10];
$VDCL_xferconf_e_number = $row[11];
$VDCL_start_call_url = $row[7];
$VDCL_dispo_call_url = $row[8];
$VDCL_xferconf_c_number = $row[9];
$VDCL_xferconf_d_number = $row[10];
$VDCL_xferconf_e_number = $row[11];
$VDCL_timer_action = $row[12];
$VDCL_timer_action_message = $row[13];
$VDCL_timer_action_seconds = $row[14];
$VDCL_timer_action_destination = $row[15];
}
### Check for List ID override settings
@@ -4207,7 +4220,7 @@ if ($ACTION == 'VDADcheckINCOMING')
}
}
echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X|||||$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number\n|\n";
echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X|||||$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number||||$VDCL_timer_action_destination|\n|\n";
if (ereg('X',$dialed_label))
{
@@ -4268,7 +4281,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$script_recording_delay = $row[0];
}
$stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,uniqueid_status_display,uniqueid_status_prefix from vicidial_inbound_groups where group_id='$VDADchannel_group';";
$stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,uniqueid_status_display,uniqueid_status_prefix,timer_action_destination from vicidial_inbound_groups where group_id='$VDADchannel_group';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00119',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -4301,8 +4314,9 @@ if ($ACTION == 'VDADcheckINCOMING')
$VDCL_xferconf_e_number = $row[22];
$VDCL_uniqueid_status_display = $row[23];
$VDCL_uniqueid_status_prefix = $row[24];
$VDCL_timer_action_destination = $row[25];
$stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$campaign';";
$stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,timer_action_destination from vicidial_campaigns where campaign_id='$campaign';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00181',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -4336,6 +4350,8 @@ if ($ACTION == 'VDADcheckINCOMING')
{$VDCL_xferconf_d_number = $row[12];}
if (strlen($VDCL_xferconf_e_number) < 1)
{$VDCL_xferconf_e_number = $row[13];}
if (strlen($VDCL_timer_action_destination) < 1)
{$VDCL_timer_action_destination = $row[14];}
if ( ( (ereg('NONE',$VDCL_ingroup_script)) and (strlen($VDCL_ingroup_script) < 5) ) or (strlen($VDCL_ingroup_script) < 1) )
{
@@ -4390,7 +4406,7 @@ if ($ACTION == 'VDADcheckINCOMING')
}
else
{
$stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$VDADchannel_group';";
$stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,timer_action_destination from vicidial_campaigns where campaign_id='$VDADchannel_group';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00121',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -4413,6 +4429,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$VDCL_xferconf_c_number = $row[12];
$VDCL_xferconf_d_number = $row[13];
$VDCL_xferconf_e_number = $row[14];
$VDCL_timer_action_destination = $row[15];
}
$script_recording_delay=0;
@@ -4480,8 +4497,8 @@ if ($ACTION == 'VDADcheckINCOMING')
}
### if web form is set then send su to vicidial.php for override of WEB_FORM address
if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|\n";}
else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|\n";}
if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|\n";}
else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|\n";}
$stmt = "SELECT full_name from vicidial_users where user='$tsr';";
if ($DB) {echo "$stmt\n";}
@@ -4569,6 +4586,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$LeaD_InfO .= $rank . "\n";
$LeaD_InfO .= $owner . "\n";
$LeaD_InfO .= $script_recording_delay . "\n";
$LeaD_InfO .= $entry_list_id . "\n";
echo $LeaD_InfO;
@@ -4758,10 +4776,24 @@ if ($ACTION == 'VDADcheckINCOMING')
$durationLimit = preg_replace('/\D/','',$SCUresponse[1]);
}
if (strlen($durationLimit) < 1) {$durationLimit = 0;}
$durationLimitSECnext = ( ($minuteswarning + 0) * 60);
$durationLimitSEC = ( ( ($durationLimit + 0) - $minuteswarning) * 60); # minutes - 3 for 3-minute-warning
if ($durationLimitSEC < 5) {$durationLimitSEC = 5;}
if ( ($durationLimitSECnext < 30) or (strlen($durationLimitSECnext)<1) ) {$durationLimitSECnext = 30;}
$stmt="UPDATE vicidial_live_agents set external_timer_action='D1_DIAL',external_timer_action_message='$minuteswarning minute warning for customer',external_timer_action_seconds='$durationLimitSEC' where user='$user';";
$timer_action_destination='';
if (preg_match("/nextstep=/",$VDCL_start_call_url))
{
$nextstepARY = explode('nextstep=',$VDCL_start_call_url);
$nextstep = preg_replace("/&.*/",'',$nextstepARY[1]);
$nextmessageARY = explode('nextmessage=',$VDCL_start_call_url);
$nextmessage = preg_replace("/&.*/",'',$nextmessageARY[1]);
$destinationARY = explode('destination=',$VDCL_start_call_url);
$destination = preg_replace("/&.*/",'',$destinationARY[1]);
$timer_action_destination = "nextstep---$nextstep--$durationLimitSECnext--$destination--$nextmessage--";
}
$stmt="UPDATE vicidial_live_agents set external_timer_action='D1_DIAL',external_timer_action_message='$minuteswarning minute warning for customer',external_timer_action_seconds='$durationLimitSEC',external_timer_action_destination='$timer_action_destination' where user='$user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00295',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -5014,7 +5046,7 @@ if ($ACTION == 'updateDISPO')
}
### reset the API fields in vicidial_live_agents record
$stmt = "UPDATE vicidial_live_agents set lead_id=0,external_hangup=0,external_status='',external_update_fields='0',external_update_fields_data='',external_timer_action_seconds='-1',last_state_change='$NOW_TIME' where user='$user' and server_ip='$server_ip';";
$stmt = "UPDATE vicidial_live_agents set lead_id=0,external_hangup=0,external_status='',external_update_fields='0',external_update_fields_data='',external_timer_action_seconds='-1',external_dtmf='',external_transferconf='',external_park='',last_state_change='$NOW_TIME' where user='$user' and server_ip='$server_ip';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00141',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -5052,6 +5084,7 @@ if ($ACTION == 'updateDISPO')
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
$call_type='IN';
$stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
@@ -5076,6 +5109,7 @@ if ($ACTION == 'updateDISPO')
}
else
{
$call_type='OUT';
$four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y")));
if ( ($auto_dial_level < 1) or (preg_match('/^M/',$MDnextCID)) )
@@ -5962,11 +5996,34 @@ if ($ACTION == 'updateDISPO')
if (strlen($status_name) < 1) {$status_name = $dispo_choice;}
}
$dispo_name = urlencode(trim($status_name));
if (eregi('--A--dialed_',$dispo_call_url))
{
$dialed_number = $phone_number;
$dialed_label = 'NONE';
if ($call_type=='OUT')
{
### find the dialed number and label for this call
$stmt = "SELECT phone_number,alt_dial from vicidial_log where uniqueid='$uniqueid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
$vl_dialed_ct = mysql_num_rows($rslt);
if ($vl_dialed_ct > 0)
{
$row=mysql_fetch_row($rslt);
$dialed_number = $row[0];
$dialed_label = $row[1];
}
}
}
##### grab the data from vicidial_list for the lead_id
$stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner FROM vicidial_list where lead_id='$lead_id' LIMIT 1;";
$stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id FROM vicidial_list where lead_id='$lead_id' LIMIT 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00290',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -6004,6 +6061,7 @@ if ($ACTION == 'updateDISPO')
$called_count = urlencode(trim($row[30]));
$rank = urlencode(trim($row[32]));
$owner = urlencode(trim($row[33]));
$entry_list_id = urlencode(trim($row[34]));
}
$dispo_call_url = preg_replace('/^VAR/','',$dispo_call_url);
@@ -6319,7 +6377,10 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
if ($comments != 'NO_STATUS_CHANGE')
{
$stmt="UPDATE vicidial_live_agents set status='$stage' where user='$user' and server_ip='$server_ip';";
$vla_lead_wipeSQL='';
if ($ACTION == 'VDADready')
{$vla_lead_wipeSQL = ",lead_id=0";}
$stmt="UPDATE vicidial_live_agents set status='$stage' $vla_lead_wipeSQL where user='$user' and server_ip='$server_ip';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00166',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -7174,10 +7235,55 @@ if ($ACTION == 'LEADINFOview')
{echo "ERROR: no Lead ID";}
else
{
### BEGIN find any custom field labels ###
$label_title = 'Titolo';
$label_first_name = 'Nome';
$label_middle_initial = 'MI';
$label_last_name = 'Cognome';
$label_address1 = 'Indirizzo1';
$label_address2 = 'Indirizzo2';
$label_address3 = 'Indirizzo3';
$label_city = 'Città';
$label_state = 'Stato';
$label_province = 'Provincia';
$label_postal_code = 'CAP';
$label_vendor_lead_code = 'Vendor ID';
$label_gender = 'Gender';
$label_phone_number = 'Telefono';
$label_phone_code = 'Prefisso';
$label_alt_phone = 'Num. Alternativo';
$label_security_phrase = 'Mostra';
$label_email = 'Email';
$label_comments = 'Note';
$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if (strlen($row[0])>0) {$label_title = $row[0];}
if (strlen($row[1])>0) {$label_first_name = $row[1];}
if (strlen($row[2])>0) {$label_middle_initial = $row[2];}
if (strlen($row[3])>0) {$label_last_name = $row[3];}
if (strlen($row[4])>0) {$label_address1 = $row[4];}
if (strlen($row[5])>0) {$label_address2 = $row[5];}
if (strlen($row[6])>0) {$label_address3 = $row[6];}
if (strlen($row[7])>0) {$label_city = $row[7];}
if (strlen($row[8])>0) {$label_state = $row[8];}
if (strlen($row[9])>0) {$label_province = $row[9];}
if (strlen($row[10])>0) {$label_postal_code = $row[10];}
if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];}
if (strlen($row[12])>0) {$label_gender = $row[12];}
if (strlen($row[13])>0) {$label_phone_number = $row[13];}
if (strlen($row[14])>0) {$label_phone_code = $row[14];}
if (strlen($row[15])>0) {$label_alt_phone = $row[15];}
if (strlen($row[16])>0) {$label_security_phrase = $row[16];}
if (strlen($row[17])>0) {$label_email = $row[17];}
if (strlen($row[18])>0) {$label_comments = $row[18];}
### END find any custom field labels ###
echo "<CENTER>\n";
echo "<TABLE CELLPADDING=0 CELLSPACING=1 Border=0 WIDTH=500>";
$stmt="select status,vendor_lead_code,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='$lead_id'limit 1;";
$stmt="select status,vendor_lead_code,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id from vicidial_list where lead_id='$lead_id'limit 1;";
$rslt=mysql_query($stmt, $link);
$info_to_print = mysql_num_rows($rslt);
if ($format=='debug') {echo "|$out_logs_to_print|$stmt|";}
@@ -7186,33 +7292,34 @@ if ($ACTION == 'LEADINFOview')
{
$row=mysql_fetch_row($rslt);
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Stato: &nbsp; </td><td ALIGN=left><font size=2>$row[0]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Vendor ID: &nbsp; </td><td ALIGN=left><font size=2>$row[1]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_vendor_lead_code: &nbsp; </td><td ALIGN=left><font size=2>$row[1]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>List ID: &nbsp; </td><td ALIGN=left><font size=2>$row[2]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Timezone: &nbsp; </td><td ALIGN=left><font size=2>$row[3]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Chiamato SInce Cognome Reset: &nbsp; </td><td ALIGN=left><font size=2>$row[4]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Telefono Code: &nbsp; </td><td ALIGN=left><font size=2>$row[5]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Telefono Number: &nbsp; </td><td ALIGN=left><font size=2>$row[6] - &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG',$row[5], $row[6]);return false;\">DIAL</A></td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Titolo: &nbsp; </td><td ALIGN=left><font size=2>$row[7]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Nome Name: &nbsp; </td><td ALIGN=left><font size=2>$row[8]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>MI: &nbsp; </td><td ALIGN=left><font size=2>$row[9]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Cognome Name: &nbsp; </td><td ALIGN=left><font size=2>$row[10]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Indirizzo 1: &nbsp; </td><td ALIGN=left><font size=2>$row[11]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Indirizzo 2: &nbsp; </td><td ALIGN=left><font size=2>$row[12]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Indirizzo 3: &nbsp; </td><td ALIGN=left><font size=2>$row[13]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Città: &nbsp; </td><td ALIGN=left><font size=2>$row[14]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Stato: &nbsp; </td><td ALIGN=left><font size=2>$row[15]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Provincia: &nbsp; </td><td ALIGN=left><font size=2>$row[16]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Postal Code: &nbsp; </td><td ALIGN=left><font size=2>$row[17]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Chiamato Since Cognome Reset: &nbsp; </td><td ALIGN=left><font size=2>$row[4]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_phone_code: &nbsp; </td><td ALIGN=left><font size=2>$row[5]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_phone_number: &nbsp; </td><td ALIGN=left><font size=2>$row[6] - &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG',$row[5], $row[6]);return false;\">DIAL</A></td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_title: &nbsp; </td><td ALIGN=left><font size=2>$row[7]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_first_name: &nbsp; </td><td ALIGN=left><font size=2>$row[8]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_middle_initial: &nbsp; </td><td ALIGN=left><font size=2>$row[9]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_last_name: &nbsp; </td><td ALIGN=left><font size=2>$row[10]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_address1: &nbsp; </td><td ALIGN=left><font size=2>$row[11]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_address2: &nbsp; </td><td ALIGN=left><font size=2>$row[12]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_address3: &nbsp; </td><td ALIGN=left><font size=2>$row[13]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_city: &nbsp; </td><td ALIGN=left><font size=2>$row[14]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_state: &nbsp; </td><td ALIGN=left><font size=2>$row[15]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_province: &nbsp; </td><td ALIGN=left><font size=2>$row[16]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_postal_code: &nbsp; </td><td ALIGN=left><font size=2>$row[17]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Country: &nbsp; </td><td ALIGN=left><font size=2>$row[18]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Sesso: &nbsp; </td><td ALIGN=left><font size=2>$row[19]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Num. Alternativo: &nbsp; </td><td ALIGN=left><font size=2>$row[20] - &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG',$row[5], $row[20]);return false;\">DIAL</A></td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Email: &nbsp; </td><td ALIGN=left><font size=2>$row[21]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Mostra: &nbsp; </td><td ALIGN=left><font size=2>$row[22]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Note:&nbsp; </td><td ALIGN=left><font size=2>$row[23]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_gender: &nbsp; </td><td ALIGN=left><font size=2>$row[19]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_alt_phone: &nbsp; </td><td ALIGN=left><font size=2>$row[20] - &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG',$row[5], $row[20]);return false;\">DIAL</A></td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_email: &nbsp; </td><td ALIGN=left><font size=2>$row[21]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_security_phrase: &nbsp; </td><td ALIGN=left><font size=2>$row[22]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_comments: &nbsp; </td><td ALIGN=left><font size=2>$row[23]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Chiamato Count: &nbsp; </td><td ALIGN=left><font size=2>$row[24]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Cognome Local Call Time: &nbsp; </td><td ALIGN=left><font size=2>$row[25]</td></tr>";
# echo "<tr bgcolor=white><td ALIGN=right><font size=2>Rank: &nbsp; </td><td ALIGN=left><font size=2>$row[26]</td></tr>";
# echo "<tr bgcolor=white><td ALIGN=right><font size=2>Owner: &nbsp; </td><td ALIGN=left><font size=2>$row[27]</td></tr>";
# echo "<tr bgcolor=white><td ALIGN=right><font size=2>Entry List ID: &nbsp; </td><td ALIGN=left><font size=2>$row[28]</td></tr>";
}
echo "</TABLE>";
@@ -7391,6 +7498,21 @@ if ($ACTION == 'DiaLableLeaDsCounT')
}
################################################################################
### Clear_API_Field - clears a single vicidial_live_agents field
################################################################################
if ($ACTION == 'Clear_API_Field')
{
$stmt="UPDATE vicidial_live_agents SET $comments='' where user='$user';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
echo "DONE: $comments";
}
if ($format=='debug')
@@ -0,0 +1,359 @@
<?php
# vdc_form_display.php
#
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed display the contents of the FORM tab in the agent
# interface, as well as take submission of the form submission when the agent
# dispositions the call
#
# CHANGELOG:
# 100630-1119 - First build of script
# 100703-1124 - Added submit_button,admin_submit fields, which will log to admin log
# 100712-2322 - Added code to log vicidial_list.entry_list_id field if data altered
#
$version = '2.4-3';
$build = '100712-2322';
require("dbconnect.php");
require("functions.php");
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];}
elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];}
if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];}
elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];}
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
if (isset($_GET["submit_button"])) {$submit_button=$_GET["submit_button"];}
elseif (isset($_POST["submit_button"])) {$submit_button=$_POST["submit_button"];}
if (isset($_GET["admin_submit"])) {$admin_submit=$_GET["admin_submit"];}
elseif (isset($_POST["admin_submit"])) {$admin_submit=$_POST["admin_submit"];}
if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];}
elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
$txt = '.txt';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$CIDdate = date("mdHis");
$ENTRYdate = date("YmdHis");
$MT[0]='';
$agents='@agents';
$script_height = ($script_height - 20);
if (strlen($bgcolor) < 6) {$bgcolor='FFFFFF';}
$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|';
$IFRAME=0;
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,custom_fields_enabled FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$timeclock_end_of_day = $row[1];
$agentonly_callback_campaign_lock = $row[2];
$custom_fields_enabled = $row[3];
}
##### END SETTINGS LOOKUP #####
###########################################
if ($non_latin < 1)
{
$user=ereg_replace("[^-_0-9a-zA-Z]","",$user);
$pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass);
$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec);
$phone_code = ereg_replace("[^0-9]","",$phone_code);
$phone_number = ereg_replace("[^0-9]","",$phone_number);
}
else
{
$user = ereg_replace("'|\"|\\\\|;","",$user);
$pass = ereg_replace("'|\"|\\\\|;","",$pass);
}
# default optional vars if not set
if (!isset($format)) {$format="text";}
if ($format == 'debug') {$DB=1;}
if (!isset($ACTION)) {$ACTION="refresh";}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
if ($DB) {echo "|$stmt|\n";}
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and modify_leads='1';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$VUmodify=$row[0];
$stmt="SELECT count(*) from vicidial_live_agents where user='$user';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$LVAactive=$row[0];
if ($custom_fields_enabled < 1)
{
echo "Custom Fields Disabled: |$custom_fields_enabled|\n";
echo "<form action=./vdc_form_display.php method=POST name=form_custom_fields id=form_custom_fields>\n";
echo "<input type=hidden name=user id=user value=\"$user\">\n";
echo "</form>\n";
exit;
}
if ( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) or ( ($LVAactive < 1) and ($VUmodify < 1) ) )
{
echo "Invalid Username/Password: |$user|$pass|\n";
echo "<form action=./vdc_form_display.php method=POST name=form_custom_fields id=form_custom_fields>\n";
echo "<input type=hidden name=user id=user value=\"$user\">\n";
echo "</form>\n";
exit;
}
else
{
# do nothing for now
}
### BEGIN parse submission of the custom fields form ###
if ($stage=='SUBMIT')
{
$update_sent=0;
$CFoutput='';
$stmt="SHOW TABLES LIKE \"custom_$list_id\";";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06001',$user,$server_ip,$session_name,$one_mysql_log);}
$tablecount_to_print = mysql_num_rows($rslt);
if ($tablecount_to_print > 0)
{
$update_SQL='';
$VL_update_SQL='';
$stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06003',$user,$server_ip,$session_name,$one_mysql_log);}
$fields_to_print = mysql_num_rows($rslt);
$fields_list='';
$o=0;
while ($fields_to_print > $o)
{
$new_field_value='';
$form_field_value='';
$rowx=mysql_fetch_row($rslt);
$A_field_id[$o] = $rowx[0];
$A_field_label[$o] = $rowx[1];
$A_field_name[$o] = $rowx[2];
$A_field_type[$o] = $rowx[6];
$A_field_size[$o] = $rowx[8];
$A_field_max[$o] = $rowx[9];
$A_field_required[$o] = $rowx[12];
$A_field_value[$o] = '';
$field_name_id = $A_field_label[$o];
if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];}
elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];}
if ( ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='CHECKBOX') or ($A_field_type[$o]=='RADIO') )
{
$k=0;
$multi_count = count($form_field_value);
$multi_array = $form_field_value;
while ($k < $multi_count)
{
$new_field_value .= "$multi_array[$k],";
$k++;
}
$form_field_value = preg_replace("/,$/","",$new_field_value);
}
if ($A_field_type[$o]=='TIME')
{
if (isset($_GET["MINUTE_$field_name_id"])) {$form_field_valueM=$_GET["MINUTE_$field_name_id"];}
elseif (isset($_POST["MINUTE_$field_name_id"])) {$form_field_valueM=$_POST["MINUTE_$field_name_id"];}
if (isset($_GET["HOUR_$field_name_id"])) {$form_field_valueH=$_GET["HOUR_$field_name_id"];}
elseif (isset($_POST["HOUR_$field_name_id"])) {$form_field_valueH=$_POST["HOUR_$field_name_id"];}
$form_field_value = "$form_field_valueH:$form_field_valueM:00";
}
$A_field_value[$o] = $form_field_value;
if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') )
{
$A_field_value[$o]='----IGNORE----';
}
else
{
if (preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields))
{
$VL_update_SQL .= "$A_field_label[$o]='$A_field_value[$o]',";
}
else
{
$update_SQL .= "$A_field_label[$o]='$A_field_value[$o]',";
}
$SUBMIT_output .= "<b>$A_field_name[$o]:</b> $A_field_value[$o]<BR>";
}
$o++;
}
$custom_update_count=0;
if (strlen($update_SQL)>3)
{
$custom_record_lead_count=0;
$stmt="SELECT count(*) from custom_$list_id where lead_id='$lead_id';";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06004',$user,$server_ip,$session_name,$one_mysql_log);}
$fieldleadcount_to_print = mysql_num_rows($rslt);
if ($fieldleadcount_to_print > 0)
{
$rowx=mysql_fetch_row($rslt);
$custom_record_lead_count = $rowx[0];
}
$update_SQL = preg_replace("/,$/","",$update_SQL);
$custom_table_update_SQL = "INSERT INTO custom_$list_id SET lead_id='$lead_id',$update_SQL;";
if ($custom_record_lead_count > 0)
{$custom_table_update_SQL = "UPDATE custom_$list_id SET $update_SQL where lead_id='$lead_id';";}
$rslt=mysql_query($custom_table_update_SQL, $link);
$custom_update_count = mysql_affected_rows($link);
if ($DB) {echo "$custom_update_count|$custom_table_update_SQL\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$update_sent++;
}
if (strlen($VL_update_SQL)>3)
{
$custom_update_vl_SQL='';
if ($custom_update_count > 0)
{$custom_update_vl_SQL = "entry_list_id='$list_id',";}
$VL_update_SQL = preg_replace("/,$/","",$VL_update_SQL);
$list_table_update_SQL = "UPDATE vicidial_list SET $custom_update_vl_SQL $VL_update_SQL where lead_id='$lead_id';";
$rslt=mysql_query($list_table_update_SQL, $link);
$list_update_count = mysql_affected_rows($link);
if ($DB) {echo "$list_update_count|$list_table_update_SQL\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$update_sent++;
}
else
{
if ($custom_update_count > 0)
{
$list_table_update_SQL = "UPDATE vicidial_list SET entry_list_id='$list_id' where lead_id='$lead_id';";
$rslt=mysql_query($list_table_update_SQL, $link);
$list_update_count = mysql_affected_rows($link);
if ($DB) {echo "$list_update_count|$list_table_update_SQL\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
}
}
if ( ($admin_submit=='YES') and ($update_sent > 0) )
{
### LOG INSERTION Admin Log Table ###
$ip = getenv("REMOTE_ADDR");
$SQL_log = "$list_table_update_SQL|$custom_table_update_SQL|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='LEADS', event_type='MODIFY', record_id='$lead_id', event_code='ADMIN MODIFY CUSTOM LEAD', event_sql=\"$SQL_log\", event_notes='$custom_update_count|$list_update_count';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{$CFoutput .= "ERROR: no custom list fields table\n";}
echo "Custom Form Output:\n<BR>\n";
echo "$SUBMIT_output";
echo "<form action=./vdc_form_display.php method=POST name=form_custom_fields id=form_custom_fields>\n";
echo "<input type=hidden name=user id=user value=\"$user\">\n";
echo "</form>\n";
}
### END parse submission of the custom fields form ###
else
{
echo "<html>\n";
echo "<head>\n";
echo "<!-- VERSION: $version BUILD: $build USER: $user server_ip: $server_ip-->\n";
echo "<title>ViciDial Form Display Script";
echo "</title>\n";
echo "<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
echo " <link rel=\"stylesheet\" href=\"calendar.css\">\n";
echo " <script language=\"Javascript\">\n";
echo " function open_help(taskspan,taskhelp) \n";
echo " {\n";
echo " document.getElementById(\"P_\" + taskspan).innerHTML = \" &nbsp; <a href=\\\"javascript:close_help('\" + taskspan + \"','\" + taskhelp + \"');\\\">help-</a><BR> &nbsp; \";\n";
echo " document.getElementById(taskspan).innerHTML = \"<B>\" + taskhelp + \"</B>\";\n";
echo " document.getElementById(taskspan).style.background = \"#FFFF99\";\n";
echo " }\n";
echo " function close_help(taskspan,taskhelp) \n";
echo " {\n";
echo " document.getElementById(\"P_\" + taskspan).innerHTML = \"\";\n";
echo " document.getElementById(taskspan).innerHTML = \" &nbsp; <a href=\\\"javascript:open_help('\" + taskspan + \"','\" + taskhelp + \"');\\\">help+</a>\";\n";
echo " document.getElementById(taskspan).style.background = \"white\";\n";
echo " }\n";
echo " </script>\n";
echo " <META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo "</head>\n";
echo '<BODY BGCOLOR="#' . $bgcolor . '" marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>';
echo "\n";
echo "<form action=./vdc_form_display.php method=POST name=form_custom_fields id=form_custom_fields>\n";
echo "<input type=hidden name=lead_id id=lead_id value=\"$lead_id\">\n";
echo "<input type=hidden name=list_id id=list_id value=\"$list_id\">\n";
echo "<input type=hidden name=user id=user value=\"$user\">\n";
echo "<input type=hidden name=pass id=pass value=\"$pass\">\n";
echo "\n";
require("functions.php");
$CFoutput = custom_list_fields_values($lead_id,$list_id,$uniqueid,$user);
echo "$CFoutput";
if ($submit_button=='YES')
{
echo "<input type=hidden name=admin_submit id=admin_submit value=\"YES\">\n";
echo "<BR><BR><input type=submit name=VCformSubmit id=VCformSubmit value=submit>\n";
}
echo "</form></center><BR><BR>\n";
echo "</BODY></HTML>\n";
}
exit;
?>
@@ -0,0 +1,648 @@
<?php
# vdc_script_notes.php
#
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed open in the SCRIPT tab in the agent interface through
# an IFRAME. It will create a new record for every SUBMIT
#
# Example of a ViciDial agent SCRIPT using this script:
# <iframe src="./vdc_script_notes.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&pass=--A--pass--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&rank=--A--rank--B--&owner=--A--owner--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--" style="background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="--A--script_width--B--" height="--A--script_height--B--" STYLE="z-index:17"> </iframe>
#
# CHANGELOG:
# 100215-0744 - First build of script
# 100622-2230 - Added field labels
#
$version = '2.4-2';
$build = '100622-2230';
require("dbconnect.php");
if (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
elseif (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
if (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];}
elseif (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];}
$vendor_lead_code = $vendor_id;
if (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
elseif (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
if (isset($_POST["gmt_offset_now"])) {$gmt_offset_now=$_POST["gmt_offset_now"];}
elseif (isset($_GET["gmt_offset_now"])) {$gmt_offset_now=$_GET["gmt_offset_now"];}
if (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];}
elseif (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];}
if (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];}
elseif (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];}
if (isset($_POST["title"])) {$title=$_POST["title"];}
elseif (isset($_GET["title"])) {$title=$_GET["title"];}
if (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];}
elseif (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];}
if (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];}
elseif (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];}
if (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];}
elseif (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];}
if (isset($_POST["address1"])) {$address1=$_POST["address1"];}
elseif (isset($_GET["address1"])) {$address1=$_GET["address1"];}
if (isset($_POST["address2"])) {$address2=$_POST["address2"];}
elseif (isset($_GET["address2"])) {$address2=$_GET["address2"];}
if (isset($_POST["address3"])) {$address3=$_POST["address3"];}
elseif (isset($_GET["address3"])) {$address3=$_GET["address3"];}
if (isset($_POST["city"])) {$city=$_POST["city"];}
elseif (isset($_GET["city"])) {$city=$_GET["city"];}
if (isset($_POST["state"])) {$state=$_POST["state"];}
elseif (isset($_GET["state"])) {$state=$_GET["state"];}
if (isset($_POST["province"])) {$province=$_POST["province"];}
elseif (isset($_GET["province"])) {$province=$_GET["province"];}
if (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];}
elseif (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];}
if (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];}
elseif (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];}
if (isset($_POST["gender"])) {$gender=$_POST["gender"];}
elseif (isset($_GET["gender"])) {$gender=$_GET["gender"];}
if (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];}
elseif (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];}
if (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];}
elseif (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];}
if (isset($_POST["email"])) {$email=$_POST["email"];}
elseif (isset($_GET["email"])) {$email=$_GET["email"];}
if (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];}
elseif (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];}
if (isset($_POST["comments"])) {$comments=$_POST["comments"];}
elseif (isset($_GET["comments"])) {$comments=$_GET["comments"];}
if (isset($_POST["user"])) {$user=$_POST["user"];}
elseif (isset($_GET["user"])) {$user=$_GET["user"];}
if (isset($_POST["pass"])) {$pass=$_POST["pass"];}
elseif (isset($_GET["pass"])) {$pass=$_GET["pass"];}
if (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];}
elseif (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];}
if (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];}
elseif (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];}
if (isset($_POST["original_phone_login"])) {$original_phone_login=$_POST["original_phone_login"];}
elseif (isset($_GET["original_phone_login"])) {$original_phone_login=$_GET["original_phone_login"];}
if (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];}
elseif (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];}
if (isset($_POST["fronter"])) {$fronter=$_POST["fronter"];}
elseif (isset($_GET["fronter"])) {$fronter=$_GET["fronter"];}
if (isset($_POST["closer"])) {$closer=$_POST["closer"];}
elseif (isset($_GET["closer"])) {$closer=$_GET["closer"];}
if (isset($_POST["group"])) {$group=$_POST["group"];}
elseif (isset($_GET["group"])) {$group=$_GET["group"];}
if (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];}
elseif (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];}
if (isset($_POST["SQLdate"])) {$SQLdate=$_POST["SQLdate"];}
elseif (isset($_GET["SQLdate"])) {$SQLdate=$_GET["SQLdate"];}
if (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];}
elseif (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];}
if (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];}
elseif (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];}
if (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];}
elseif (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];}
if (isset($_POST["customer_server_ip"])) {$customer_server_ip=$_POST["customer_server_ip"];}
elseif (isset($_GET["customer_server_ip"])) {$customer_server_ip=$_GET["customer_server_ip"];}
if (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
elseif (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
if (isset($_POST["SIPexten"])) {$SIPexten=$_POST["SIPexten"];}
elseif (isset($_GET["SIPexten"])) {$SIPexten=$_GET["SIPexten"];}
if (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];}
elseif (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];}
if (isset($_POST["phone"])) {$phone=$_POST["phone"];}
elseif (isset($_GET["phone"])) {$phone=$_GET["phone"];}
if (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];}
elseif (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];}
if (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];}
elseif (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];}
if (isset($_POST["dialed_number"])) {$dialed_number=$_POST["dialed_number"];}
elseif (isset($_GET["dialed_number"])) {$dialed_number=$_GET["dialed_number"];}
if (isset($_POST["dialed_label"])) {$dialed_label=$_POST["dialed_label"];}
elseif (isset($_GET["dialed_label"])) {$dialed_label=$_GET["dialed_label"];}
if (isset($_POST["source_id"])) {$source_id=$_POST["source_id"];}
elseif (isset($_GET["source_id"])) {$source_id=$_GET["source_id"];}
if (isset($_POST["rank"])) {$rank=$_POST["rank"];}
elseif (isset($_GET["rank"])) {$rank=$_GET["rank"];}
if (isset($_POST["owner"])) {$owner=$_POST["owner"];}
elseif (isset($_GET["owner"])) {$owner=$_GET["owner"];}
if (isset($_POST["camp_script"])) {$camp_script=$_POST["camp_script"];}
elseif (isset($_GET["camp_script"])) {$camp_script=$_GET["camp_script"];}
if (isset($_POST["in_script"])) {$in_script=$_POST["in_script"];}
elseif (isset($_GET["in_script"])) {$in_script=$_GET["in_script"];}
if (isset($_POST["script_width"])) {$script_width=$_POST["script_width"];}
elseif (isset($_GET["script_width"])) {$script_width=$_GET["script_width"];}
if (isset($_POST["script_height"])) {$script_height=$_POST["script_height"];}
elseif (isset($_GET["script_height"])) {$script_height=$_GET["script_height"];}
if (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];}
elseif (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];}
if (isset($_POST["recording_filename"])) {$recording_filename=$_POST["recording_filename"];}
elseif (isset($_GET["recording_filename"])) {$recording_filename=$_GET["recording_filename"];}
if (isset($_POST["recording_id"])) {$recording_id=$_POST["recording_id"];}
elseif (isset($_GET["recording_id"])) {$recording_id=$_GET["recording_id"];}
if (isset($_POST["user_custom_one"])) {$user_custom_one=$_POST["user_custom_one"];}
elseif (isset($_GET["user_custom_one"])) {$user_custom_one=$_GET["user_custom_one"];}
if (isset($_POST["user_custom_two"])) {$user_custom_two=$_POST["user_custom_two"];}
elseif (isset($_GET["user_custom_two"])) {$user_custom_two=$_GET["user_custom_two"];}
if (isset($_POST["user_custom_three"])) {$user_custom_three=$_POST["user_custom_three"];}
elseif (isset($_GET["user_custom_three"])) {$user_custom_three=$_GET["user_custom_three"];}
if (isset($_POST["user_custom_four"])) {$user_custom_four=$_POST["user_custom_four"];}
elseif (isset($_GET["user_custom_four"])) {$user_custom_four=$_GET["user_custom_four"];}
if (isset($_POST["user_custom_five"])) {$user_custom_five=$_POST["user_custom_five"];}
elseif (isset($_GET["user_custom_five"])) {$user_custom_five=$_GET["user_custom_five"];}
if (isset($_POST["preset_number_a"])) {$preset_number_a=$_POST["preset_number_a"];}
elseif (isset($_GET["preset_number_a"])) {$preset_number_a=$_GET["preset_number_a"];}
if (isset($_POST["preset_number_b"])) {$preset_number_b=$_POST["preset_number_b"];}
elseif (isset($_GET["preset_number_b"])) {$preset_number_b=$_GET["preset_number_b"];}
if (isset($_POST["preset_number_c"])) {$preset_number_c=$_POST["preset_number_c"];}
elseif (isset($_GET["preset_number_c"])) {$preset_number_c=$_GET["preset_number_c"];}
if (isset($_POST["preset_number_d"])) {$preset_number_d=$_POST["preset_number_d"];}
elseif (isset($_GET["preset_number_d"])) {$preset_number_d=$_GET["preset_number_d"];}
if (isset($_POST["preset_number_e"])) {$preset_number_e=$_POST["preset_number_e"];}
elseif (isset($_GET["preset_number_e"])) {$preset_number_e=$_GET["preset_number_e"];}
if (isset($_POST["preset_number_f"])) {$preset_number_f=$_POST["preset_number_f"];}
elseif (isset($_GET["preset_number_f"])) {$preset_number_f=$_GET["preset_number_f"];}
if (isset($_POST["preset_dtmf_a"])) {$preset_dtmf_a=$_POST["preset_dtmf_a"];}
elseif (isset($_GET["preset_dtmf_a"])) {$preset_dtmf_a=$_GET["preset_dtmf_a"];}
if (isset($_POST["preset_dtmf_b"])) {$preset_dtmf_b=$_POST["preset_dtmf_b"];}
elseif (isset($_GET["preset_dtmf_b"])) {$preset_dtmf_b=$_GET["preset_dtmf_b"];}
if (isset($_POST["ScrollDIV"])) {$ScrollDIV=$_POST["ScrollDIV"];}
elseif (isset($_GET["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];}
if (isset($_POST["ignore_list_script"])) {$ignore_list_script=$_POST["ignore_list_script"];}
elseif (isset($_GET["ignore_list_script"])) {$ignore_list_script=$_GET["ignore_list_script"];}
if (isset($_POST["DB"])) {$DB=$_POST["DB"];}
elseif (isset($_GET["DB"])) {$DB=$_GET["DB"];}
if (isset($_POST["process"])) {$process=$_POST["process"];}
elseif (isset($_GET["process"])) {$process=$_GET["process"];}
if (isset($_POST["vicidial_id"])) {$vicidial_id=$_POST["vicidial_id"];}
elseif (isset($_GET["vicidial_id"])) {$vicidial_id=$_GET["vicidial_id"];}
if (isset($_POST["call_date"])) {$call_date=$_POST["call_date"];}
elseif (isset($_GET["call_date"])) {$call_date=$_GET["call_date"];}
if (isset($_POST["order_id"])) {$order_id=$_POST["order_id"];}
elseif (isset($_GET["order_id"])) {$order_id=$_GET["order_id"];}
if (isset($_POST["appointment_date"])) {$appointment_date=$_POST["appointment_date"];}
elseif (isset($_GET["appointment_date"])) {$appointment_date=$_GET["appointment_date"];}
if (isset($_POST["appointment_time"])) {$appointment_time=$_POST["appointment_time"];}
elseif (isset($_GET["appointment_time"])) {$appointment_time=$_GET["appointment_time"];}
if (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];}
elseif (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];}
if (isset($_POST["notesid"])) {$notesid=$_POST["notesid"];}
elseif (isset($_GET["notesid"])) {$notesid=$_GET["notesid"];}
if ($notesid < 100)
{$notesid=0;}
if (strlen($vicidial_id) < 1)
{$vicidial_id = $uniqueid;}
if (strlen($appointment_time) < 1)
{$appointment_time = '12:00:00';}
$appointment_timeARRAY = explode(":",$appointment_time);
$appointment_hour = $appointment_timeARRAY[0];
$appointment_min = $appointment_timeARRAY[1];
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
$txt = '.txt';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$CIDdate = date("mdHis");
$ENTRYdate = date("YmdHis");
$MT[0]='';
$agents='@agents';
if (strlen($call_date) < 1)
{$call_date = $NOW_TIME;}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$timeclock_end_of_day = $row[1];
$agentonly_callback_campaign_lock = $row[2];
}
##### END SETTINGS LOOKUP #####
###########################################
if ($non_latin < 1)
{
$user=ereg_replace("[^-_0-9a-zA-Z]","",$user);
$pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass);
$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec);
$phone_code = ereg_replace("[^0-9]","",$phone_code);
$phone_number = ereg_replace("[^0-9]","",$phone_number);
}
else
{
$user = ereg_replace("'|\"|\\\\|;","",$user);
$pass = ereg_replace("'|\"|\\\\|;","",$pass);
}
if ($DB > 0)
{
echo "<BR>$lead_id|$entry_date|$modify_date|$status|$user|$vendor_lead_code|$source_id|$list_id|$gmt_offset_now|$called_since_last_reset|$phone_code|$phone_number|$title|$first_name|$middle_initial|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country_code|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$comments|$called_count|$last_local_call_time|$rank|$owner|\n<BR>";
}
### BEGIN find any custom field labels ###
$label_title = 'Titolo';
$label_first_name = 'Nome';
$label_middle_initial = 'MI';
$label_last_name = 'Cognome';
$label_address1 = 'Indirizzo1';
$label_address2 = 'Indirizzo2';
$label_address3 = 'Indirizzo3';
$label_city = 'Città';
$label_state = 'Stato';
$label_province = 'Provincia';
$label_postal_code = 'CAP';
$label_vendor_lead_code = 'Vendor ID';
$label_gender = 'Gender';
$label_phone_number = 'Telefono';
$label_phone_code = 'Prefisso';
$label_alt_phone = 'Num. Alternativo';
$label_security_phrase = 'Mostra';
$label_email = 'Email';
$label_comments = 'Note';
$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if (strlen($row[0])>0) {$label_title = $row[0];}
if (strlen($row[1])>0) {$label_first_name = $row[1];}
if (strlen($row[2])>0) {$label_middle_initial = $row[2];}
if (strlen($row[3])>0) {$label_last_name = $row[3];}
if (strlen($row[4])>0) {$label_address1 = $row[4];}
if (strlen($row[5])>0) {$label_address2 = $row[5];}
if (strlen($row[6])>0) {$label_address3 = $row[6];}
if (strlen($row[7])>0) {$label_city = $row[7];}
if (strlen($row[8])>0) {$label_state = $row[8];}
if (strlen($row[9])>0) {$label_province = $row[9];}
if (strlen($row[10])>0) {$label_postal_code = $row[10];}
if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];}
if (strlen($row[12])>0) {$label_gender = $row[12];}
if (strlen($row[13])>0) {$label_phone_number = $row[13];}
if (strlen($row[14])>0) {$label_phone_code = $row[14];}
if (strlen($row[15])>0) {$label_alt_phone = $row[15];}
if (strlen($row[16])>0) {$label_security_phrase = $row[16];}
if (strlen($row[17])>0) {$label_email = $row[17];}
if (strlen($row[18])>0) {$label_comments = $row[18];}
### END find any custom field labels ###
# default optional vars if not set
if (!isset($format)) {$format="text";}
if ($format == 'debug') {$DB=1;}
if (!isset($ACTION)) {$ACTION="refresh";}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
if ($DB) {echo "|$stmt|\n";}
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
{
echo "Username/Password non validi: |$user|$pass|\n";
exit;
}
else
{
# do nothing for now
}
echo "<HTML>\n";
echo "<head>\n";
echo "<!-- VERSIONE: $version BUILD: $build USER: $user server_ip: $server_ip-->\n";
echo "<title>ViciDial Note";
echo "</title>\n";
echo "<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
echo "<link rel=\"stylesheet\" href=\"calendar.css\">\n";
?>
<?php
echo "</head>\n";
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
if ($process > 0)
{
#Update vicidial_list record
$stmt="UPDATE vicidial_list SET vendor_lead_code='$vendor_lead_code',title='$title',first_name='$first_name',middle_initial='$middle_initial',last_name='$last_name',address1='$address1',address2='$address2',address3='$address3',city='$city',state='$state',province='$province',postal_code='$postal_code',phone_code='$phone_code',phone_number='$phone_number',gender='$gender',date_of_birth='$date_of_birth',alt_phone='$alt_phone',email='$email',security_phrase='$security_phrase',comments='$comments',rank='$rank',owner='$owner' where lead_id='$lead_id';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
#Update the agent screen with new data
$stmt="UPDATE vicidial_live_agents set external_update_fields='1',external_update_fields_data='vendor_lead_code,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,phone_code,phone_number,gender,date_of_birth,alt_phone,email,security_phrase,comments,rank,owner' where user='$user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
if ($notesid < 100)
{
# Insert into vicidial_call_notes
$stmt="INSERT INTO vicidial_call_notes set lead_id='$lead_id',vicidial_id='$vicidial_id',call_date='$call_date',order_id='$order_id',appointment_date='$appointment_date',appointment_time='$appointment_time',call_notes='$call_notes';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
$notesid = mysql_insert_id($link);
}
else
{
# update vicidial_call_notes record
$stmt="UPDATE vicidial_call_notes set order_id='$order_id',appointment_date='$appointment_date',appointment_time='$appointment_time',call_notes='$call_notes' where notesid='$notesid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
}
echo "<BR><b>Data Changes Accepted</b><BR><BR>";
}
$URLarray = explode("?", $PHP_SELF);
$URLsubmit = $URLarray[0];
?>
<TABLE Border=0 CELLPADDING=0 CELLSPACING=2 WIDTH=450>
<TR><TD COLSPAN=2 ALIGN=CENTER>
<FORM METHOD=POST NAME=vsn ID=vsn ACTION="<?php echo $URLsubmit ?>">
<input type=hidden name=DB id=DB value=<?php echo $DB ?>>
<input type=hidden name=process id=process value=1>
<input type=hidden name=lead_id id=lead_id value="<?php echo $lead_id ?>">
<input type=hidden name=user id=user value="<?php echo $user ?>">
<input type=hidden name=pass id=user value="<?php echo $pass ?>">
<input type=hidden name=notesid id=notesid value="<?php echo $notesid ?>">
<input type=hidden name=vendor_id id=vendor_id value="<?php echo $vendor_id ?>">
<input type=hidden name=title id=title value="<?php echo $title ?>">
<input type=hidden name=middle_initial id=middle_initial value="<?php echo $middle_initial ?>">
<input type=hidden name=province id=province value="<?php echo $middle_initial ?>">
<input type=hidden name=phone_code id=phone_code value="<?php echo $phone_code ?>">
<input type=hidden name=gender id=gender value="<?php echo $gender ?>">
<input type=hidden name=date_of_birth id=date_of_birth value="<?php echo $date_of_birth ?>">
<input type=hidden name=alt_phone id=alt_phone value="<?php echo $alt_phone ?>">
<input type=hidden name=email id=email value="<?php echo $email ?>">
<input type=hidden name=security_phrase id=security_phrase value="<?php echo $security_phrase ?>">
<input type=hidden name=comments id=comments value="<?php echo $comments ?>">
<input type=hidden name=rank id=rank value="<?php echo $rank ?>">
<input type=hidden name=owner id=owner value="<?php echo $owner ?>">
</TD></TR>
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Vendor ID: </TD><TD ALIGN=LEFT><input type=text name=vendor_id id=vendor_id size=20 maxlength=20 value="<?php echo $vendor_id ?>"></TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Source ID: </TD><TD ALIGN=LEFT>$source_id<input type=hidden name=source_id id=source_id value="<?php echo $source_id ?>"></TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Titolo: </TD><TD ALIGN=LEFT><input type=text name=title id=title size=5 maxlength=4 value="<?php echo $title ?>"></TD>
</TR> -->
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_first_name ?>: </TD><TD ALIGN=LEFT><input type=text name=first_name id=first_name size=30 maxlength=30 value="<?php echo $first_name ?>"> *</TD>
</TR>
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Middle Initial: </TD><TD ALIGN=LEFT><input type=text name=middle_initial id=middle_initial size=2 maxlength=1 value="<?php echo $middle_initial ?>"></TD>
</TR> -->
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_last_name ?>: </TD><TD ALIGN=LEFT><input type=text name=last_name id=last_name size=30 maxlength=30 value="<?php echo $last_name ?>"> *</TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_address1 ?>: </TD><TD ALIGN=LEFT><input type=text name=address1 id=address1 size=30 maxlength=100 value="<?php echo $address1 ?>"> *</TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_address2 ?>: </TD><TD ALIGN=LEFT><input type=text name=address2 id=address2 size=30 maxlength=100 value="<?php echo $address2 ?>"></TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_address3 ?>: </TD><TD ALIGN=LEFT><input type=text name=address3 id=address3 size=30 maxlength=100 value="<?php echo $address3 ?>"></TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_city ?>: </TD><TD ALIGN=LEFT><input type=text name=city id=city size=30 maxlength=50 value="<?php echo $city ?>"> *</TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_state ?>: </TD><TD ALIGN=LEFT>
<SELECT name="state" id=state>
<OPTION value="<?php echo $state ?>" selected><?php echo $state ?></OPTION>
<OPTGROUP label="United Statos">
<OPTION value="AL">Alabama</OPTION>
<OPTION value="AK">Alaska</OPTION>
<OPTION value="AZ">Arizona</OPTION>
<OPTION value="AR">Arkansas</OPTION>
<OPTION value="CA">California</OPTION>
<OPTION value="CO">Colorado</OPTION>
<OPTION value="CT">Connecticut</OPTION>
<OPTION value="DE">Delaware</OPTION>
<OPTION value="FL">Florida</OPTION>
<OPTION value="GA">Georgia</OPTION>
<OPTION value="HI">Hawaii</OPTION>
<OPTION value="ID">Idaho</OPTION>
<OPTION value="IL">Illinois</OPTION>
<OPTION value="IN">Indiana</OPTION>
<OPTION value="IA">Iowa</OPTION>
<OPTION value="KS">Kansas</OPTION>
<OPTION value="KY">Kentucky</OPTION>
<OPTION value="LA">Louisiana</OPTION>
<OPTION value="ME">Maine</OPTION>
<OPTION value="MD">Maryland</OPTION>
<OPTION value="MA">Massachusetts</OPTION>
<OPTION value="MI">Michigan</OPTION>
<OPTION value="MN">Minnesota</OPTION>
<OPTION value="MS">Mississippi</OPTION>
<OPTION value="MO">Missouri</OPTION>
<OPTION value="MT">Montana</OPTION>
<OPTION value="NE">Nebraska</OPTION>
<OPTION value="NV">Nevada</OPTION>
<OPTION value="NH">New Hampshire</OPTION>
<OPTION value="NJ">New Jersey</OPTION>
<OPTION value="NM">New Mexico</OPTION>
<OPTION value="NY">New York</OPTION>
<OPTION value="NC">North Carolina</OPTION>
<OPTION value="ND">North Dakota</OPTION>
<OPTION value="OH">Ohio</OPTION>
<OPTION value="OK">Oklahoma</OPTION>
<OPTION value="OR">Oregon</OPTION>
<OPTION value="PA">Pennsylvania</OPTION>
<OPTION value="RI">Rhode Island</OPTION>
<OPTION value="SC">South Carolina</OPTION>
<OPTION value="SD">South Dakota</OPTION>
<OPTION value="TN">Tennessee</OPTION>
<OPTION value="TX">Texas</OPTION>
<OPTION value="UT">Utah</OPTION>
<OPTION value="VT">Vermont</OPTION>
<OPTION value="VA">Virginia</OPTION>
<OPTION value="WA">Washington</OPTION>
<OPTION value="DC">Washington, DC</OPTION>
<OPTION value="WV">West Virginia</OPTION>
<OPTION value="WI">Wisconsin</OPTION>
<OPTION value="WY">Wyoming</OPTION>
</OPTGROUP>
<!--
<OPTGROUP label="Canada">
<OPTION value="AB">ALBERTA</OPTION>
<OPTION value="NT">NORTHWEST TERRITORY</OPTION>
<OPTION value="BC">BRITISH COLUMBIA</OPTION>
<OPTION value="ON">ONTARIO</OPTION>
<OPTION value="LB">LABRADOR</OPTION>
<OPTION value="PE">PRINCE EDWARDISLAND</OPTION>
<OPTION value="MB">MANITOBA</OPTION>
<OPTION value="PQ">QUEBEC</OPTION>
<OPTION value="NB">NEW BRUNSWICK</OPTION>
<OPTION value="SK">SASKATCHEWAN</OPTION>
<OPTION value="NF">NEWFOUNDLAND</OPTION>
<OPTION value="YT">YUKON TERRITORY</OPTION>
<OPTION value="NS">NOVA SCOTIA</OPTION>
</OPTGROUP>
-->
</SELECT> *</TD>
</TR>
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Provincia: </TD><TD ALIGN=LEFT><input type=text name=province id=province size=20 maxlength=50 value="<?php echo $province ?>"></TD>
</TR> -->
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_postal_code ?>: </TD><TD ALIGN=LEFT><input type=text name=postal_code id=postal_code size=6 maxlength=5 value="<?php echo $postal_code ?>"> *</TD>
</TR>
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Telefono Code: </TD><TD ALIGN=LEFT><input type=text name=phone_code id=phone_code size=10 maxlength=10 value="<?php echo $phone_code ?>"></TD>
</TR> -->
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA"><?php echo $label_phone_number ?>: </TD><TD ALIGN=LEFT><input type=text name=phone_number id=phone_number size=18 maxlength=18 value="<?php echo $phone_number ?>"> *</TD>
</TR>
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Sesso: </TD><TD ALIGN=LEFT><input type=text name=gender id=gender size=2 maxlength=1 value="<?php echo $gender ?>"></TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Data di Nascita: </TD><TD ALIGN=LEFT><input type=text name=date_if_birth id=date_if_birth size=12 maxlength=12 value="<?php echo $date_of_birth ?>"></TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Num. Alternativo: </TD><TD ALIGN=LEFT><input type=text name=alt_phone id=alt_phone size=12 maxlength=12 value="<?php echo $alt_phone ?>"> *</TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Email: </TD><TD ALIGN=LEFT><input type=text name=email id=email size=30 maxlength=70 value="<?php echo $email ?>"> *</TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Mostra: </TD><TD ALIGN=LEFT><input type=text name=security_phrase id=security_phrase size=30 maxlength=100 value="<?php echo $security_phrase ?>"> *</TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Note:</TD><TD ALIGN=LEFT><input type=text name=comments id=comments size=40 maxlength=255 value="<?php echo $comments ?>"> *</TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Rank: </TD><TD ALIGN=LEFT><input type=text name=rank id=rank size=5 maxlength=5 value="<?php echo $rank ?>"> *</TD>
</TR> -->
<!-- <TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Owner: </TD><TD ALIGN=LEFT><input type=text name=owner id=owner size=20 maxlength=20 value="<?php echo $owner ?>"> *</TD>
</TR> -->
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Order ID: </TD><TD ALIGN=LEFT><input type=text name=order_id id=order_id size=20 maxlength=20 value="<?php echo $order_id ?>"></TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA">Appointment Date/Time: </TD><TD ALIGN=LEFT><input type=text name=appointment_date id=appointment_date size=10 maxlength=10 value="<?php echo $appointment_date ?>">
<script language="JavaScript">
var o_cal = new tcal ({
// form name
'formname': 'vsn',
// input name
'controlname': 'appointment_date'
});
o_cal.a_tpl.yearscroll = false;
// o_cal.a_tpl.weekstart = 1; // Monday week start
</script>
<input type=hidden name=appointment_time id=appointment_time value="<?php echo $appointment_time ?>">
<SELECT name=appointment_hour id=appointment_hour>
<option>00</option>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<OPTION value="<?php echo $appointment_hour ?>" selected><?php echo $appointment_hour ?></OPTION>
</SELECT>
<SELECT name=appointment_min id=appointment_min>
<option>00</option>
<option>05</option>
<option>10</option>
<option>15</option>
<option>20</option>
<option>25</option>
<option>30</option>
<option>35</option>
<option>40</option>
<option>45</option>
<option>50</option>
<option>55</option>
<OPTION value="<?php echo $appointment_min ?>" selected><?php echo $appointment_min ?></OPTION>
</SELECT>
</TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=CENTER COLSPAN=2><FONT FACE="ARIAL,HELVETICA" size=2>Appointment Note:<BR><TEXTAREA NAME=call_notes ID=call_notes ROWS=5 COLS=50><?php echo $call_notes ?></TEXTAREA></font><br>
</TD>
</TR>
<TR BGCOLOR="#E6E6E6">
<TD ALIGN=CENTER COLSPAN=2><FONT FACE="ARIAL,HELVETICA" size=1>Please click INVIA to commit the changes, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * denotes required fields</font><br>
</TD>
</TR>
<TR BGCOLOR=white>
<TD ALIGN=CENTER COLSPAN=2>
<SCRIPT LANGUAGE="JavaScript">
function submit_form()
{
var appointment_hourFORM = document.getElementById('appointment_hour');
var appointment_hourVALUE = appointment_hourFORM[appointment_hourFORM.selectedIndex].text;
var appointment_minFORM = document.getElementById('appointment_min');
var appointment_minVALUE = appointment_minFORM[appointment_minFORM.selectedIndex].text;
document.vsn.appointment_time.value = appointment_hourVALUE + ":" + appointment_minVALUE + ":00";
document.vsn.submit();
}
</SCRIPT>
<input type=button value="INVIA" name=smt id=smt onClick="submit_form()">
</TD>
</TR>
</TABLE>
</FORM>
</CENTER>
</B></FONT>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
File diff suppressed because it is too large Load Diff
@@ -22,6 +22,11 @@ agc|voicemail_check.php|0
agc|dbconnect.php|1
agc|timeclock.php|0
agc|vdc_script_display.php|1
agc|vdc_script_notes.php|0
agc|functions.php|1
agc|vdc_form_display.php|1
agc|calendar.css|1
agc|calendar_db.js|0
***TRANSLATIONS***
### special translations that should stay at the top of the file ###
"JAN"|"JAN"|
@@ -22,6 +22,11 @@ agc|voicemail_check.php|0
agc|dbconnect.php|1
agc|timeclock.php|0
agc|vdc_script_display.php|1
agc|vdc_script_notes.php|0
agc|functions.php|1
agc|vdc_form_display.php|1
agc|calendar.css|1
agc|calendar_db.js|0
***TRANSLATIONS***
### special translations that should stay at the top of the file ###
"JAN"|"JAN"|
@@ -22,6 +22,11 @@ agc|voicemail_check.php|0
agc|dbconnect.php|1
agc|timeclock.php|0
agc|vdc_script_display.php|1
agc|vdc_script_notes.php|0
agc|functions.php|1
agc|vdc_form_display.php|1
agc|calendar.css|1
agc|calendar_db.js|0
***TRANSLATIONS***
### special translations that should stay at the top of the file ###
"JAN"|"ΙΑΝ"|
@@ -22,6 +22,11 @@ agc|voicemail_check.php|0
agc|dbconnect.php|1
agc|timeclock.php|0
agc|vdc_script_display.php|1
agc|vdc_script_notes.php|0
agc|functions.php|1
agc|vdc_form_display.php|1
agc|calendar.css|1
agc|calendar_db.js|0
***TRANSLATIONS***
### special translations that should stay at the top of the file ###
"JAN"|"ENE"|
@@ -22,6 +22,11 @@ agc|voicemail_check.php|0
agc|dbconnect.php|1
agc|timeclock.php|0
agc|vdc_script_display.php|1
agc|vdc_script_notes.php|0
agc|functions.php|1
agc|vdc_form_display.php|1
agc|calendar.css|1
agc|calendar_db.js|0
***TRANSLATIONS***
### special translations that should stay at the top of the file ###
"JAN"|"JAN"|
@@ -22,6 +22,11 @@ agc|voicemail_check.php|0
agc|dbconnect.php|1
agc|timeclock.php|0
agc|vdc_script_display.php|1
agc|vdc_script_notes.php|0
agc|functions.php|1
agc|vdc_form_display.php|1
agc|calendar.css|1
agc|calendar_db.js|0
***TRANSLATIONS***
### special translations that should stay at the top of the file ###
"JAN"|"GEN"|
@@ -22,6 +22,11 @@ agc|voicemail_check.php|0
agc|dbconnect.php|1
agc|timeclock.php|0
agc|vdc_script_display.php|1
agc|vdc_script_notes.php|0
agc|functions.php|1
agc|vdc_form_display.php|1
agc|calendar.css|1
agc|calendar_db.js|0
***TRANSLATIONS***
### special translations that should stay at the top of the file ###
"JAN"|"JAN"|
@@ -22,6 +22,11 @@ agc|voicemail_check.php|0
agc|dbconnect.php|1
agc|timeclock.php|0
agc|vdc_script_display.php|1
agc|vdc_script_notes.php|0
agc|functions.php|1
agc|vdc_form_display.php|1
agc|calendar.css|1
agc|calendar_db.js|0
***TRANSLATIONS***
### special translations that should stay at the top of the file ###
"JAN"|"STY"|
@@ -22,6 +22,11 @@ agc|voicemail_check.php|0
agc|dbconnect.php|1
agc|timeclock.php|0
agc|vdc_script_display.php|1
agc|vdc_script_notes.php|0
agc|functions.php|1
agc|vdc_form_display.php|1
agc|calendar.css|1
agc|calendar_db.js|0
***TRANSLATIONS***
### special translations that should stay at the top of the file ###
"JAN"|"JAN"|
@@ -22,6 +22,11 @@ agc|voicemail_check.php|0
agc|dbconnect.php|1
agc|timeclock.php|0
agc|vdc_script_display.php|1
agc|vdc_script_notes.php|0
agc|functions.php|1
agc|vdc_form_display.php|1
agc|calendar.css|1
agc|calendar_db.js|0
***TRANSLATIONS***
### special translations that should stay at the top of the file ###
"JAN"|"ЯНВ"|
@@ -22,6 +22,11 @@ agc|voicemail_check.php|0
agc|dbconnect.php|1
agc|timeclock.php|0
agc|vdc_script_display.php|1
agc|vdc_script_notes.php|0
agc|functions.php|1
agc|vdc_form_display.php|1
agc|calendar.css|1
agc|calendar_db.js|0
***TRANSLATIONS***
### special translations that should stay at the top of the file ###
"JAN"|"Jan"|
@@ -22,6 +22,11 @@ agc|voicemail_check.php|0
agc|dbconnect.php|1
agc|timeclock.php|0
agc|vdc_script_display.php|1
agc|vdc_script_notes.php|0
agc|functions.php|1
agc|vdc_form_display.php|1
agc|calendar.css|1
agc|calendar_db.js|0
***TRANSLATIONS***
### special translations that should stay at the top of the file ###
"JAN"|"JAN"|
@@ -23,6 +23,11 @@ agc|dbconnect.php|1
agc|htglobalize.php|1
agc|timeclock.php|0
agc|vdc_script_display.php|1
agc|vdc_script_notes.php|0
agc|functions.php|1
agc|vdc_form_display.php|1
agc|calendar.css|1
agc|calendar_db.js|0
***TRANSLATIONS***
### special translations that should stay at the top of the file ###
"JAN"|"一月"|
+9 -9
View File
@@ -9,7 +9,7 @@ var A_TCALDEF = {
'yearscroll': true, // show year scroller
'weekstart': 0, // first day of week: 0-Su or 1-Mo
'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx.
'imgpath' : 'images/' // directory with calendar images
'imgpath' : './images/' // directory with calendar images
}
// date parsing function
function f_tcalParseDate (s_date) {
@@ -58,8 +58,8 @@ function tcal (a_cfg, a_tpl) {
window.A_TCALSIDX[window.A_TCALSIDX.length] = this;
// assign methods
this.f_show = f_tcalShow;
this.f_hide = f_tcalHide;
this.f_show = f_tcal_show;
this.f_hide = f_tcal_hide;
this.f_toggle = f_tcalToggle;
this.f_update = f_tcalUpdate;
this.f_relDate = f_tcalRelDate;
@@ -78,7 +78,7 @@ function tcal (a_cfg, a_tpl) {
this.a_tpl = a_tpl;
}
function f_tcalShow (d_date) {
function f_tcal_show (d_date) {
// find input field
if (!this.a_cfg.controlname)
@@ -119,7 +119,7 @@ function f_tcalShow (d_date) {
}
// hide all calendars
f_tcalHideAll();
f_tcal_hideAll();
// generate HTML and show calendar
this.e_icon = f_getElement(this.s_iconId);
@@ -137,7 +137,7 @@ function f_tcalShow (d_date) {
this.b_visible = true;
}
function f_tcalHide (n_date) {
function f_tcal_hide (n_date) {
if (n_date)
this.e_input.value = this.f_generDate(new Date(n_date));
@@ -302,7 +302,7 @@ function f_tcalRelDate (d_date, d_diff, s_units) {
return ' onclick="A_TCALS[\'' + this.s_id + '\'].f_update(' + d_result.valueOf() + ')"';
}
function f_tcalHideAll () {
function f_tcal_hideAll () {
for (var i = 0; i < window.A_TCALSIDX.length; i++)
window.A_TCALSIDX[i].f_hide();
}
@@ -320,9 +320,9 @@ f_getElement = document.all ?
function (s_id) { return document.getElementById(s_id) };
if (document.addEventListener)
window.addEventListener('scroll', f_tcalHideAll, false);
window.addEventListener('scroll', f_tcal_hideAll, false);
if (window.attachEvent)
window.attachEvent('onscroll', f_tcalHideAll);
window.attachEvent('onscroll', f_tcal_hideAll);
// global variables
var s_userAgent = navigator.userAgent.toLowerCase(),