updated Greek agent build in trunk
git-svn-id: svn://192.168.202.10@1549 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -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' : ['Φεβρουάριος', 'February', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος'],
|
||||
'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 ("Ακυρο 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 ("Ακυρο 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("Ακυρο 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;
|
||||
@@ -135,12 +137,12 @@ $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
|
||||
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
|
||||
{
|
||||
echo "Ακυρο Όνομα χρήστη/Κωδικός πρόσβασης: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
@@ -200,6 +202,8 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
$Aagent_log_id='';
|
||||
$Acallerid='';
|
||||
$DEADcustomer=0;
|
||||
$Astatus='';
|
||||
$Acampaign_id='';
|
||||
|
||||
### see if the agent has a record in the vicidial_live_agents table
|
||||
$stmt="SELECT count(*) from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
|
||||
@@ -387,7 +391,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 +405,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 +578,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 . '|Κατάσταση: ' . $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 . '|Κατάσταση: ' . $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)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,522 @@
|
||||
<?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);
|
||||
|
||||
$list_lead_ct=0;
|
||||
if (strlen($select_SQL)>0)
|
||||
{
|
||||
##### 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=" <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 .= " ";}
|
||||
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 .= " <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 .= " ";}
|
||||
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 .= " ";}
|
||||
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);
|
||||
$CFoutput = eregi_replace('--A--preset_number_a--B--',"$preset_number_a",$CFoutput);
|
||||
$CFoutput = eregi_replace('--A--preset_number_b--B--',"$preset_number_b",$CFoutput);
|
||||
$CFoutput = eregi_replace('--A--preset_number_c--B--',"$preset_number_c",$CFoutput);
|
||||
$CFoutput = eregi_replace('--A--preset_number_d--B--',"$preset_number_d",$CFoutput);
|
||||
$CFoutput = eregi_replace('--A--preset_number_e--B--',"$preset_number_e",$CFoutput);
|
||||
$CFoutput = eregi_replace('--A--preset_dtmf_a--B--',"$preset_dtmf_a",$CFoutput);
|
||||
$CFoutput = eregi_replace('--A--preset_dtmf_b--B--',"$preset_dtmf_b",$CFoutput);
|
||||
$CFoutput = eregi_replace('--A--did_id--B--',"$did_id",$CFoutput);
|
||||
$CFoutput = eregi_replace('--A--did_extension--B--',"$did_extension",$CFoutput);
|
||||
$CFoutput = eregi_replace('--A--did_pattern--B--',"$did_pattern",$CFoutput);
|
||||
$CFoutput = eregi_replace('--A--did_description--B--',"$did_description",$CFoutput);
|
||||
$CFoutput = eregi_replace('--A--closecallid--B--',"$closecallid",$CFoutput);
|
||||
$CFoutput = eregi_replace('--A--xfercallid--B--',"$xfercallid",$CFoutput);
|
||||
$CFoutput = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$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;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -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',...)
|
||||
@@ -41,6 +41,8 @@
|
||||
# - $agent_dialed_number - ('1','')
|
||||
# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...)
|
||||
# - $nodeletevdac - ('0','1')
|
||||
# - $alertCID - ('0','1')
|
||||
# - $preset_name = ('TESTING PRESET',...)
|
||||
#
|
||||
# CHANGELOG:
|
||||
# 50401-1002 - First build of script, Hangup function only
|
||||
@@ -95,11 +97,18 @@
|
||||
# 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
|
||||
# 100813-0833 - Added preset_name variable and logging
|
||||
# 101004-1345 - Added Ivr park functions
|
||||
# 101024-1638 - Added park_log logging for parked calls
|
||||
# 101107-2331 - Added CALLERONHOLD/CALLEROFFHOLD queue_log entries
|
||||
#
|
||||
|
||||
$version = '2.2.0-47';
|
||||
$build = '100327-0846';
|
||||
$version = '2.4-53';
|
||||
$build = '101107-2331';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=85;
|
||||
$mysql_log_count=115;
|
||||
$one_mysql_log=0;
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -185,6 +194,11 @@ 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"];}
|
||||
if (isset($_GET["preset_name"])) {$preset_name=$_GET["preset_name"];}
|
||||
elseif (isset($_POST["preset_name"])) {$preset_name=$_POST["preset_name"];}
|
||||
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
@@ -289,6 +303,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,'02092',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$ACTION="SysCIDOriginate";
|
||||
}
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls
|
||||
@@ -390,7 +418,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 δεν ισχύει or queryCID $queryCID δεν ισχύει, Originate εντολή που δεν έγινε εισαγωγή\n";
|
||||
}
|
||||
@@ -422,10 +450,34 @@ if ($ACTION=="Originate")
|
||||
|
||||
if ($agent_dialed_number > 0)
|
||||
{
|
||||
$stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$exten','$channel','0','$outbound_cid','$RAWaccount')";
|
||||
if (strlen($lead_id)<1) {$lead_id='0';}
|
||||
$customer_hungup='';
|
||||
if ( ($stage > 0) and (preg_match("/3WAY/",$agent_dialed_type)) )
|
||||
{$customer_hungup = 'BEFORE_CALL';}
|
||||
$stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id,preset_name,campaign_id,customer_hungup) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$exten','$channel','$lead_id','$outbound_cid','$RAWaccount','$preset_name','$campaign','$customer_hungup')";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
if (strlen($preset_name) > 0)
|
||||
{
|
||||
$stmt = "SELECT count(*) from vicidial_xfer_stats where campaign_id='$campaign' and preset_name='$preset_name';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02093',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
{
|
||||
$stmt = "UPDATE vicidial_xfer_stats SET xfer_count=(xfer_count+1) where campaign_id='$campaign' and preset_name='$preset_name';";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt = "INSERT INTO vicidial_xfer_stats SET campaign_id='$campaign',preset_name='$preset_name',xfer_count='1';";
|
||||
}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02094',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -734,6 +786,32 @@ 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);}
|
||||
}
|
||||
|
||||
if (strlen($preset_name) > 0)
|
||||
{
|
||||
$stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,preset_name,campaign_id) values('$user','$NOW_TIME','BLIND_XFER','$server_ip','$exten','$channel','$lead_id','$preset_name','$campaign')";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02095',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmt = "SELECT count(*) from vicidial_xfer_stats where campaign_id='$campaign' and preset_name='$preset_name';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02096',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
{
|
||||
$stmt = "UPDATE vicidial_xfer_stats SET xfer_count=(xfer_count+1) where campaign_id='$campaign' and preset_name='$preset_name';";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt = "INSERT INTO vicidial_xfer_stats SET campaign_id='$campaign',preset_name='$preset_name',xfer_count='1';";
|
||||
}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02097',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
$ACTION="Redirect";
|
||||
}
|
||||
}
|
||||
@@ -762,10 +840,73 @@ if ($ACTION=="RedirectToPark")
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$ACTION="Redirect";
|
||||
|
||||
$stmt = "INSERT INTO park_log SET uniqueid='$uniqueid',status='ΣΤΑΘΜΕΥΣΗED',channel='$channel',channel_group='$campaign',server_ip='$server_ip',parked_time='$NOW_TIME',parked_sec=0,extension='$CalLCID',user='$user',lead_id='$lead_id';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02098',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
|
||||
#############################################
|
||||
##### START QUEUEMETRICS LOGGING LOOKUP #####
|
||||
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02099',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$enable_queuemetrics_logging = $row[0];
|
||||
$queuemetrics_server_ip = $row[1];
|
||||
$queuemetrics_dbname = $row[2];
|
||||
$queuemetrics_login = $row[3];
|
||||
$queuemetrics_pass = $row[4];
|
||||
$queuemetrics_log_id = $row[5];
|
||||
$i++;
|
||||
}
|
||||
##### END QUEUEMETRICS LOGGING LOOKUP #####
|
||||
###########################################
|
||||
if ($enable_queuemetrics_logging > 0)
|
||||
{
|
||||
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
|
||||
mysql_select_db("$queuemetrics_dbname", $linkB);
|
||||
|
||||
$time_id=0;
|
||||
$stmt="SELECT time_id,queue,agent from queue_log where call_id='$CalLCID' and verb='CONNECT' order by time_id desc limit 1;";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02100',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$VAC_eq_ct = mysql_num_rows($rslt);
|
||||
if ($VAC_eq_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$time_id = $row[0];
|
||||
$queue = $row[1];
|
||||
$agent = $row[2];
|
||||
}
|
||||
$StarTtime = date("U");
|
||||
if ($time_id > 100000)
|
||||
{$secondS = ($StarTtime - $time_id);}
|
||||
|
||||
if ($VAC_eq_ct > 0)
|
||||
{
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$queue',agent='Agent/$user',verb='CALLERONHOLD',data1='ΣΤΑΘΜΕΥΣΗ',serverid='$queuemetrics_log_id';";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02101',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";}
|
||||
}
|
||||
}
|
||||
|
||||
# $fp = fopen ("./vicidial_debug.txt", "a");
|
||||
# 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,'02086',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
if ($ACTION=="RedirectFromPark")
|
||||
@@ -789,9 +930,281 @@ if ($ACTION=="RedirectFromPark")
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$ACTION="Redirect";
|
||||
|
||||
$parked_sec=0;
|
||||
$stmt = "SELECT UNIX_TIMESTAMP(parked_time) FROM park_log where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' and (parked_sec < 1 or grab_time is NULL) order by parked_time desc limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02102',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$VAC_pl_ct = mysql_num_rows($rslt);
|
||||
if ($VAC_pl_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$parked_sec = ($StarTtime - $row[0]);
|
||||
|
||||
$stmt = "UPDATE park_log SET status='GRABBED',grab_time='$NOW_TIME',parked_sec='$parked_sec' where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' order by parked_time desc limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02103',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
#############################################
|
||||
##### START QUEUEMETRICS LOGGING LOOKUP #####
|
||||
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02104',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$enable_queuemetrics_logging = $row[0];
|
||||
$queuemetrics_server_ip = $row[1];
|
||||
$queuemetrics_dbname = $row[2];
|
||||
$queuemetrics_login = $row[3];
|
||||
$queuemetrics_pass = $row[4];
|
||||
$queuemetrics_log_id = $row[5];
|
||||
$i++;
|
||||
}
|
||||
##### END QUEUEMETRICS LOGGING LOOKUP #####
|
||||
###########################################
|
||||
if ($enable_queuemetrics_logging > 0)
|
||||
{
|
||||
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
|
||||
mysql_select_db("$queuemetrics_dbname", $linkB);
|
||||
|
||||
$time_id=0;
|
||||
$stmt="SELECT time_id,queue,agent from queue_log where call_id='$CalLCID' and verb='CONNECT' order by time_id desc limit 1;";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02105',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$VAC_eq_ct = mysql_num_rows($rslt);
|
||||
if ($VAC_eq_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$time_id = $row[0];
|
||||
$queue = $row[1];
|
||||
$agent = $row[2];
|
||||
}
|
||||
$StarTtime = date("U");
|
||||
if ($time_id > 100000)
|
||||
{$secondS = ($StarTtime - $time_id);}
|
||||
|
||||
if ($VAC_eq_ct > 0)
|
||||
{
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$queue',agent='Agent/$user',verb='CALLEROFFHOLD',data1='$parked_sec',data2='ΣΤΑΘΜΕΥΣΗ',serverid='$queuemetrics_log_id';";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02106',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$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,'02087',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
if ($ACTION=="RedirectToParkIVR")
|
||||
{
|
||||
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) )
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n";
|
||||
echo "Channel $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n";
|
||||
echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n";
|
||||
echo "exten $exten πρέπει να τεθεί\n";
|
||||
echo "extenName $extenName πρέπει να τεθεί\n";
|
||||
echo "ext_context $ext_context πρέπει να τεθεί\n";
|
||||
echo "ext_priority $ext_priority πρέπει να τεθεί\n";
|
||||
echo "parkedby $parkedby πρέπει να τεθεί\n";
|
||||
echo "\nRedirectToPark Action μην σταλμένος\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;}
|
||||
$stmt = "INSERT INTO parked_channels values('$channel','$server_ip','$CalLCID','$extenName','$parkedby','$NOW_TIME');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$ACTION="Redirect";
|
||||
|
||||
$stmt = "UPDATE vicidial_auto_calls SET extension='ΣΤΑΘΜΕΥΣΗ_IVR' where callerid='$CalLCID' limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02088',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmt = "INSERT INTO park_log SET uniqueid='$uniqueid',status='IVRΣΤΑΘΜΕΥΣΗED',channel='$channel',channel_group='$campaign',server_ip='$server_ip',parked_time='$NOW_TIME',parked_sec=0,extension='$CalLCID',user='$user',lead_id='$lead_id';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02107',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
#############################################
|
||||
##### START QUEUEMETRICS LOGGING LOOKUP #####
|
||||
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02108',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$enable_queuemetrics_logging = $row[0];
|
||||
$queuemetrics_server_ip = $row[1];
|
||||
$queuemetrics_dbname = $row[2];
|
||||
$queuemetrics_login = $row[3];
|
||||
$queuemetrics_pass = $row[4];
|
||||
$queuemetrics_log_id = $row[5];
|
||||
$i++;
|
||||
}
|
||||
##### END QUEUEMETRICS LOGGING LOOKUP #####
|
||||
###########################################
|
||||
if ($enable_queuemetrics_logging > 0)
|
||||
{
|
||||
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
|
||||
mysql_select_db("$queuemetrics_dbname", $linkB);
|
||||
|
||||
$time_id=0;
|
||||
$stmt="SELECT time_id,queue,agent from queue_log where call_id='$CalLCID' and verb='CONNECT' order by time_id desc limit 1;";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02109',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$VAC_eq_ct = mysql_num_rows($rslt);
|
||||
if ($VAC_eq_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$time_id = $row[0];
|
||||
$queue = $row[1];
|
||||
$agent = $row[2];
|
||||
}
|
||||
$StarTtime = date("U");
|
||||
if ($time_id > 100000)
|
||||
{$secondS = ($StarTtime - $time_id);}
|
||||
|
||||
if ($VAC_eq_ct > 0)
|
||||
{
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$queue',agent='Agent/$user',verb='CALLERONHOLD',data1='IVRΣΤΑΘΜΕΥΣΗ',serverid='$queuemetrics_log_id';";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02110',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";}
|
||||
}
|
||||
}
|
||||
# $fp = fopen ("./vicidial_debug.txt", "a");
|
||||
# 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,'02089',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
if ($ACTION=="RedirectFromParkIVR")
|
||||
{
|
||||
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) )
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n";
|
||||
echo "Channel $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n";
|
||||
echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n";
|
||||
echo "exten $exten πρέπει να τεθεί\n";
|
||||
echo "ext_context $ext_context πρέπει να τεθεί\n";
|
||||
echo "ext_priority $ext_priority πρέπει να τεθεί\n";
|
||||
echo "\nRedirectFromPark Action μην σταλμένος\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;}
|
||||
$stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
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_auto_calls SET extension='' where callerid='$CalLCID' limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02090',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$parked_sec=0;
|
||||
$stmt = "SELECT UNIX_TIMESTAMP(parked_time) FROM park_log where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' and (parked_sec < 1 or grab_time is NULL) order by parked_time desc limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02111',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$VAC_pl_ct = mysql_num_rows($rslt);
|
||||
if ($VAC_pl_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$parked_sec = ($StarTtime - $row[0]);
|
||||
|
||||
$stmt = "UPDATE park_log SET status='GRABBEDIVR',grab_time='$NOW_TIME',parked_sec='$parked_sec' where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' order by parked_time desc limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02112',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
#############################################
|
||||
##### START QUEUEMETRICS LOGGING LOOKUP #####
|
||||
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02113',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$enable_queuemetrics_logging = $row[0];
|
||||
$queuemetrics_server_ip = $row[1];
|
||||
$queuemetrics_dbname = $row[2];
|
||||
$queuemetrics_login = $row[3];
|
||||
$queuemetrics_pass = $row[4];
|
||||
$queuemetrics_log_id = $row[5];
|
||||
$i++;
|
||||
}
|
||||
##### END QUEUEMETRICS LOGGING LOOKUP #####
|
||||
###########################################
|
||||
if ($enable_queuemetrics_logging > 0)
|
||||
{
|
||||
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
|
||||
mysql_select_db("$queuemetrics_dbname", $linkB);
|
||||
|
||||
$time_id=0;
|
||||
$stmt="SELECT time_id,queue,agent from queue_log where call_id='$CalLCID' and verb='CONNECT' order by time_id desc limit 1;";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02114',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$VAC_eq_ct = mysql_num_rows($rslt);
|
||||
if ($VAC_eq_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$time_id = $row[0];
|
||||
$queue = $row[1];
|
||||
$agent = $row[2];
|
||||
}
|
||||
$StarTtime = date("U");
|
||||
if ($time_id > 100000)
|
||||
{$secondS = ($StarTtime - $time_id);}
|
||||
|
||||
if ($VAC_eq_ct > 0)
|
||||
{
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$queue',agent='Agent/$user',verb='CALLEROFFHOLD',data1='$parked_sec',data2='IVRΣΤΑΘΜΕΥΣΗ',serverid='$queuemetrics_log_id';";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02115',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$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,'02091',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
|
||||
if ($ACTION=="RedirectName")
|
||||
{
|
||||
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) )
|
||||
@@ -1105,7 +1518,7 @@ if ($ACTION=="RedirectXtraNeW")
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
$fp = fopen ("./vicidial_debug.txt", "a");
|
||||
fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|$session_id|\n");
|
||||
fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|$session_id|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
@@ -1650,7 +2063,7 @@ exit;
|
||||
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);
|
||||
# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
$errno=''; $error='';
|
||||
if ( ($mel > 0) or ($one_mysql_log > 0) )
|
||||
{
|
||||
|
||||
@@ -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\">ΕΠΙΣΤΡΟΦΗ στην οθόνη Συνδεσης του Χειριστή</font></A>";}
|
||||
if ($referrer=='admin')
|
||||
{$BACKlink = "<A HREF=\"../vicidial/admin.php\"><font color=\"#003333\">ΕΠΙΣΤΡΟΦΗ στην Διαχείριση</font></A>";}
|
||||
{$BACKlink = "<A HREF=\"/$admin_web_directory/admin.php\"><font color=\"#003333\">ΕΠΙΣΤΡΟΦΗ στην Διαχείριση</font></A>";}
|
||||
if ($referrer=='welcome')
|
||||
{$BACKlink = "<A HREF=\"$welcomeURL\"><font color=\"#003333\">ΕΠΙΣΤΡΟΦΗ στην οθόνη υποδοχής</font></A>";}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,458 @@
|
||||
<?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
|
||||
# 100916-1749 - Added non-lead variable parsing
|
||||
#
|
||||
|
||||
$version = '2.4-4';
|
||||
$build = '100916-1749';
|
||||
|
||||
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"];}
|
||||
|
||||
if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];}
|
||||
elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];}
|
||||
if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];}
|
||||
elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];}
|
||||
if (isset($_GET["original_phone_login"])) {$original_phone_login=$_GET["original_phone_login"];}
|
||||
elseif (isset($_POST["original_phone_login"])) {$original_phone_login=$_POST["original_phone_login"];}
|
||||
if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];}
|
||||
elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];}
|
||||
if (isset($_GET["fronter"])) {$fronter=$_GET["fronter"];}
|
||||
elseif (isset($_POST["fronter"])) {$fronter=$_POST["fronter"];}
|
||||
if (isset($_GET["closer"])) {$closer=$_GET["closer"];}
|
||||
elseif (isset($_POST["closer"])) {$closer=$_POST["closer"];}
|
||||
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];}
|
||||
elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];}
|
||||
if (isset($_GET["SQLdate"])) {$SQLdate=$_GET["SQLdate"];}
|
||||
elseif (isset($_POST["SQLdate"])) {$SQLdate=$_POST["SQLdate"];}
|
||||
if (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];}
|
||||
elseif (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];}
|
||||
if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];}
|
||||
elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];}
|
||||
if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];}
|
||||
elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];}
|
||||
if (isset($_GET["customer_server_ip"])) {$customer_server_ip=$_GET["customer_server_ip"];}
|
||||
elseif (isset($_POST["customer_server_ip"])) {$customer_server_ip=$_POST["customer_server_ip"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["SIPexten"])) {$SIPexten=$_GET["SIPexten"];}
|
||||
elseif (isset($_POST["SIPexten"])) {$SIPexten=$_POST["SIPexten"];}
|
||||
if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];}
|
||||
elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];}
|
||||
if (isset($_GET["phone"])) {$phone=$_GET["phone"];}
|
||||
elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];}
|
||||
if (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];}
|
||||
elseif (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];}
|
||||
if (isset($_GET["dialed_number"])) {$dialed_number=$_GET["dialed_number"];}
|
||||
elseif (isset($_POST["dialed_number"])) {$dialed_number=$_POST["dialed_number"];}
|
||||
if (isset($_GET["dialed_label"])) {$dialed_label=$_GET["dialed_label"];}
|
||||
elseif (isset($_POST["dialed_label"])) {$dialed_label=$_POST["dialed_label"];}
|
||||
if (isset($_GET["camp_script"])) {$camp_script=$_GET["camp_script"];}
|
||||
elseif (isset($_POST["camp_script"])) {$camp_script=$_POST["camp_script"];}
|
||||
if (isset($_GET["in_script"])) {$in_script=$_GET["in_script"];}
|
||||
elseif (isset($_POST["in_script"])) {$in_script=$_POST["in_script"];}
|
||||
if (isset($_GET["script_width"])) {$script_width=$_GET["script_width"];}
|
||||
elseif (isset($_POST["script_width"])) {$script_width=$_POST["script_width"];}
|
||||
if (isset($_GET["script_height"])) {$script_height=$_GET["script_height"];}
|
||||
elseif (isset($_POST["script_height"])) {$script_height=$_POST["script_height"];}
|
||||
if (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];}
|
||||
elseif (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];}
|
||||
if (isset($_GET["recording_filename"])) {$recording_filename=$_GET["recording_filename"];}
|
||||
elseif (isset($_POST["recording_filename"])) {$recording_filename=$_POST["recording_filename"];}
|
||||
if (isset($_GET["recording_id"])) {$recording_id=$_GET["recording_id"];}
|
||||
elseif (isset($_POST["recording_id"])) {$recording_id=$_POST["recording_id"];}
|
||||
if (isset($_GET["user_custom_one"])) {$user_custom_one=$_GET["user_custom_one"];}
|
||||
elseif (isset($_POST["user_custom_one"])) {$user_custom_one=$_POST["user_custom_one"];}
|
||||
if (isset($_GET["user_custom_two"])) {$user_custom_two=$_GET["user_custom_two"];}
|
||||
elseif (isset($_POST["user_custom_two"])) {$user_custom_two=$_POST["user_custom_two"];}
|
||||
if (isset($_GET["user_custom_three"])) {$user_custom_three=$_GET["user_custom_three"];}
|
||||
elseif (isset($_POST["user_custom_three"])) {$user_custom_three=$_POST["user_custom_three"];}
|
||||
if (isset($_GET["user_custom_four"])) {$user_custom_four=$_GET["user_custom_four"];}
|
||||
elseif (isset($_POST["user_custom_four"])) {$user_custom_four=$_POST["user_custom_four"];}
|
||||
if (isset($_GET["user_custom_five"])) {$user_custom_five=$_GET["user_custom_five"];}
|
||||
elseif (isset($_POST["user_custom_five"])) {$user_custom_five=$_POST["user_custom_five"];}
|
||||
if (isset($_GET["preset_number_a"])) {$preset_number_a=$_GET["preset_number_a"];}
|
||||
elseif (isset($_POST["preset_number_a"])) {$preset_number_a=$_POST["preset_number_a"];}
|
||||
if (isset($_GET["preset_number_b"])) {$preset_number_b=$_GET["preset_number_b"];}
|
||||
elseif (isset($_POST["preset_number_b"])) {$preset_number_b=$_POST["preset_number_b"];}
|
||||
if (isset($_GET["preset_number_c"])) {$preset_number_c=$_GET["preset_number_c"];}
|
||||
elseif (isset($_POST["preset_number_c"])) {$preset_number_c=$_POST["preset_number_c"];}
|
||||
if (isset($_GET["preset_number_d"])) {$preset_number_d=$_GET["preset_number_d"];}
|
||||
elseif (isset($_POST["preset_number_d"])) {$preset_number_d=$_POST["preset_number_d"];}
|
||||
if (isset($_GET["preset_number_e"])) {$preset_number_e=$_GET["preset_number_e"];}
|
||||
elseif (isset($_POST["preset_number_e"])) {$preset_number_e=$_POST["preset_number_e"];}
|
||||
if (isset($_GET["preset_number_f"])) {$preset_number_f=$_GET["preset_number_f"];}
|
||||
elseif (isset($_POST["preset_number_f"])) {$preset_number_f=$_POST["preset_number_f"];}
|
||||
if (isset($_GET["preset_dtmf_a"])) {$preset_dtmf_a=$_GET["preset_dtmf_a"];}
|
||||
elseif (isset($_POST["preset_dtmf_a"])) {$preset_dtmf_a=$_POST["preset_dtmf_a"];}
|
||||
if (isset($_GET["preset_dtmf_b"])) {$preset_dtmf_b=$_GET["preset_dtmf_b"];}
|
||||
elseif (isset($_POST["preset_dtmf_b"])) {$preset_dtmf_b=$_POST["preset_dtmf_b"];}
|
||||
if (isset($_GET["did_id"])) {$did_id=$_GET["did_id"];}
|
||||
elseif (isset($_POST["did_id"])) {$did_id=$_POST["did_id"];}
|
||||
if (isset($_GET["did_extension"])) {$did_extension=$_GET["did_extension"];}
|
||||
elseif (isset($_POST["did_extension"])) {$did_extension=$_POST["did_extension"];}
|
||||
if (isset($_GET["did_pattern"])) {$did_pattern=$_GET["did_pattern"];}
|
||||
elseif (isset($_POST["did_pattern"])) {$did_pattern=$_POST["did_pattern"];}
|
||||
if (isset($_GET["did_description"])) {$did_description=$_GET["did_description"];}
|
||||
elseif (isset($_POST["did_description"])) {$did_description=$_POST["did_description"];}
|
||||
if (isset($_GET["closecallid"])) {$closecallid=$_GET["closecallid"];}
|
||||
elseif (isset($_POST["closecallid"])) {$closecallid=$_POST["closecallid"];}
|
||||
if (isset($_GET["xfercallid"])) {$xfercallid=$_GET["xfercallid"];}
|
||||
elseif (isset($_POST["xfercallid"])) {$xfercallid=$_POST["xfercallid"];}
|
||||
if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];}
|
||||
elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];}
|
||||
|
||||
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
|
||||
|
||||
if ($stage=='WELCOME')
|
||||
{echo "FORM"; exit;}
|
||||
|
||||
$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 = \" <a href=\\\"javascript:close_help('\" + taskspan + \"','\" + taskhelp + \"');\\\">help-</a><BR> \";\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 = \" <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 onload=\"parent.document.getElementById('FORM_LOADED').value='1';\">";
|
||||
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;
|
||||
|
||||
?>
|
||||
@@ -11,10 +11,13 @@
|
||||
# 91204-1913 - Added recording_filename and recording_id variables
|
||||
# 91211-1103 - Added user_custom_... variables
|
||||
# 100116-0702 - Added preset variables
|
||||
# 100127-1611 - Added ignore_list_script_override option
|
||||
# 100823-1644 - Added DID variables
|
||||
# 100902-1344 - Added closecallid, xfercallid, agent_log_id variables
|
||||
#
|
||||
|
||||
$version = '2.2.0-5';
|
||||
$build = '100116-0702';
|
||||
$version = '2.4-8';
|
||||
$build = '100902-1344';
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
@@ -160,10 +163,29 @@ if (isset($_GET["preset_dtmf_a"])) {$preset_dtmf_a=$_GET["preset_dtmf_a"];}
|
||||
elseif (isset($_POST["preset_dtmf_a"])) {$preset_dtmf_a=$_POST["preset_dtmf_a"];}
|
||||
if (isset($_GET["preset_dtmf_b"])) {$preset_dtmf_b=$_GET["preset_dtmf_b"];}
|
||||
elseif (isset($_POST["preset_dtmf_b"])) {$preset_dtmf_b=$_POST["preset_dtmf_b"];}
|
||||
if (isset($_GET["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];}
|
||||
if (isset($_GET["did_id"])) {$did_id=$_GET["did_id"];}
|
||||
elseif (isset($_POST["did_id"])) {$did_id=$_POST["did_id"];}
|
||||
if (isset($_GET["did_extension"])) {$did_extension=$_GET["did_extension"];}
|
||||
elseif (isset($_POST["did_extension"])) {$did_extension=$_POST["did_extension"];}
|
||||
if (isset($_GET["did_pattern"])) {$did_pattern=$_GET["did_pattern"];}
|
||||
elseif (isset($_POST["did_pattern"])) {$did_pattern=$_POST["did_pattern"];}
|
||||
if (isset($_GET["did_description"])) {$did_description=$_GET["did_description"];}
|
||||
elseif (isset($_POST["did_description"])) {$did_description=$_POST["did_description"];}
|
||||
if (isset($_GET["closecallid"])) {$closecallid=$_GET["closecallid"];}
|
||||
elseif (isset($_POST["closecallid"])) {$closecallid=$_POST["closecallid"];}
|
||||
if (isset($_GET["xfercallid"])) {$xfercallid=$_GET["xfercallid"];}
|
||||
elseif (isset($_POST["xfercallid"])) {$xfercallid=$_POST["xfercallid"];}
|
||||
if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];}
|
||||
elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];}
|
||||
if (isset($_GET["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];}
|
||||
elseif (isset($_POST["ScrollDIV"])) {$ScrollDIV=$_POST["ScrollDIV"];}
|
||||
if (isset($_GET["ignore_list_script"])) {$ignore_list_script=$_GET["ignore_list_script"];}
|
||||
if (isset($_GET["ignore_list_script"])) {$ignore_list_script=$_GET["ignore_list_script"];}
|
||||
elseif (isset($_POST["ignore_list_script"])) {$ignore_list_script=$_POST["ignore_list_script"];}
|
||||
if (isset($_GET["CF_uses_custom_fields"])) {$CF_uses_custom_fields=$_GET["CF_uses_custom_fields"];}
|
||||
elseif (isset($_POST["CF_uses_custom_fields"])) {$CF_uses_custom_fields=$_POST["CF_uses_custom_fields"];}
|
||||
if (isset($_GET["entry_list_id"])) {$entry_list_id=$_GET["entry_list_id"];}
|
||||
elseif (isset($_POST["entry_list_id"])) {$entry_list_id=$_POST["entry_list_id"];}
|
||||
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
@@ -177,7 +199,6 @@ $CIDdate = date("mdHis");
|
||||
$ENTRYdate = date("YmdHis");
|
||||
$MT[0]='';
|
||||
$agents='@agents';
|
||||
|
||||
$script_height = ($script_height - 20);
|
||||
|
||||
$IFRAME=0;
|
||||
@@ -252,6 +273,19 @@ if (strlen($in_script) < 1)
|
||||
else
|
||||
{$call_script = $in_script;}
|
||||
|
||||
$ignore_list_script_override='N';
|
||||
$stmt = "SELECT ignore_list_script_override FROM vicidial_inbound_groups where group_id='$group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$ilso_ct = mysql_num_rows($rslt);
|
||||
if ($ilso_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$ignore_list_script_override = $row[0];
|
||||
}
|
||||
if ($ignore_list_script_override=='Y')
|
||||
{$ignore_list_script=1;}
|
||||
|
||||
if ($ignore_list_script < 1)
|
||||
{
|
||||
$stmt="SELECT agent_script_override from vicidial_lists where list_id='$list_id';";
|
||||
@@ -262,6 +296,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);
|
||||
@@ -275,6 +315,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);
|
||||
@@ -342,12 +384,18 @@ if (eregi("iframe src",$script_text))
|
||||
$preset_number_f = eregi_replace(' ','+',$preset_number_f);
|
||||
$preset_dtmf_a = eregi_replace(' ','+',$preset_dtmf_a);
|
||||
$preset_dtmf_b = eregi_replace(' ','+',$preset_dtmf_b);
|
||||
$did_id = eregi_replace(' ','+',$did_id);
|
||||
$did_extension = eregi_replace(' ','+',$did_extension);
|
||||
$did_pattern = eregi_replace(' ','+',$did_pattern);
|
||||
$did_description = eregi_replace(' ','+',$did_description);
|
||||
}
|
||||
|
||||
$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);
|
||||
@@ -415,6 +463,36 @@ $script_text = eregi_replace('--A--preset_number_e--B--',"$preset_number_e",$scr
|
||||
$script_text = eregi_replace('--A--preset_number_f--B--',"$preset_number_f",$script_text);
|
||||
$script_text = eregi_replace('--A--preset_dtmf_a--B--',"$preset_dtmf_a",$script_text);
|
||||
$script_text = eregi_replace('--A--preset_dtmf_b--B--',"$preset_dtmf_b",$script_text);
|
||||
$script_text = eregi_replace('--A--did_id--B--',"$did_id",$script_text);
|
||||
$script_text = eregi_replace('--A--did_extension--B--',"$did_extension",$script_text);
|
||||
$script_text = eregi_replace('--A--did_pattern--B--',"$did_pattern",$script_text);
|
||||
$script_text = eregi_replace('--A--did_description--B--',"$did_description",$script_text);
|
||||
$script_text = eregi_replace('--A--closecallid--B--',"$closecallid",$script_text);
|
||||
$script_text = eregi_replace('--A--xfercallid--B--',"$xfercallid",$script_text);
|
||||
$script_text = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$script_text);
|
||||
$script_text = eregi_replace('--A--entry_list_id--B--',"$entry_list_id",$script_text);
|
||||
|
||||
if ($CF_uses_custom_fields=='Y')
|
||||
{
|
||||
### find the names of all custom fields, if any
|
||||
$stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY') and field_label NOT IN('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');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$cffn_ct = mysql_num_rows($rslt);
|
||||
$d=0;
|
||||
while ($cffn_ct > $d)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$field_name_id = $row[0];
|
||||
$field_name_tag = "--A--" . $field_name_id . "--B--";
|
||||
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"];}
|
||||
$script_text = eregi_replace("$field_name_tag","$form_field_value",$script_text);
|
||||
if ($DB) {echo "$d|$field_name_id|$field_name_tag|$form_field_value|<br>\n";}
|
||||
$d++;
|
||||
}
|
||||
}
|
||||
|
||||
$script_text = eregi_replace("\n","<BR>",$script_text);
|
||||
$script_text = stripslashes($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 = 'Τίτλος';
|
||||
$label_first_name = 'Πρώτο';
|
||||
$label_middle_initial = 'MI';
|
||||
$label_last_name = 'Επίθετο';
|
||||
$label_address1 = 'Διεύθυνση1';
|
||||
$label_address2 = 'Διεύθυνση2';
|
||||
$label_address3 = 'Διεύθυνση3';
|
||||
$label_city = 'Πόλη';
|
||||
$label_state = 'Κράτος';
|
||||
$label_province = 'Επαρχία';
|
||||
$label_postal_code = 'Ταχ.Κωδ.';
|
||||
$label_vendor_lead_code = 'ID προμηθευτού';
|
||||
$label_gender = 'Gender';
|
||||
$label_phone_number = 'Τηλ';
|
||||
$label_phone_code = 'Κωδικός Κλήσης';
|
||||
$label_alt_phone = 'Εναλ/κό Τηλ';
|
||||
$label_security_phrase = 'Παρουσίαση';
|
||||
$label_email = 'Ηλεκτρονικό ταχυδρομείο';
|
||||
$label_comments = 'Σχόλια';
|
||||
|
||||
$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 "Ακυρο Όνομα χρήστη/Κωδικός πρόσβασης: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
# do nothing for now
|
||||
}
|
||||
|
||||
echo "<HTML>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- ΕΚΔΟΣΗ: $version ΔΗΜΙΟΥΡΓΙΑ: $build USER: $user server_ip: $server_ip-->\n";
|
||||
echo "<title>ViciDial Σημειώσεις";
|
||||
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">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">Τίτλος: </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 Κράτοςs">
|
||||
<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">Επαρχία: </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">Τηλ 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">Φύλο:</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">Ημερομηνία Γέννησης:</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">Εναλ/κό Τηλ: </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">Ηλεκτρονικό ταχυδρομείο: </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">Παρουσίαση: </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">Σχολιασμός: </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 Σημειώσεις:<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 ΥΠΟΒΑΛΕΤΕ to commit the changes, * 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="ΥΠΟΒΑΛΕΤΕ" name=smt id=smt onClick="submit_form()">
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
</CENTER>
|
||||
|
||||
</B></FONT>
|
||||
</TD>
|
||||
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
+3640
-2943
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user