Files
agc_2-X/www/vicidial/admin.php
T
mattf d00840eecd Added DISPO_SELECT_DISABLED option for the Dispo Disable setting in campaigns
git-svn-id: svn://192.168.202.10@1705 3d104415-ff17-0410-8863-d5cf3c621b8a
2011-07-31 02:54:02 +00:00

30632 lines
1.6 MiB
Plaintext

<?php
# admin.php - VICIDIAL administration page
#
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
require("dbconnect.php");
######################################################################################################
######################################################################################################
####### static variable settings for display options
######################################################################################################
######################################################################################################
$page_width='770';
$section_width='750';
$header_font_size='3';
$subheader_font_size='2';
$subcamp_font_size='2';
$header_selected_bold='<b>';
$header_nonselected_bold='';
$users_color = '#FFFF99';
$campaigns_color = '#FFCC99';
$lists_color = '#FFCCCC';
$ingroups_color = '#CC99FF';
$remoteagent_color ='#CCFFCC';
$usergroups_color = '#CCFFFF';
$scripts_color = '#99FFCC';
$filters_color = '#CCCCCC';
$admin_color = '#FF99FF';
$reports_color = '#99FF33';
$times_color = '#FF33FF';
$shifts_color = '#FF33FF';
$phones_color = '#FF33FF';
$conference_color = '#FF33FF';
$server_color = '#FF33FF';
$templates_color = '#FF33FF';
$carriers_color = '#FF33FF';
$settings_color = '#FF33FF';
$label_color = '#FF33FF';
$status_color = '#FF33FF';
$moh_color = '#FF33FF';
$vm_color = '#FF33FF';
$tts_color = '#FF33FF';
$subcamp_color = '#FF9933';
$users_font = 'BLACK';
$campaigns_font = 'BLACK';
$lists_font = 'BLACK';
$ingroups_font = 'BLACK';
$remoteagent_font = 'BLACK';
$usergroups_font = 'BLACK';
$scripts_font = 'BLACK';
$filters_font = 'BLACK';
$admin_font = 'BLACK';
$reports_font = 'BLACK';
$times_font = 'BLACK';
$phones_font = 'BLACK';
$conference_font = 'BLACK';
$server_font = 'BLACK';
$settings_font = 'BLACK';
$label_font = 'BLACK';
$status_font = 'BLACK';
$moh_font = 'BLACK';
$vm_font = 'BLACK';
$tts_font = 'BLACK';
$subcamp_font = 'BLACK';
### comment this section out for colorful section headings
$users_color = '#E6E6E6';
$campaigns_color = '#E6E6E6';
$lists_color = '#E6E6E6';
$ingroups_color = '#E6E6E6';
$remoteagent_color ='#E6E6E6';
$usergroups_color = '#E6E6E6';
$scripts_color = '#E6E6E6';
$filters_color = '#E6E6E6';
$admin_color = '#E6E6E6';
$reports_color = '#E6E6E6';
$times_color = '#C6C6C6';
$shifts_color = '#C6C6C6';
$phones_color = '#C6C6C6';
$conference_color = '#C6C6C6';
$server_color = '#C6C6C6';
$templates_color = '#C6C6C6';
$carriers_color = '#C6C6C6';
$settings_color = '#C6C6C6';
$label_color = '#C6C6C6';
$status_color = '#C6C6C6';
$moh_color = '#C6C6C6';
$vm_color = '#C6C6C6';
$tts_color = '#C6C6C6';
$subcamp_color = '#C6C6C6';
###
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
$PHP_SELF=$_SERVER['PHP_SELF'];
$QUERY_STRING = getenv("QUERY_STRING");
$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Export Calls Report, Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Single Agent Daily , User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List';
$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Export Calls Report , Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Single Agent Daily , User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Custom Reports Links, CallCard Search';
######################################################################################################
######################################################################################################
####### Form variable declaration
######################################################################################################
######################################################################################################
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
if (isset($_GET["active"])) {$active=$_GET["active"];}
elseif (isset($_POST["active"])) {$active=$_POST["active"];}
if (isset($_GET["adaptive_dl_diff_target"])) {$adaptive_dl_diff_target=$_GET["adaptive_dl_diff_target"];}
elseif (isset($_POST["adaptive_dl_diff_target"])) {$adaptive_dl_diff_target=$_POST["adaptive_dl_diff_target"];}
if (isset($_GET["adaptive_dropped_percentage"])) {$adaptive_dropped_percentage=$_GET["adaptive_dropped_percentage"];}
elseif (isset($_POST["adaptive_dropped_percentage"])){$adaptive_dropped_percentage=$_POST["adaptive_dropped_percentage"];}
if (isset($_GET["adaptive_intensity"])) {$adaptive_intensity=$_GET["adaptive_intensity"];}
elseif (isset($_POST["adaptive_intensity"])) {$adaptive_intensity=$_POST["adaptive_intensity"];}
if (isset($_GET["adaptive_latest_server_time"])) {$adaptive_latest_server_time=$_GET["adaptive_latest_server_time"];}
elseif (isset($_POST["adaptive_latest_server_time"])){$adaptive_latest_server_time=$_POST["adaptive_latest_server_time"];}
if (isset($_GET["adaptive_maximum_level"])) {$adaptive_maximum_level=$_GET["adaptive_maximum_level"];}
elseif (isset($_POST["adaptive_maximum_level"])) {$adaptive_maximum_level=$_POST["adaptive_maximum_level"];}
if (isset($_GET["SUB"])) {$SUB=$_GET["SUB"];}
elseif (isset($_POST["SUB"])) {$SUB=$_POST["SUB"];}
if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];}
elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];}
if (isset($_GET["admin_hangup_enabled"])) {$admin_hangup_enabled=$_GET["admin_hangup_enabled"];}
elseif (isset($_POST["admin_hangup_enabled"])) {$admin_hangup_enabled=$_POST["admin_hangup_enabled"];}
if (isset($_GET["admin_hijack_enabled"])) {$admin_hijack_enabled=$_GET["admin_hijack_enabled"];}
elseif (isset($_POST["admin_hijack_enabled"])) {$admin_hijack_enabled=$_POST["admin_hijack_enabled"];}
if (isset($_GET["admin_monitor_enabled"])) {$admin_monitor_enabled=$_GET["admin_monitor_enabled"];}
elseif (isset($_POST["admin_monitor_enabled"])) {$admin_monitor_enabled=$_POST["admin_monitor_enabled"];}
if (isset($_GET["AFLogging_enabled"])) {$AFLogging_enabled=$_GET["AFLogging_enabled"];}
elseif (isset($_POST["AFLogging_enabled"])) {$AFLogging_enabled=$_POST["AFLogging_enabled"];}
if (isset($_GET["agent_choose_ingroups"])) {$agent_choose_ingroups=$_GET["agent_choose_ingroups"];}
elseif (isset($_POST["agent_choose_ingroups"])) {$agent_choose_ingroups=$_POST["agent_choose_ingroups"];}
if (isset($_GET["agentcall_manual"])) {$agentcall_manual=$_GET["agentcall_manual"];}
elseif (isset($_POST["agentcall_manual"])) {$agentcall_manual=$_POST["agentcall_manual"];}
if (isset($_GET["agentonly_callbacks"])) {$agentonly_callbacks=$_GET["agentonly_callbacks"];}
elseif (isset($_POST["agentonly_callbacks"])) {$agentonly_callbacks=$_POST["agentonly_callbacks"];}
if (isset($_GET["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_GET["AGI_call_logging_enabled"];}
elseif (isset($_POST["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_POST["AGI_call_logging_enabled"];}
if (isset($_GET["agi_output"])) {$agi_output=$_GET["agi_output"];}
elseif (isset($_POST["agi_output"])) {$agi_output=$_POST["agi_output"];}
if (isset($_GET["allcalls_delay"])) {$allcalls_delay=$_GET["allcalls_delay"];}
elseif (isset($_POST["allcalls_delay"])) {$allcalls_delay=$_POST["allcalls_delay"];}
if (isset($_GET["allow_closers"])) {$allow_closers=$_GET["allow_closers"];}
elseif (isset($_POST["allow_closers"])) {$allow_closers=$_POST["allow_closers"];}
if (isset($_GET["alt_number_dialing"])) {$alt_number_dialing=$_GET["alt_number_dialing"];}
elseif (isset($_POST["alt_number_dialing"])) {$alt_number_dialing=$_POST["alt_number_dialing"];}
if (isset($_GET["alter_agent_interface_options"])) {$alter_agent_interface_options=$_GET["alter_agent_interface_options"];}
elseif (isset($_POST["alter_agent_interface_options"])) {$alter_agent_interface_options=$_POST["alter_agent_interface_options"];}
if (isset($_GET["am_message_exten"])) {$am_message_exten=$_GET["am_message_exten"];}
elseif (isset($_POST["am_message_exten"])) {$am_message_exten=$_POST["am_message_exten"];}
if (isset($_GET["amd_send_to_vmx"])) {$amd_send_to_vmx=$_GET["amd_send_to_vmx"];}
elseif (isset($_POST["amd_send_to_vmx"])) {$amd_send_to_vmx=$_POST["amd_send_to_vmx"];}
if (isset($_GET["answer_transfer_agent"])) {$answer_transfer_agent=$_GET["answer_transfer_agent"];}
elseif (isset($_POST["answer_transfer_agent"])) {$answer_transfer_agent=$_POST["answer_transfer_agent"];}
if (isset($_GET["ast_admin_access"])) {$ast_admin_access=$_GET["ast_admin_access"];}
elseif (isset($_POST["ast_admin_access"])) {$ast_admin_access=$_POST["ast_admin_access"];}
if (isset($_GET["ast_delete_phones"])) {$ast_delete_phones=$_GET["ast_delete_phones"];}
elseif (isset($_POST["ast_delete_phones"])) {$ast_delete_phones=$_POST["ast_delete_phones"];}
if (isset($_GET["asterisk_version"])) {$asterisk_version=$_GET["asterisk_version"];}
elseif (isset($_POST["asterisk_version"])) {$asterisk_version=$_POST["asterisk_version"];}
if (isset($_GET["ASTmgrSECRET"])) {$ASTmgrSECRET=$_GET["ASTmgrSECRET"];}
elseif (isset($_POST["ASTmgrSECRET"])) {$ASTmgrSECRET=$_POST["ASTmgrSECRET"];}
if (isset($_GET["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_GET["ASTmgrUSERNAME"];}
elseif (isset($_POST["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_POST["ASTmgrUSERNAME"];}
if (isset($_GET["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_GET["ASTmgrUSERNAMElisten"];}
elseif (isset($_POST["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_POST["ASTmgrUSERNAMElisten"];}
if (isset($_GET["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_GET["ASTmgrUSERNAMEsend"];}
elseif (isset($_POST["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_POST["ASTmgrUSERNAMEsend"];}
if (isset($_GET["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_GET["ASTmgrUSERNAMEupdate"];}
elseif (isset($_POST["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_POST["ASTmgrUSERNAMEupdate"];}
if (isset($_GET["attempt_delay"])) {$attempt_delay=$_GET["attempt_delay"];}
elseif (isset($_POST["attempt_delay"])) {$attempt_delay=$_POST["attempt_delay"];}
if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum"];}
elseif (isset($_POST["attempt_maximum"])) {$attempt_maximum=$_POST["attempt_maximum"];}
if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];}
elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];}
if (isset($_GET["auto_dial_next_number"])) {$auto_dial_next_number=$_GET["auto_dial_next_number"];}
elseif (isset($_POST["auto_dial_next_number"])) {$auto_dial_next_number=$_POST["auto_dial_next_number"];}
if (isset($_GET["available_only_ratio_tally"])) {$available_only_ratio_tally=$_GET["available_only_ratio_tally"];}
elseif (isset($_POST["available_only_ratio_tally"])){$available_only_ratio_tally=$_POST["available_only_ratio_tally"];}
if (isset($_GET["call_out_number_group"])) {$call_out_number_group=$_GET["call_out_number_group"];}
elseif (isset($_POST["call_out_number_group"])) {$call_out_number_group=$_POST["call_out_number_group"];}
if (isset($_GET["call_parking_enabled"])) {$call_parking_enabled=$_GET["call_parking_enabled"];}
elseif (isset($_POST["call_parking_enabled"])) {$call_parking_enabled=$_POST["call_parking_enabled"];}
if (isset($_GET["call_time_comments"])) {$call_time_comments=$_GET["call_time_comments"];}
elseif (isset($_POST["call_time_comments"])) {$call_time_comments=$_POST["call_time_comments"];}
if (isset($_GET["call_time_id"])) {$call_time_id=$_GET["call_time_id"];}
elseif (isset($_POST["call_time_id"])) {$call_time_id=$_POST["call_time_id"];}
if (isset($_GET["call_time_name"])) {$call_time_name=$_GET["call_time_name"];}
elseif (isset($_POST["call_time_name"])) {$call_time_name=$_POST["call_time_name"];}
if (isset($_GET["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_GET["CallerID_popup_enabled"];}
elseif (isset($_POST["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_POST["CallerID_popup_enabled"];}
if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];}
elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];}
if (isset($_GET["campaign_detail"])) {$campaign_detail=$_GET["campaign_detail"];}
elseif (isset($_POST["campaign_detail"])) {$campaign_detail=$_POST["campaign_detail"];}
if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];}
elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];}
if (isset($_GET["campaign_name"])) {$campaign_name=$_GET["campaign_name"];}
elseif (isset($_POST["campaign_name"])) {$campaign_name=$_POST["campaign_name"];}
if (isset($_GET["campaign_rec_exten"])) {$campaign_rec_exten=$_GET["campaign_rec_exten"];}
elseif (isset($_POST["campaign_rec_exten"])) {$campaign_rec_exten=$_POST["campaign_rec_exten"];}
if (isset($_GET["campaign_rec_filename"])) {$campaign_rec_filename=$_GET["campaign_rec_filename"];}
elseif (isset($_POST["campaign_rec_filename"])) {$campaign_rec_filename=$_POST["campaign_rec_filename"];}
if (isset($_GET["ingroup_rec_filename"])) {$ingroup_rec_filename=$_GET["ingroup_rec_filename"];}
elseif (isset($_POST["ingroup_rec_filename"])) {$ingroup_rec_filename=$_POST["ingroup_rec_filename"];}
if (isset($_GET["campaign_recording"])) {$campaign_recording=$_GET["campaign_recording"];}
elseif (isset($_POST["campaign_recording"])) {$campaign_recording=$_POST["campaign_recording"];}
if (isset($_GET["campaign_vdad_exten"])) {$campaign_vdad_exten=$_GET["campaign_vdad_exten"];}
elseif (isset($_POST["campaign_vdad_exten"])) {$campaign_vdad_exten=$_POST["campaign_vdad_exten"];}
if (isset($_GET["change_agent_campaign"])) {$change_agent_campaign=$_GET["change_agent_campaign"];}
elseif (isset($_POST["change_agent_campaign"])) {$change_agent_campaign=$_POST["change_agent_campaign"];}
if (isset($_GET["client_browser"])) {$client_browser=$_GET["client_browser"];}
elseif (isset($_POST["client_browser"])) {$client_browser=$_POST["client_browser"];}
if (isset($_GET["closer_default_blended"])) {$closer_default_blended=$_GET["closer_default_blended"];}
elseif (isset($_POST["closer_default_blended"])) {$closer_default_blended=$_POST["closer_default_blended"];}
if (isset($_GET["company"])) {$company=$_GET["company"];}
elseif (isset($_POST["company"])) {$company=$_POST["company"];}
if (isset($_GET["computer_ip"])) {$computer_ip=$_GET["computer_ip"];}
elseif (isset($_POST["computer_ip"])) {$computer_ip=$_POST["computer_ip"];}
if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];}
elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];}
if (isset($_GET["conf_on_extension"])) {$conf_on_extension=$_GET["conf_on_extension"];}
elseif (isset($_POST["conf_on_extension"])) {$conf_on_extension=$_POST["conf_on_extension"];}
if (isset($_GET["conferencing_enabled"])) {$conferencing_enabled=$_GET["conferencing_enabled"];}
elseif (isset($_POST["conferencing_enabled"])) {$conferencing_enabled=$_POST["conferencing_enabled"];}
if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];}
elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];}
if (isset($_GET["ct_default_start"])) {$ct_default_start=$_GET["ct_default_start"];}
elseif (isset($_POST["ct_default_start"])) {$ct_default_start=$_POST["ct_default_start"];}
if (isset($_GET["ct_default_stop"])) {$ct_default_stop=$_GET["ct_default_stop"];}
elseif (isset($_POST["ct_default_stop"])) {$ct_default_stop=$_POST["ct_default_stop"];}
if (isset($_GET["ct_friday_start"])) {$ct_friday_start=$_GET["ct_friday_start"];}
elseif (isset($_POST["ct_friday_start"])) {$ct_friday_start=$_POST["ct_friday_start"];}
if (isset($_GET["ct_friday_stop"])) {$ct_friday_stop=$_GET["ct_friday_stop"];}
elseif (isset($_POST["ct_friday_stop"])) {$ct_friday_stop=$_POST["ct_friday_stop"];}
if (isset($_GET["ct_monday_start"])) {$ct_monday_start=$_GET["ct_monday_start"];}
elseif (isset($_POST["ct_monday_start"])) {$ct_monday_start=$_POST["ct_monday_start"];}
if (isset($_GET["ct_monday_stop"])) {$ct_monday_stop=$_GET["ct_monday_stop"];}
elseif (isset($_POST["ct_monday_stop"])) {$ct_monday_stop=$_POST["ct_monday_stop"];}
if (isset($_GET["ct_saturday_start"])) {$ct_saturday_start=$_GET["ct_saturday_start"];}
elseif (isset($_POST["ct_saturday_start"])) {$ct_saturday_start=$_POST["ct_saturday_start"];}
if (isset($_GET["ct_saturday_stop"])) {$ct_saturday_stop=$_GET["ct_saturday_stop"];}
elseif (isset($_POST["ct_saturday_stop"])) {$ct_saturday_stop=$_POST["ct_saturday_stop"];}
if (isset($_GET["ct_sunday_start"])) {$ct_sunday_start=$_GET["ct_sunday_start"];}
elseif (isset($_POST["ct_sunday_start"])) {$ct_sunday_start=$_POST["ct_sunday_start"];}
if (isset($_GET["ct_sunday_stop"])) {$ct_sunday_stop=$_GET["ct_sunday_stop"];}
elseif (isset($_POST["ct_sunday_stop"])) {$ct_sunday_stop=$_POST["ct_sunday_stop"];}
if (isset($_GET["ct_thursday_start"])) {$ct_thursday_start=$_GET["ct_thursday_start"];}
elseif (isset($_POST["ct_thursday_start"])) {$ct_thursday_start=$_POST["ct_thursday_start"];}
if (isset($_GET["ct_thursday_stop"])) {$ct_thursday_stop=$_GET["ct_thursday_stop"];}
elseif (isset($_POST["ct_thursday_stop"])) {$ct_thursday_stop=$_POST["ct_thursday_stop"];}
if (isset($_GET["ct_tuesday_start"])) {$ct_tuesday_start=$_GET["ct_tuesday_start"];}
elseif (isset($_POST["ct_tuesday_start"])) {$ct_tuesday_start=$_POST["ct_tuesday_start"];}
if (isset($_GET["ct_tuesday_stop"])) {$ct_tuesday_stop=$_GET["ct_tuesday_stop"];}
elseif (isset($_POST["ct_tuesday_stop"])) {$ct_tuesday_stop=$_POST["ct_tuesday_stop"];}
if (isset($_GET["ct_wednesday_start"])) {$ct_wednesday_start=$_GET["ct_wednesday_start"];}
elseif (isset($_POST["ct_wednesday_start"])) {$ct_wednesday_start=$_POST["ct_wednesday_start"];}
if (isset($_GET["ct_wednesday_stop"])) {$ct_wednesday_stop=$_GET["ct_wednesday_stop"];}
elseif (isset($_POST["ct_wednesday_stop"])) {$ct_wednesday_stop=$_POST["ct_wednesday_stop"];}
if (isset($_GET["DBX_database"])) {$DBX_database=$_GET["DBX_database"];}
elseif (isset($_POST["DBX_database"])) {$DBX_database=$_POST["DBX_database"];}
if (isset($_GET["DBX_pass"])) {$DBX_pass=$_GET["DBX_pass"];}
elseif (isset($_POST["DBX_pass"])) {$DBX_pass=$_POST["DBX_pass"];}
if (isset($_GET["DBX_port"])) {$DBX_port=$_GET["DBX_port"];}
elseif (isset($_POST["DBX_port"])) {$DBX_port=$_POST["DBX_port"];}
if (isset($_GET["DBX_server"])) {$DBX_server=$_GET["DBX_server"];}
elseif (isset($_POST["DBX_server"])) {$DBX_server=$_POST["DBX_server"];}
if (isset($_GET["DBX_user"])) {$DBX_user=$_GET["DBX_user"];}
elseif (isset($_POST["DBX_user"])) {$DBX_user=$_POST["DBX_user"];}
if (isset($_GET["DBY_database"])) {$DBY_database=$_GET["DBY_database"];}
elseif (isset($_POST["DBY_database"])) {$DBY_database=$_POST["DBY_database"];}
if (isset($_GET["DBY_pass"])) {$DBY_pass=$_GET["DBY_pass"];}
elseif (isset($_POST["DBY_pass"])) {$DBY_pass=$_POST["DBY_pass"];}
if (isset($_GET["DBY_port"])) {$DBY_port=$_GET["DBY_port"];}
elseif (isset($_POST["DBY_port"])) {$DBY_port=$_POST["DBY_port"];}
if (isset($_GET["DBY_server"])) {$DBY_server=$_GET["DBY_server"];}
elseif (isset($_POST["DBY_server"])) {$DBY_server=$_POST["DBY_server"];}
if (isset($_GET["DBY_user"])) {$DBY_user=$_GET["DBY_user"];}
elseif (isset($_POST["DBY_user"])) {$DBY_user=$_POST["DBY_user"];}
if (isset($_GET["delete_call_times"])) {$delete_call_times=$_GET["delete_call_times"];}
elseif (isset($_POST["delete_call_times"])) {$delete_call_times=$_POST["delete_call_times"];}
if (isset($_GET["delete_campaigns"])) {$delete_campaigns=$_GET["delete_campaigns"];}
elseif (isset($_POST["delete_campaigns"])) {$delete_campaigns=$_POST["delete_campaigns"];}
if (isset($_GET["delete_filters"])) {$delete_filters=$_GET["delete_filters"];}
elseif (isset($_POST["delete_filters"])) {$delete_filters=$_POST["delete_filters"];}
if (isset($_GET["delete_ingroups"])) {$delete_ingroups=$_GET["delete_ingroups"];}
elseif (isset($_POST["delete_ingroups"])) {$delete_ingroups=$_POST["delete_ingroups"];}
if (isset($_GET["delete_lists"])) {$delete_lists=$_GET["delete_lists"];}
elseif (isset($_POST["delete_lists"])) {$delete_lists=$_POST["delete_lists"];}
if (isset($_GET["delete_remote_agents"])) {$delete_remote_agents=$_GET["delete_remote_agents"];}
elseif (isset($_POST["delete_remote_agents"])) {$delete_remote_agents=$_POST["delete_remote_agents"];}
if (isset($_GET["delete_scripts"])) {$delete_scripts=$_GET["delete_scripts"];}
elseif (isset($_POST["delete_scripts"])) {$delete_scripts=$_POST["delete_scripts"];}
if (isset($_GET["delete_user_groups"])) {$delete_user_groups=$_GET["delete_user_groups"];}
elseif (isset($_POST["delete_user_groups"])) {$delete_user_groups=$_POST["delete_user_groups"];}
if (isset($_GET["delete_users"])) {$delete_users=$_GET["delete_users"];}
elseif (isset($_POST["delete_users"])) {$delete_users=$_POST["delete_users"];}
if (isset($_GET["dial_method"])) {$dial_method=$_GET["dial_method"];}
elseif (isset($_POST["dial_method"])) {$dial_method=$_POST["dial_method"];}
if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];}
elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];}
if (isset($_GET["dial_status_a"])) {$dial_status_a=$_GET["dial_status_a"];}
elseif (isset($_POST["dial_status_a"])) {$dial_status_a=$_POST["dial_status_a"];}
if (isset($_GET["dial_status_b"])) {$dial_status_b=$_GET["dial_status_b"];}
elseif (isset($_POST["dial_status_b"])) {$dial_status_b=$_POST["dial_status_b"];}
if (isset($_GET["dial_status_c"])) {$dial_status_c=$_GET["dial_status_c"];}
elseif (isset($_POST["dial_status_c"])) {$dial_status_c=$_POST["dial_status_c"];}
if (isset($_GET["dial_status_d"])) {$dial_status_d=$_GET["dial_status_d"];}
elseif (isset($_POST["dial_status_d"])) {$dial_status_d=$_POST["dial_status_d"];}
if (isset($_GET["dial_status_e"])) {$dial_status_e=$_GET["dial_status_e"];}
elseif (isset($_POST["dial_status_e"])) {$dial_status_e=$_POST["dial_status_e"];}
if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];}
elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];}
if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];}
elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];}
if (isset($_GET["drop_call_seconds"])) {$drop_call_seconds=$_GET["drop_call_seconds"];}
elseif (isset($_POST["drop_call_seconds"])) {$drop_call_seconds=$_POST["drop_call_seconds"];}
if (isset($_GET["drop_exten"])) {$drop_exten=$_GET["drop_exten"];}
elseif (isset($_POST["drop_exten"])) {$drop_exten=$_POST["drop_exten"];}
if (isset($_GET["drop_action"])) {$drop_action=$_GET["drop_action"];}
elseif (isset($_POST["drop_action"])) {$drop_action=$_POST["drop_action"];}
if (isset($_GET["dtmf_send_extension"])) {$dtmf_send_extension=$_GET["dtmf_send_extension"];}
elseif (isset($_POST["dtmf_send_extension"])) {$dtmf_send_extension=$_POST["dtmf_send_extension"];}
if (isset($_GET["enable_fast_refresh"])) {$enable_fast_refresh=$_GET["enable_fast_refresh"];}
elseif (isset($_POST["enable_fast_refresh"])) {$enable_fast_refresh=$_POST["enable_fast_refresh"];}
if (isset($_GET["enable_persistant_mysql"])) {$enable_persistant_mysql=$_GET["enable_persistant_mysql"];}
elseif (isset($_POST["enable_persistant_mysql"])) {$enable_persistant_mysql=$_POST["enable_persistant_mysql"];}
if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];}
elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];}
if (isset($_GET["extension"])) {$extension=$_GET["extension"];}
elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];}
if (isset($_GET["fast_refresh_rate"])) {$fast_refresh_rate=$_GET["fast_refresh_rate"];}
elseif (isset($_POST["fast_refresh_rate"])) {$fast_refresh_rate=$_POST["fast_refresh_rate"];}
if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];}
elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];}
if (isset($_GET["fronter_display"])) {$fronter_display=$_GET["fronter_display"];}
elseif (isset($_POST["fronter_display"])) {$fronter_display=$_POST["fronter_display"];}
if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];}
elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];}
if (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];}
elseif (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];}
if (isset($_GET["get_call_launch"])) {$get_call_launch=$_GET["get_call_launch"];}
elseif (isset($_POST["get_call_launch"])) {$get_call_launch=$_POST["get_call_launch"];}
if (isset($_GET["group_color"])) {$group_color=$_GET["group_color"];}
elseif (isset($_POST["group_color"])) {$group_color=$_POST["group_color"];}
if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];}
elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];}
if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];}
elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];}
if (isset($_GET["groups"])) {$groups=$_GET["groups"];}
elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];}
if (isset($_GET["XFERgroups"])) {$XFERgroups=$_GET["XFERgroups"];}
elseif (isset($_POST["XFERgroups"])) {$XFERgroups=$_POST["XFERgroups"];}
if (isset($_GET["HKstatus"])) {$HKstatus=$_GET["HKstatus"];}
elseif (isset($_POST["HKstatus"])) {$HKstatus=$_POST["HKstatus"];}
if (isset($_GET["hopper_level"])) {$hopper_level=$_GET["hopper_level"];}
elseif (isset($_POST["hopper_level"])) {$hopper_level=$_POST["hopper_level"];}
if (isset($_GET["hotkey"])) {$hotkey=$_GET["hotkey"];}
elseif (isset($_POST["hotkey"])) {$hotkey=$_POST["hotkey"];}
if (isset($_GET["hotkeys_active"])) {$hotkeys_active=$_GET["hotkeys_active"];}
elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];}
if (isset($_GET["install_directory"])) {$install_directory=$_GET["install_directory"];}
elseif (isset($_POST["install_directory"])) {$install_directory=$_POST["install_directory"];}
if (isset($_GET["lead_filter_comments"])) {$lead_filter_comments=$_GET["lead_filter_comments"];}
elseif (isset($_POST["lead_filter_comments"])) {$lead_filter_comments=$_POST["lead_filter_comments"];}
if (isset($_GET["lead_filter_id"])) {$lead_filter_id=$_GET["lead_filter_id"];}
elseif (isset($_POST["lead_filter_id"])) {$lead_filter_id=$_POST["lead_filter_id"];}
if (isset($_GET["lead_filter_name"])) {$lead_filter_name=$_GET["lead_filter_name"];}
elseif (isset($_POST["lead_filter_name"])) {$lead_filter_name=$_POST["lead_filter_name"];}
if (isset($_GET["lead_filter_sql"])) {$lead_filter_sql=$_GET["lead_filter_sql"];}
elseif (isset($_POST["lead_filter_sql"])) {$lead_filter_sql=$_POST["lead_filter_sql"];}
if (isset($_GET["lead_order"])) {$lead_order=$_GET["lead_order"];}
elseif (isset($_POST["lead_order"])) {$lead_order=$_POST["lead_order"];}
if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];}
elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];}
if (isset($_GET["load_leads"])) {$load_leads=$_GET["load_leads"];}
elseif (isset($_POST["load_leads"])) {$load_leads=$_POST["load_leads"];}
if (isset($_GET["local_call_time"])) {$local_call_time=$_GET["local_call_time"];}
elseif (isset($_POST["local_call_time"])) {$local_call_time=$_POST["local_call_time"];}
if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];}
elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];}
if (isset($_GET["local_web_callerID_URL"])) {$local_web_callerID_URL=$_GET["local_web_callerID_URL"];}
elseif (isset($_POST["local_web_callerID_URL"])) {$local_web_callerID_URL=$_POST["local_web_callerID_URL"];}
if (isset($_GET["login"])) {$login=$_GET["login"];}
elseif (isset($_POST["login"])) {$login=$_POST["login"];}
if (isset($_GET["login_campaign"])) {$login_campaign=$_GET["login_campaign"];}
elseif (isset($_POST["login_campaign"])) {$login_campaign=$_POST["login_campaign"];}
if (isset($_GET["login_pass"])) {$login_pass=$_GET["login_pass"];}
elseif (isset($_POST["login_pass"])) {$login_pass=$_POST["login_pass"];}
if (isset($_GET["login_user"])) {$login_user=$_GET["login_user"];}
elseif (isset($_POST["login_user"])) {$login_user=$_POST["login_user"];}
if (isset($_GET["max_vicidial_trunks"])) {$max_vicidial_trunks=$_GET["max_vicidial_trunks"];}
elseif (isset($_POST["max_vicidial_trunks"])) {$max_vicidial_trunks=$_POST["max_vicidial_trunks"];}
if (isset($_GET["modify_call_times"])) {$modify_call_times=$_GET["modify_call_times"];}
elseif (isset($_POST["modify_call_times"])) {$modify_call_times=$_POST["modify_call_times"];}
if (isset($_GET["modify_leads"])) {$modify_leads=$_GET["modify_leads"];}
elseif (isset($_POST["modify_leads"])) {$modify_leads=$_POST["modify_leads"];}
if (isset($_GET["monitor_prefix"])) {$monitor_prefix=$_GET["monitor_prefix"];}
elseif (isset($_POST["monitor_prefix"])) {$monitor_prefix=$_POST["monitor_prefix"];}
if (isset($_GET["next_agent_call"])) {$next_agent_call=$_GET["next_agent_call"];}
elseif (isset($_POST["next_agent_call"])) {$next_agent_call=$_POST["next_agent_call"];}
if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];}
elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];}
if (isset($_GET["old_campaign_id"])) {$old_campaign_id=$_GET["old_campaign_id"];}
elseif (isset($_POST["old_campaign_id"])) {$old_campaign_id=$_POST["old_campaign_id"];}
if (isset($_GET["old_conf_exten"])) {$old_conf_exten=$_GET["old_conf_exten"];}
elseif (isset($_POST["old_conf_exten"])) {$old_conf_exten=$_POST["old_conf_exten"];}
if (isset($_GET["old_extension"])) {$old_extension=$_GET["old_extension"];}
elseif (isset($_POST["old_extension"])) {$old_extension=$_POST["old_extension"];}
if (isset($_GET["old_server_id"])) {$old_server_id=$_GET["old_server_id"];}
elseif (isset($_POST["old_server_id"])) {$old_server_id=$_POST["old_server_id"];}
if (isset($_GET["old_server_ip"])) {$old_server_ip=$_GET["old_server_ip"];}
elseif (isset($_POST["old_server_ip"])) {$old_server_ip=$_POST["old_server_ip"];}
if (isset($_GET["OLDuser_group"])) {$OLDuser_group=$_GET["OLDuser_group"];}
elseif (isset($_POST["OLDuser_group"])) {$OLDuser_group=$_POST["OLDuser_group"];}
if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];}
elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];}
if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];}
elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];}
if (isset($_GET["park_ext"])) {$park_ext=$_GET["park_ext"];}
elseif (isset($_POST["park_ext"])) {$park_ext=$_POST["park_ext"];}
if (isset($_GET["park_file_name"])) {$park_file_name=$_GET["park_file_name"];}
elseif (isset($_POST["park_file_name"])) {$park_file_name=$_POST["park_file_name"];}
if (isset($_GET["park_on_extension"])) {$park_on_extension=$_GET["park_on_extension"];}
elseif (isset($_POST["park_on_extension"])) {$park_on_extension=$_POST["park_on_extension"];}
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];}
elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];}
if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];}
elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];}
if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];}
elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];}
if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];}
elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];}
if (isset($_GET["phone_type"])) {$phone_type=$_GET["phone_type"];}
elseif (isset($_POST["phone_type"])) {$phone_type=$_POST["phone_type"];}
if (isset($_GET["picture"])) {$picture=$_GET["picture"];}
elseif (isset($_POST["picture"])) {$picture=$_POST["picture"];}
if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];}
elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];}
if (isset($_GET["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_GET["QUEUE_ACTION_enabled"];}
elseif (isset($_POST["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_POST["QUEUE_ACTION_enabled"];}
if (isset($_GET["recording_exten"])) {$recording_exten=$_GET["recording_exten"];}
elseif (isset($_POST["recording_exten"])) {$recording_exten=$_POST["recording_exten"];}
if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];}
elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];}
if (isset($_GET["reset_hopper"])) {$reset_hopper=$_GET["reset_hopper"];}
elseif (isset($_POST["reset_hopper"])) {$reset_hopper=$_POST["reset_hopper"];}
if (isset($_GET["reset_list"])) {$reset_list=$_GET["reset_list"];}
elseif (isset($_POST["reset_list"])) {$reset_list=$_POST["reset_list"];}
if (isset($_GET["safe_harbor_exten"])) {$safe_harbor_exten=$_GET["safe_harbor_exten"];}
elseif (isset($_POST["safe_harbor_exten"])) {$safe_harbor_exten=$_POST["safe_harbor_exten"];}
if (isset($_GET["drop_action"])) {$drop_action=$_GET["drop_action"];}
elseif (isset($_POST["drop_action"])) {$drop_action=$_POST["drop_action"];}
if (isset($_GET["scheduled_callbacks"])) {$scheduled_callbacks=$_GET["scheduled_callbacks"];}
elseif (isset($_POST["scheduled_callbacks"])) {$scheduled_callbacks=$_POST["scheduled_callbacks"];}
if (isset($_GET["script_comments"])) {$script_comments=$_GET["script_comments"];}
elseif (isset($_POST["script_comments"])) {$script_comments=$_POST["script_comments"];}
if (isset($_GET["script_id"])) {$script_id=$_GET["script_id"];}
elseif (isset($_POST["script_id"])) {$script_id=$_POST["script_id"];}
if (isset($_GET["script_name"])) {$script_name=$_GET["script_name"];}
elseif (isset($_POST["script_name"])) {$script_name=$_POST["script_name"];}
if (isset($_GET["script_text"])) {$script_text=$_GET["script_text"];}
elseif (isset($_POST["script_text"])) {$script_text=$_POST["script_text"];}
if (isset($_GET["selectable"])) {$selectable=$_GET["selectable"];}
elseif (isset($_POST["selectable"])) {$selectable=$_POST["selectable"];}
if (isset($_GET["server_description"])) {$server_description=$_GET["server_description"];}
elseif (isset($_POST["server_description"])) {$server_description=$_POST["server_description"];}
if (isset($_GET["server_id"])) {$server_id=$_GET["server_id"];}
elseif (isset($_POST["server_id"])) {$server_id=$_POST["server_id"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
if (isset($_GET["state_call_time_state"])) {$state_call_time_state=$_GET["state_call_time_state"];}
elseif (isset($_POST["state_call_time_state"])) {$state_call_time_state=$_POST["state_call_time_state"];}
if (isset($_GET["state_rule"])) {$state_rule=$_GET["state_rule"];}
elseif (isset($_POST["state_rule"])) {$state_rule=$_POST["state_rule"];}
if (isset($_GET["status"])) {$status=$_GET["status"];}
elseif (isset($_POST["status"])) {$status=$_POST["status"];}
if (isset($_GET["status_id"])) {$status_id=$_GET["status_id"];}
elseif (isset($_POST["status_id"])) {$status_id=$_POST["status_id"];}
if (isset($_GET["status_name"])) {$status_name=$_GET["status_name"];}
elseif (isset($_POST["status_name"])) {$status_name=$_POST["status_name"];}
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
if (isset($_GET["sys_perf_log"])) {$sys_perf_log=$_GET["sys_perf_log"];}
elseif (isset($_POST["sys_perf_log"])) {$sys_perf_log=$_POST["sys_perf_log"];}
if (isset($_GET["telnet_host"])) {$telnet_host=$_GET["telnet_host"];}
elseif (isset($_POST["telnet_host"])) {$telnet_host=$_POST["telnet_host"];}
if (isset($_GET["telnet_port"])) {$telnet_port=$_GET["telnet_port"];}
elseif (isset($_POST["telnet_port"])) {$telnet_port=$_POST["telnet_port"];}
if (isset($_GET["updater_check_enabled"])) {$updater_check_enabled=$_GET["updater_check_enabled"];}
elseif (isset($_POST["updater_check_enabled"])) {$updater_check_enabled=$_POST["updater_check_enabled"];}
if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];}
elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];}
if (isset($_GET["use_campaign_dnc"])) {$use_campaign_dnc=$_GET["use_campaign_dnc"];}
elseif (isset($_POST["use_campaign_dnc"])) {$use_campaign_dnc=$_POST["use_campaign_dnc"];}
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];}
elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];}
if (isset($_GET["user_level"])) {$user_level=$_GET["user_level"];}
elseif (isset($_POST["user_level"])) {$user_level=$_POST["user_level"];}
if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];}
elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];}
if (isset($_GET["user_switching_enabled"])) {$user_switching_enabled=$_GET["user_switching_enabled"];}
elseif (isset($_POST["user_switching_enabled"])) {$user_switching_enabled=$_POST["user_switching_enabled"];}
if (isset($_GET["vd_server_logs"])) {$vd_server_logs=$_GET["vd_server_logs"];}
elseif (isset($_POST["vd_server_logs"])) {$vd_server_logs=$_POST["vd_server_logs"];}
if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];}
elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];}
if (isset($_GET["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_GET["VICIDIAL_park_on_extension"];}
elseif (isset($_POST["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_POST["VICIDIAL_park_on_extension"];}
if (isset($_GET["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_GET["VICIDIAL_park_on_filename"];}
elseif (isset($_POST["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_POST["VICIDIAL_park_on_filename"];}
if (isset($_GET["vicidial_recording"])) {$vicidial_recording=$_GET["vicidial_recording"];}
elseif (isset($_POST["vicidial_recording"])) {$vicidial_recording=$_POST["vicidial_recording"];}
if (isset($_GET["vicidial_transfers"])) {$vicidial_transfers=$_GET["vicidial_transfers"];}
elseif (isset($_POST["vicidial_transfers"])) {$vicidial_transfers=$_POST["vicidial_transfers"];}
if (isset($_GET["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_GET["VICIDIAL_web_URL"];}
elseif (isset($_POST["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_POST["VICIDIAL_web_URL"];}
if (isset($_GET["voicemail_button_enabled"])) {$voicemail_button_enabled=$_GET["voicemail_button_enabled"];}
elseif (isset($_POST["voicemail_button_enabled"])) {$voicemail_button_enabled=$_POST["voicemail_button_enabled"];}
if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];}
elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];}
if (isset($_GET["voicemail_ext"])) {$voicemail_ext=$_GET["voicemail_ext"];}
elseif (isset($_POST["voicemail_ext"])) {$voicemail_ext=$_POST["voicemail_ext"];}
if (isset($_GET["voicemail_exten"])) {$voicemail_exten=$_GET["voicemail_exten"];}
elseif (isset($_POST["voicemail_exten"])) {$voicemail_exten=$_POST["voicemail_exten"];}
if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];}
elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];}
if (isset($_GET["web_form_address"])) {$web_form_address=$_GET["web_form_address"];}
elseif (isset($_POST["web_form_address"])) {$web_form_address=$_POST["web_form_address"];}
if (isset($_GET["wrapup_message"])) {$wrapup_message=$_GET["wrapup_message"];}
elseif (isset($_POST["wrapup_message"])) {$wrapup_message=$_POST["wrapup_message"];}
if (isset($_GET["wrapup_seconds"])) {$wrapup_seconds=$_GET["wrapup_seconds"];}
elseif (isset($_POST["wrapup_seconds"])) {$wrapup_seconds=$_POST["wrapup_seconds"];}
if (isset($_GET["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_GET["xferconf_a_dtmf"];}
elseif (isset($_POST["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_POST["xferconf_a_dtmf"];}
if (isset($_GET["xferconf_a_number"])) {$xferconf_a_number=$_GET["xferconf_a_number"];}
elseif (isset($_POST["xferconf_a_number"])) {$xferconf_a_number=$_POST["xferconf_a_number"];}
if (isset($_GET["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_GET["xferconf_b_dtmf"];}
elseif (isset($_POST["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_POST["xferconf_b_dtmf"];}
if (isset($_GET["xferconf_b_number"])) {$xferconf_b_number=$_GET["xferconf_b_number"];}
elseif (isset($_POST["xferconf_b_number"])) {$xferconf_b_number=$_POST["xferconf_b_number"];}
if (isset($_GET["vicidial_balance_active"])) {$vicidial_balance_active=$_GET["vicidial_balance_active"];}
elseif (isset($_POST["vicidial_balance_active"])) {$vicidial_balance_active=$_POST["vicidial_balance_active"];}
if (isset($_GET["balance_trunks_offlimits"])) {$balance_trunks_offlimits=$_GET["balance_trunks_offlimits"];}
elseif (isset($_POST["balance_trunks_offlimits"])) {$balance_trunks_offlimits=$_POST["balance_trunks_offlimits"];}
if (isset($_GET["dedicated_trunks"])) {$dedicated_trunks=$_GET["dedicated_trunks"];}
elseif (isset($_POST["dedicated_trunks"])) {$dedicated_trunks=$_POST["dedicated_trunks"];}
if (isset($_GET["trunk_restriction"])) {$trunk_restriction=$_GET["trunk_restriction"];}
elseif (isset($_POST["trunk_restriction"])) {$trunk_restriction=$_POST["trunk_restriction"];}
if (isset($_GET["campaigns"])) {$campaigns=$_GET["campaigns"];}
elseif (isset($_POST["campaigns"])) {$campaigns=$_POST["campaigns"];}
if (isset($_GET["dial_level_override"])) {$dial_level_override=$_GET["dial_level_override"];}
elseif (isset($_POST["dial_level_override"])) {$dial_level_override=$_POST["dial_level_override"];}
if (isset($_GET["concurrent_transfers"])) {$concurrent_transfers=$_GET["concurrent_transfers"];}
elseif (isset($_POST["concurrent_transfers"])) {$concurrent_transfers=$_POST["concurrent_transfers"];}
if (isset($_GET["auto_alt_dial"])) {$auto_alt_dial=$_GET["auto_alt_dial"];}
elseif (isset($_POST["auto_alt_dial"])) {$auto_alt_dial=$_POST["auto_alt_dial"];}
if (isset($_GET["modify_users"])) {$modify_users=$_GET["modify_users"];}
elseif (isset($_POST["modify_users"])) {$modify_users=$_POST["modify_users"];}
if (isset($_GET["modify_campaigns"])) {$modify_campaigns=$_GET["modify_campaigns"];}
elseif (isset($_POST["modify_campaigns"])) {$modify_campaigns=$_POST["modify_campaigns"];}
if (isset($_GET["modify_lists"])) {$modify_lists=$_GET["modify_lists"];}
elseif (isset($_POST["modify_lists"])) {$modify_lists=$_POST["modify_lists"];}
if (isset($_GET["modify_scripts"])) {$modify_scripts=$_GET["modify_scripts"];}
elseif (isset($_POST["modify_scripts"])) {$modify_scripts=$_POST["modify_scripts"];}
if (isset($_GET["modify_filters"])) {$modify_filters=$_GET["modify_filters"];}
elseif (isset($_POST["modify_filters"])) {$modify_filters=$_POST["modify_filters"];}
if (isset($_GET["modify_ingroups"])) {$modify_ingroups=$_GET["modify_ingroups"];}
elseif (isset($_POST["modify_ingroups"])) {$modify_ingroups=$_POST["modify_ingroups"];}
if (isset($_GET["modify_usergroups"])) {$modify_usergroups=$_GET["modify_usergroups"];}
elseif (isset($_POST["modify_usergroups"])) {$modify_usergroups=$_POST["modify_usergroups"];}
if (isset($_GET["modify_remoteagents"])) {$modify_remoteagents=$_GET["modify_remoteagents"];}
elseif (isset($_POST["modify_remoteagents"])) {$modify_remoteagents=$_POST["modify_remoteagents"];}
if (isset($_GET["modify_servers"])) {$modify_servers=$_GET["modify_servers"];}
elseif (isset($_POST["modify_servers"])) {$modify_servers=$_POST["modify_servers"];}
if (isset($_GET["view_reports"])) {$view_reports=$_GET["view_reports"];}
elseif (isset($_POST["view_reports"])) {$view_reports=$_POST["view_reports"];}
if (isset($_GET["agent_pause_codes_active"])) {$agent_pause_codes_active=$_GET["agent_pause_codes_active"];}
elseif (isset($_POST["agent_pause_codes_active"])) {$agent_pause_codes_active=$_POST["agent_pause_codes_active"];}
if (isset($_GET["pause_code"])) {$pause_code=$_GET["pause_code"];}
elseif (isset($_POST["pause_code"])) {$pause_code=$_POST["pause_code"];}
if (isset($_GET["pause_code_name"])) {$pause_code_name=$_GET["pause_code_name"];}
elseif (isset($_POST["pause_code_name"])) {$pause_code_name=$_POST["pause_code_name"];}
if (isset($_GET["billable"])) {$billable=$_GET["billable"];}
elseif (isset($_POST["billable"])) {$billable=$_POST["billable"];}
if (isset($_GET["campaign_description"])) {$campaign_description=$_GET["campaign_description"];}
elseif (isset($_POST["campaign_description"])) {$campaign_description=$_POST["campaign_description"];}
if (isset($_GET["campaign_stats_refresh"])) {$campaign_stats_refresh=$_GET["campaign_stats_refresh"];}
elseif (isset($_POST["campaign_stats_refresh"])){$campaign_stats_refresh=$_POST["campaign_stats_refresh"];}
if (isset($_GET["list_description"])) {$list_description=$_GET["list_description"];}
elseif (isset($_POST["list_description"])) {$list_description=$_POST["list_description"];}
if (isset($_GET["vicidial_recording_override"])) {$vicidial_recording_override=$_GET["vicidial_recording_override"];}
elseif (isset($_POST["vicidial_recording_override"])) {$vicidial_recording_override=$_POST["vicidial_recording_override"];}
if (isset($_GET["use_non_latin"])) {$use_non_latin=$_GET["use_non_latin"];}
elseif (isset($_POST["use_non_latin"])) {$use_non_latin=$_POST["use_non_latin"];}
if (isset($_GET["webroot_writable"])) {$webroot_writable=$_GET["webroot_writable"];}
elseif (isset($_POST["webroot_writable"])) {$webroot_writable=$_POST["webroot_writable"];}
if (isset($_GET["enable_queuemetrics_logging"])) {$enable_queuemetrics_logging=$_GET["enable_queuemetrics_logging"];}
elseif (isset($_POST["enable_queuemetrics_logging"])) {$enable_queuemetrics_logging=$_POST["enable_queuemetrics_logging"];}
if (isset($_GET["queuemetrics_server_ip"])) {$queuemetrics_server_ip=$_GET["queuemetrics_server_ip"];}
elseif (isset($_POST["queuemetrics_server_ip"])) {$queuemetrics_server_ip=$_POST["queuemetrics_server_ip"];}
if (isset($_GET["queuemetrics_dbname"])) {$queuemetrics_dbname=$_GET["queuemetrics_dbname"];}
elseif (isset($_POST["queuemetrics_dbname"])) {$queuemetrics_dbname=$_POST["queuemetrics_dbname"];}
if (isset($_GET["queuemetrics_login"])) {$queuemetrics_login=$_GET["queuemetrics_login"];}
elseif (isset($_POST["queuemetrics_login"])) {$queuemetrics_login=$_POST["queuemetrics_login"];}
if (isset($_GET["queuemetrics_pass"])) {$queuemetrics_pass=$_GET["queuemetrics_pass"];}
elseif (isset($_POST["queuemetrics_pass"])) {$queuemetrics_pass=$_POST["queuemetrics_pass"];}
if (isset($_GET["queuemetrics_url"])) {$queuemetrics_url=$_GET["queuemetrics_url"];}
elseif (isset($_POST["queuemetrics_url"])) {$queuemetrics_url=$_POST["queuemetrics_url"];}
if (isset($_GET["queuemetrics_log_id"])) {$queuemetrics_log_id=$_GET["queuemetrics_log_id"];}
elseif (isset($_POST["queuemetrics_log_id"])) {$queuemetrics_log_id=$_POST["queuemetrics_log_id"];}
if (isset($_GET["dial_status"])) {$dial_status=$_GET["dial_status"];}
elseif (isset($_POST["dial_status"])) {$dial_status=$_POST["dial_status"];}
if (isset($_GET["queuemetrics_eq_prepend"])) {$queuemetrics_eq_prepend=$_GET["queuemetrics_eq_prepend"];}
elseif (isset($_POST["queuemetrics_eq_prepend"])) {$queuemetrics_eq_prepend=$_POST["queuemetrics_eq_prepend"];}
if (isset($_GET["vicidial_agent_disable"])) {$vicidial_agent_disable=$_GET["vicidial_agent_disable"];}
elseif (isset($_POST["vicidial_agent_disable"])) {$vicidial_agent_disable=$_POST["vicidial_agent_disable"];}
if (isset($_GET["disable_alter_custdata"])) {$disable_alter_custdata=$_GET["disable_alter_custdata"];}
elseif (isset($_POST["disable_alter_custdata"])) {$disable_alter_custdata=$_POST["disable_alter_custdata"];}
if (isset($_GET["alter_custdata_override"])) {$alter_custdata_override=$_GET["alter_custdata_override"];}
elseif (isset($_POST["alter_custdata_override"])) {$alter_custdata_override=$_POST["alter_custdata_override"];}
if (isset($_GET["no_hopper_leads_logins"])) {$no_hopper_leads_logins=$_GET["no_hopper_leads_logins"];}
elseif (isset($_POST["no_hopper_leads_logins"])) {$no_hopper_leads_logins=$_POST["no_hopper_leads_logins"];}
if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["enable_sipsak_messages"];}
elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];}
if (isset($_GET["allow_sipsak_messages"])) {$allow_sipsak_messages=$_GET["allow_sipsak_messages"];}
elseif (isset($_POST["allow_sipsak_messages"])) {$allow_sipsak_messages=$_POST["allow_sipsak_messages"];}
if (isset($_GET["admin_home_url"])) {$admin_home_url=$_GET["admin_home_url"];}
elseif (isset($_POST["admin_home_url"])) {$admin_home_url=$_POST["admin_home_url"];}
if (isset($_GET["list_order_mix"])) {$list_order_mix=$_GET["list_order_mix"];}
elseif (isset($_POST["list_order_mix"])) {$list_order_mix=$_POST["list_order_mix"];}
if (isset($_GET["vcl_id"])) {$vcl_id=$_GET["vcl_id"];}
elseif (isset($_POST["vcl_id"])) {$vcl_id=$_POST["vcl_id"];}
if (isset($_GET["vcl_name"])) {$vcl_name=$_GET["vcl_name"];}
elseif (isset($_POST["vcl_name"])) {$vcl_name=$_POST["vcl_name"];}
if (isset($_GET["list_mix_container"])) {$list_mix_container=$_GET["list_mix_container"];}
elseif (isset($_POST["list_mix_container"])) {$list_mix_container=$_POST["list_mix_container"];}
if (isset($_GET["mix_method"])) {$mix_method=$_GET["mix_method"];}
elseif (isset($_POST["mix_method"])) {$mix_method=$_POST["mix_method"];}
if (isset($_GET["human_answered"])) {$human_answered=$_GET["human_answered"];}
elseif (isset($_POST["human_answered"])) {$human_answered=$_POST["human_answered"];}
if (isset($_GET["category"])) {$category=$_GET["category"];}
elseif (isset($_POST["category"])) {$category=$_POST["category"];}
if (isset($_GET["vsc_id"])) {$vsc_id=$_GET["vsc_id"];}
elseif (isset($_POST["vsc_id"])) {$vsc_id=$_POST["vsc_id"];}
if (isset($_GET["vsc_name"])) {$vsc_name=$_GET["vsc_name"];}
elseif (isset($_POST["vsc_name"])) {$vsc_name=$_POST["vsc_name"];}
if (isset($_GET["vsc_description"])) {$vsc_description=$_GET["vsc_description"];}
elseif (isset($_POST["vsc_description"])) {$vsc_description=$_POST["vsc_description"];}
if (isset($_GET["tovdad_display"])) {$tovdad_display=$_GET["tovdad_display"];}
elseif (isset($_POST["tovdad_display"])) {$tovdad_display=$_POST["tovdad_display"];}
if (isset($_GET["mix_container_item"])) {$mix_container_item=$_GET["mix_container_item"];}
elseif (isset($_POST["mix_container_item"])) {$mix_container_item=$_POST["mix_container_item"];}
if (isset($_GET["enable_agc_xfer_log"])) {$enable_agc_xfer_log=$_GET["enable_agc_xfer_log"];}
elseif (isset($_POST["enable_agc_xfer_log"])) {$enable_agc_xfer_log=$_POST["enable_agc_xfer_log"];}
if (isset($_GET["after_hours_action"])) {$after_hours_action=$_GET["after_hours_action"];}
elseif (isset($_POST["after_hours_action"])) {$after_hours_action=$_POST["after_hours_action"];}
if (isset($_GET["after_hours_message_filename"])) {$after_hours_message_filename=$_GET["after_hours_message_filename"];}
elseif (isset($_POST["after_hours_message_filename"])) {$after_hours_message_filename=$_POST["after_hours_message_filename"];}
if (isset($_GET["after_hours_exten"])) {$after_hours_exten=$_GET["after_hours_exten"];}
elseif (isset($_POST["after_hours_exten"])) {$after_hours_exten=$_POST["after_hours_exten"];}
if (isset($_GET["after_hours_voicemail"])) {$after_hours_voicemail=$_GET["after_hours_voicemail"];}
elseif (isset($_POST["after_hours_voicemail"])) {$after_hours_voicemail=$_POST["after_hours_voicemail"];}
if (isset($_GET["welcome_message_filename"])) {$welcome_message_filename=$_GET["welcome_message_filename"];}
elseif (isset($_POST["welcome_message_filename"])) {$welcome_message_filename=$_POST["welcome_message_filename"];}
if (isset($_GET["moh_context"])) {$moh_context=$_GET["moh_context"];}
elseif (isset($_POST["moh_context"])) {$moh_context=$_POST["moh_context"];}
if (isset($_GET["onhold_prompt_filename"])) {$onhold_prompt_filename=$_GET["onhold_prompt_filename"];}
elseif (isset($_POST["onhold_prompt_filename"])) {$onhold_prompt_filename=$_POST["onhold_prompt_filename"];}
if (isset($_GET["prompt_interval"])) {$prompt_interval=$_GET["prompt_interval"];}
elseif (isset($_POST["prompt_interval"])) {$prompt_interval=$_POST["prompt_interval"];}
if (isset($_GET["agent_alert_exten"])) {$agent_alert_exten=$_GET["agent_alert_exten"];}
elseif (isset($_POST["agent_alert_exten"])) {$agent_alert_exten=$_POST["agent_alert_exten"];}
if (isset($_GET["agent_alert_delay"])) {$agent_alert_delay=$_GET["agent_alert_delay"];}
elseif (isset($_POST["agent_alert_delay"])) {$agent_alert_delay=$_POST["agent_alert_delay"];}
if (isset($_GET["group_rank"])) {$group_rank=$_GET["group_rank"];}
elseif (isset($_POST["group_rank"])) {$group_rank=$_POST["group_rank"];}
if (isset($_GET["campaign_allow_inbound"])) {$campaign_allow_inbound=$_GET["campaign_allow_inbound"];}
elseif (isset($_POST["campaign_allow_inbound"])) {$campaign_allow_inbound=$_POST["campaign_allow_inbound"];}
if (isset($_GET["old_campaign_allow_inbound"])) {$old_campaign_allow_inbound=$_GET["old_campaign_allow_inbound"];}
elseif (isset($_POST["old_campaign_allow_inbound"])) {$old_campaign_allow_inbound=$_POST["old_campaign_allow_inbound"];}
if (isset($_GET["manual_dial_list_id"])) {$manual_dial_list_id=$_GET["manual_dial_list_id"];}
elseif (isset($_POST["manual_dial_list_id"])) {$manual_dial_list_id=$_POST["manual_dial_list_id"];}
if (isset($_GET["campaign_rank"])) {$campaign_rank=$_GET["campaign_rank"];}
elseif (isset($_POST["campaign_rank"])) {$campaign_rank=$_POST["campaign_rank"];}
if (isset($_GET["source_campaign_id"])) {$source_campaign_id=$_GET["source_campaign_id"];}
elseif (isset($_POST["source_campaign_id"])) {$source_campaign_id=$_POST["source_campaign_id"];}
if (isset($_GET["source_user_id"])) {$source_user_id=$_GET["source_user_id"];}
elseif (isset($_POST["source_user_id"])) {$source_user_id=$_POST["source_user_id"];}
if (isset($_GET["source_group_id"])) {$source_group_id=$_GET["source_group_id"];}
elseif (isset($_POST["source_group_id"])) {$source_group_id=$_POST["source_group_id"];}
if (isset($_GET["default_xfer_group"])) {$default_xfer_group=$_GET["default_xfer_group"];}
elseif (isset($_POST["default_xfer_group"])) {$default_xfer_group=$_POST["default_xfer_group"];}
if (isset($_GET["qc_enabled"])) {$qc_enabled=$_GET["qc_enabled"];}
elseif (isset($_POST["qc_enabled"])) {$qc_enabled=$_POST["qc_enabled"];}
if (isset($_GET["qc_user_level"])) {$qc_user_level=$_GET["qc_user_level"];}
elseif (isset($_POST["qc_user_level"])) {$qc_user_level=$_POST["qc_user_level"];}
if (isset($_GET["qc_pass"])) {$qc_pass=$_GET["qc_pass"];}
elseif (isset($_POST["qc_pass"])) {$qc_pass=$_POST["qc_pass"];}
if (isset($_GET["qc_finish"])) {$qc_finish=$_GET["qc_finish"];}
elseif (isset($_POST["qc_finish"])) {$qc_finish=$_POST["qc_finish"];}
if (isset($_GET["qc_commit"])) {$qc_commit=$_GET["qc_commit"];}
elseif (isset($_POST["qc_commit"])) {$qc_commit=$_POST["qc_commit"];}
if (isset($_GET["qc_campaigns"])) {$qc_campaigns=$_GET["qc_campaigns"];}
elseif (isset($_POST["qc_campaigns"])) {$qc_campaigns=$_POST["qc_campaigns"];}
if (isset($_GET["qc_groups"])) {$qc_groups=$_GET["qc_groups"];}
elseif (isset($_POST["qc_groups"])) {$qc_groups=$_POST["qc_groups"];}
if (isset($_GET["queue_priority"])) {$queue_priority=$_GET["queue_priority"];}
elseif (isset($_POST["queue_priority"])) {$queue_priority=$_POST["queue_priority"];}
if (isset($_GET["drop_inbound_group"])) {$drop_inbound_group=$_GET["drop_inbound_group"];}
elseif (isset($_POST["drop_inbound_group"])) {$drop_inbound_group=$_POST["drop_inbound_group"];}
if (isset($_GET["qc_statuses"])) {$qc_statuses=$_GET["qc_statuses"];}
elseif (isset($_POST["qc_statuses"])) {$qc_statuses=$_POST["qc_statuses"];}
if (isset($_GET["qc_lists"])) {$qc_lists=$_GET["qc_lists"];}
elseif (isset($_POST["qc_lists"])) {$qc_lists=$_POST["qc_lists"];}
if (isset($_GET["qc_get_record_launch"])) {$qc_get_record_launch=$_GET["qc_get_record_launch"];}
elseif (isset($_POST["qc_get_record_launch"])) {$qc_get_record_launch=$_POST["qc_get_record_launch"];}
if (isset($_GET["qc_show_recording"])) {$qc_show_recording=$_GET["qc_show_recording"];}
elseif (isset($_POST["qc_show_recording"])) {$qc_show_recording=$_POST["qc_show_recording"];}
if (isset($_GET["qc_shift_id"])) {$qc_shift_id=$_GET["qc_shift_id"];}
elseif (isset($_POST["qc_shift_id"])) {$qc_shift_id=$_POST["qc_shift_id"];}
if (isset($_GET["qc_web_form_address"])) {$qc_web_form_address=$_GET["qc_web_form_address"];}
elseif (isset($_POST["qc_web_form_address"])) {$qc_web_form_address=$_POST["qc_web_form_address"];}
if (isset($_GET["qc_script"])) {$qc_script=$_GET["qc_script"];}
elseif (isset($_POST["qc_script"])) {$qc_script=$_POST["qc_script"];}
if (isset($_GET["ingroup_recording_override"])) {$ingroup_recording_override=$_GET["ingroup_recording_override"];}
elseif (isset($_POST["ingroup_recording_override"])) {$ingroup_recording_override=$_POST["ingroup_recording_override"];}
if (isset($_GET["code"])) {$code=$_GET["code"];}
elseif (isset($_POST["code"])) {$code=$_POST["code"];}
if (isset($_GET["code_name"])) {$code_name=$_GET["code_name"];}
elseif (isset($_POST["code_name"])) {$code_name=$_POST["code_name"];}
if (isset($_GET["afterhours_xfer_group"])) {$afterhours_xfer_group=$_GET["afterhours_xfer_group"];}
elseif (isset($_POST["afterhours_xfer_group"])) {$afterhours_xfer_group=$_POST["afterhours_xfer_group"];}
if (isset($_GET["alias_id"])) {$alias_id=$_GET["alias_id"];}
elseif (isset($_POST["alias_id"])) {$alias_id=$_POST["alias_id"];}
if (isset($_GET["alias_name"])) {$alias_name=$_GET["alias_name"];}
elseif (isset($_POST["alias_name"])) {$alias_name=$_POST["alias_name"];}
if (isset($_GET["logins_list"])) {$logins_list=$_GET["logins_list"];}
elseif (isset($_POST["logins_list"])) {$logins_list=$_POST["logins_list"];}
if (isset($_GET["shift_id"])) {$shift_id=$_GET["shift_id"];}
elseif (isset($_POST["shift_id"])) {$shift_id=$_POST["shift_id"];}
if (isset($_GET["shift_name"])) {$shift_name=$_GET["shift_name"];}
elseif (isset($_POST["shift_name"])) {$shift_name=$_POST["shift_name"];}
if (isset($_GET["shift_start_time"])) {$shift_start_time=$_GET["shift_start_time"];}
elseif (isset($_POST["shift_start_time"])) {$shift_start_time=$_POST["shift_start_time"];}
if (isset($_GET["shift_length"])) {$shift_length=$_GET["shift_length"];}
elseif (isset($_POST["shift_length"])) {$shift_length=$_POST["shift_length"];}
if (isset($_GET["shift_weekdays"])) {$shift_weekdays=$_GET["shift_weekdays"];}
elseif (isset($_POST["shift_weekdays"])) {$shift_weekdays=$_POST["shift_weekdays"];}
if (isset($_GET["group_shifts"])) {$group_shifts=$_GET["group_shifts"];}
elseif (isset($_POST["group_shifts"])) {$group_shifts=$_POST["group_shifts"];}
if (isset($_GET["timeclock_end_of_day"])) {$timeclock_end_of_day=$_GET["timeclock_end_of_day"];}
elseif (isset($_POST["timeclock_end_of_day"])) {$timeclock_end_of_day=$_POST["timeclock_end_of_day"];}
if (isset($_GET["survey_first_audio_file"])) {$survey_first_audio_file=$_GET["survey_first_audio_file"];}
elseif (isset($_POST["survey_first_audio_file"])) {$survey_first_audio_file=$_POST["survey_first_audio_file"];}
if (isset($_GET["survey_dtmf_digits"])) {$survey_dtmf_digits=$_GET["survey_dtmf_digits"];}
elseif (isset($_POST["survey_dtmf_digits"])) {$survey_dtmf_digits=$_POST["survey_dtmf_digits"];}
if (isset($_GET["survey_ni_digit"])) {$survey_ni_digit=$_GET["survey_ni_digit"];}
elseif (isset($_POST["survey_ni_digit"])) {$survey_ni_digit=$_POST["survey_ni_digit"];}
if (isset($_GET["survey_opt_in_audio_file"])) {$survey_opt_in_audio_file=$_GET["survey_opt_in_audio_file"];}
elseif (isset($_POST["survey_opt_in_audio_file"])) {$survey_opt_in_audio_file=$_POST["survey_opt_in_audio_file"];}
if (isset($_GET["survey_ni_audio_file"])) {$survey_ni_audio_file=$_GET["survey_ni_audio_file"];}
elseif (isset($_POST["survey_ni_audio_file"])) {$survey_ni_audio_file=$_POST["survey_ni_audio_file"];}
if (isset($_GET["survey_method"])) {$survey_method=$_GET["survey_method"];}
elseif (isset($_POST["survey_method"])) {$survey_method=$_POST["survey_method"];}
if (isset($_GET["survey_no_response_action"])) {$survey_no_response_action=$_GET["survey_no_response_action"];}
elseif (isset($_POST["survey_no_response_action"])) {$survey_no_response_action=$_POST["survey_no_response_action"];}
if (isset($_GET["survey_ni_status"])) {$survey_ni_status=$_GET["survey_ni_status"];}
elseif (isset($_POST["survey_ni_status"])) {$survey_ni_status=$_POST["survey_ni_status"];}
if (isset($_GET["survey_response_digit_map"])) {$survey_response_digit_map=$_GET["survey_response_digit_map"];}
elseif (isset($_POST["survey_response_digit_map"])) {$survey_response_digit_map=$_POST["survey_response_digit_map"];}
if (isset($_GET["survey_xfer_exten"])) {$survey_xfer_exten=$_GET["survey_xfer_exten"];}
elseif (isset($_POST["survey_xfer_exten"])) {$survey_xfer_exten=$_POST["survey_xfer_exten"];}
if (isset($_GET["survey_camp_record_dir"])) {$survey_camp_record_dir=$_GET["survey_camp_record_dir"];}
elseif (isset($_POST["survey_camp_record_dir"])) {$survey_camp_record_dir=$_POST["survey_camp_record_dir"];}
if (isset($_GET["add_timeclock_log"])) {$add_timeclock_log=$_GET["add_timeclock_log"];}
elseif (isset($_POST["add_timeclock_log"])) {$add_timeclock_log=$_POST["add_timeclock_log"];}
if (isset($_GET["modify_timeclock_log"])) {$modify_timeclock_log=$_GET["modify_timeclock_log"];}
elseif (isset($_POST["modify_timeclock_log"])) {$modify_timeclock_log=$_POST["modify_timeclock_log"];}
if (isset($_GET["delete_timeclock_log"])) {$delete_timeclock_log=$_GET["delete_timeclock_log"];}
elseif (isset($_POST["delete_timeclock_log"])) {$delete_timeclock_log=$_POST["delete_timeclock_log"];}
if (isset($_GET["phone_numbers"])) {$phone_numbers=$_GET["phone_numbers"];}
elseif (isset($_POST["phone_numbers"])) {$phone_numbers=$_POST["phone_numbers"];}
if (isset($_GET["vdc_header_date_format"])) {$vdc_header_date_format=$_GET["vdc_header_date_format"];}
elseif (isset($_POST["vdc_header_date_format"])) {$vdc_header_date_format=$_POST["vdc_header_date_format"];}
if (isset($_GET["vdc_customer_date_format"])) {$vdc_customer_date_format=$_GET["vdc_customer_date_format"];}
elseif (isset($_POST["vdc_customer_date_format"])) {$vdc_customer_date_format=$_POST["vdc_customer_date_format"];}
if (isset($_GET["vdc_header_phone_format"])) {$vdc_header_phone_format=$_GET["vdc_header_phone_format"];}
elseif (isset($_POST["vdc_header_phone_format"])) {$vdc_header_phone_format=$_POST["vdc_header_phone_format"];}
if (isset($_GET["disable_alter_custphone"])) {$disable_alter_custphone=$_GET["disable_alter_custphone"];}
elseif (isset($_POST["disable_alter_custphone"])) {$disable_alter_custphone=$_POST["disable_alter_custphone"];}
if (isset($_GET["alter_custphone_override"])) {$alter_custphone_override=$_GET["alter_custphone_override"];}
elseif (isset($_POST["alter_custphone_override"])) {$alter_custphone_override=$_POST["alter_custphone_override"];}
if (isset($_GET["vdc_agent_api_access"])) {$vdc_agent_api_access=$_GET["vdc_agent_api_access"];}
elseif (isset($_POST["vdc_agent_api_access"])) {$vdc_agent_api_access=$_POST["vdc_agent_api_access"];}
if (isset($_GET["vdc_agent_api_active"])) {$vdc_agent_api_active=$_GET["vdc_agent_api_active"];}
elseif (isset($_POST["vdc_agent_api_active"])) {$vdc_agent_api_active=$_POST["vdc_agent_api_active"];}
if (isset($_GET["display_queue_count"])) {$display_queue_count=$_GET["display_queue_count"];}
elseif (isset($_POST["display_queue_count"])) {$display_queue_count=$_POST["display_queue_count"];}
if (isset($_GET["sale_category"])) {$sale_category=$_GET["sale_category"];}
elseif (isset($_POST["sale_category"])) {$sale_category=$_POST["sale_category"];}
if (isset($_GET["dead_lead_category"])) {$dead_lead_category=$_GET["dead_lead_category"];}
elseif (isset($_POST["dead_lead_category"])) {$dead_lead_category=$_POST["dead_lead_category"];}
if (isset($_GET["manual_dial_filter"])) {$manual_dial_filter=$_GET["manual_dial_filter"];}
elseif (isset($_POST["manual_dial_filter"])) {$manual_dial_filter=$_POST["manual_dial_filter"];}
if (isset($_GET["agent_clipboard_copy"])) {$agent_clipboard_copy=$_GET["agent_clipboard_copy"];}
elseif (isset($_POST["agent_clipboard_copy"])) {$agent_clipboard_copy=$_POST["agent_clipboard_copy"];}
if (isset($_GET["agent_extended_alt_dial"])) {$agent_extended_alt_dial=$_GET["agent_extended_alt_dial"];}
elseif (isset($_POST["agent_extended_alt_dial"])) {$agent_extended_alt_dial=$_POST["agent_extended_alt_dial"];}
if (isset($_GET["play_place_in_line"])) {$play_place_in_line=$_GET["play_place_in_line"];}
elseif (isset($_POST["play_place_in_line"])) {$play_place_in_line=$_POST["play_place_in_line"];}
if (isset($_GET["play_estimate_hold_time"])) {$play_estimate_hold_time=$_GET["play_estimate_hold_time"];}
elseif (isset($_POST["play_estimate_hold_time"])) {$play_estimate_hold_time=$_POST["play_estimate_hold_time"];}
if (isset($_GET["hold_time_option"])) {$hold_time_option=$_GET["hold_time_option"];}
elseif (isset($_POST["hold_time_option"])) {$hold_time_option=$_POST["hold_time_option"];}
if (isset($_GET["hold_time_option_seconds"])) {$hold_time_option_seconds=$_GET["hold_time_option_seconds"];}
elseif (isset($_POST["hold_time_option_seconds"])) {$hold_time_option_seconds=$_POST["hold_time_option_seconds"];}
if (isset($_GET["hold_time_option_exten"])) {$hold_time_option_exten=$_GET["hold_time_option_exten"];}
elseif (isset($_POST["hold_time_option_exten"])) {$hold_time_option_exten=$_POST["hold_time_option_exten"];}
if (isset($_GET["hold_time_option_voicemail"])) {$hold_time_option_voicemail=$_GET["hold_time_option_voicemail"];}
elseif (isset($_POST["hold_time_option_voicemail"])) {$hold_time_option_voicemail=$_POST["hold_time_option_voicemail"];}
if (isset($_GET["hold_time_option_xfer_group"])) {$hold_time_option_xfer_group=$_GET["hold_time_option_xfer_group"];}
elseif (isset($_POST["hold_time_option_xfer_group"])) {$hold_time_option_xfer_group=$_POST["hold_time_option_xfer_group"];}
if (isset($_GET["hold_time_option_callback_filename"])) {$hold_time_option_callback_filename=$_GET["hold_time_option_callback_filename"];}
elseif (isset($_POST["hold_time_option_callback_filename"])) {$hold_time_option_callback_filename=$_POST["hold_time_option_callback_filename"];}
if (isset($_GET["hold_time_option_callback_list_id"])) {$hold_time_option_callback_list_id=$_GET["hold_time_option_callback_list_id"];}
elseif (isset($_POST["hold_time_option_callback_list_id"])) {$hold_time_option_callback_list_id=$_POST["hold_time_option_callback_list_id"];}
if (isset($_GET["hold_recall_xfer_group"])) {$hold_recall_xfer_group=$_GET["hold_recall_xfer_group"];}
elseif (isset($_POST["hold_recall_xfer_group"])) {$hold_recall_xfer_group=$_POST["hold_recall_xfer_group"];}
if (isset($_GET["no_delay_call_route"])) {$no_delay_call_route=$_GET["no_delay_call_route"];}
elseif (isset($_POST["no_delay_call_route"])) {$no_delay_call_route=$_POST["no_delay_call_route"];}
if (isset($_GET["play_welcome_message"])) {$play_welcome_message=$_GET["play_welcome_message"];}
elseif (isset($_POST["play_welcome_message"])) {$play_welcome_message=$_POST["play_welcome_message"];}
if (isset($_GET["did_id"])) {$did_id=$_GET["did_id"];}
elseif (isset($_POST["did_id"])) {$did_id=$_POST["did_id"];}
if (isset($_GET["source_did"])) {$source_did=$_GET["source_did"];}
elseif (isset($_POST["source_did"])) {$source_did=$_POST["source_did"];}
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["did_active"])) {$did_active=$_GET["did_active"];}
elseif (isset($_POST["did_active"])) {$did_active=$_POST["did_active"];}
if (isset($_GET["did_route"])) {$did_route=$_GET["did_route"];}
elseif (isset($_POST["did_route"])) {$did_route=$_POST["did_route"];}
if (isset($_GET["exten_context"])) {$exten_context=$_GET["exten_context"];}
elseif (isset($_POST["exten_context"])) {$exten_context=$_POST["exten_context"];}
if (isset($_GET["phone"])) {$phone=$_GET["phone"];}
elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];}
if (isset($_GET["user_unavailable_action"])) {$user_unavailable_action=$_GET["user_unavailable_action"];}
elseif (isset($_POST["user_unavailable_action"])) {$user_unavailable_action=$_POST["user_unavailable_action"];}
if (isset($_GET["user_route_settings_ingroup"])) {$user_route_settings_ingroup=$_GET["user_route_settings_ingroup"];}
elseif (isset($_POST["user_route_settings_ingroup"])) {$user_route_settings_ingroup=$_POST["user_route_settings_ingroup"];}
if (isset($_GET["call_handle_method"])) {$call_handle_method=$_GET["call_handle_method"];}
elseif (isset($_POST["call_handle_method"])) {$call_handle_method=$_POST["call_handle_method"];}
if (isset($_GET["agent_search_method"])) {$agent_search_method=$_GET["agent_search_method"];}
elseif (isset($_POST["agent_search_method"])) {$agent_search_method=$_POST["agent_search_method"];}
if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];}
elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];}
if (isset($_GET["email"])) {$email=$_GET["email"];}
elseif (isset($_POST["email"])) {$email=$_POST["email"];}
if (isset($_GET["modify_inbound_dids"])) {$modify_inbound_dids=$_GET["modify_inbound_dids"];}
elseif (isset($_POST["modify_inbound_dids"])) {$modify_inbound_dids=$_POST["modify_inbound_dids"];}
if (isset($_GET["delete_inbound_dids"])) {$delete_inbound_dids=$_GET["delete_inbound_dids"];}
elseif (isset($_POST["delete_inbound_dids"])) {$delete_inbound_dids=$_POST["delete_inbound_dids"];}
if (isset($_GET["three_way_call_cid"])) {$three_way_call_cid=$_GET["three_way_call_cid"];}
elseif (isset($_POST["three_way_call_cid"])) {$three_way_call_cid=$_POST["three_way_call_cid"];}
if (isset($_GET["three_way_dial_prefix"])) {$three_way_dial_prefix=$_GET["three_way_dial_prefix"];}
elseif (isset($_POST["three_way_dial_prefix"])) {$three_way_dial_prefix=$_POST["three_way_dial_prefix"];}
if (isset($_GET["forced_timeclock_login"])) {$forced_timeclock_login=$_GET["forced_timeclock_login"];}
elseif (isset($_POST["forced_timeclock_login"])) {$forced_timeclock_login=$_POST["forced_timeclock_login"];}
if (isset($_GET["answer_sec_pct_rt_stat_one"])) {$answer_sec_pct_rt_stat_one=$_GET["answer_sec_pct_rt_stat_one"];}
elseif (isset($_POST["answer_sec_pct_rt_stat_one"])) {$answer_sec_pct_rt_stat_one=$_POST["answer_sec_pct_rt_stat_one"];}
if (isset($_GET["answer_sec_pct_rt_stat_two"])) {$answer_sec_pct_rt_stat_two=$_GET["answer_sec_pct_rt_stat_two"];}
elseif (isset($_POST["answer_sec_pct_rt_stat_two"])) {$answer_sec_pct_rt_stat_two=$_POST["answer_sec_pct_rt_stat_two"];}
if (isset($_GET["list_active_change"])) {$list_active_change=$_GET["list_active_change"];}
elseif (isset($_POST["list_active_change"])) {$list_active_change=$_POST["list_active_change"];}
if (isset($_GET["web_form_target"])) {$web_form_target=$_GET["web_form_target"];}
elseif (isset($_POST["web_form_target"])) {$web_form_target=$_POST["web_form_target"];}
if (isset($_GET["alt_server_ip"])) {$alt_server_ip=$_GET["alt_server_ip"];}
elseif (isset($_POST["alt_server_ip"])) {$alt_server_ip=$_POST["alt_server_ip"];}
if (isset($_GET["recording_web_link"])) {$recording_web_link=$_GET["recording_web_link"];}
elseif (isset($_POST["recording_web_link"])) {$recording_web_link=$_POST["recording_web_link"];}
if (isset($_GET["enable_vtiger_integration"])) {$enable_vtiger_integration=$_GET["enable_vtiger_integration"];}
elseif (isset($_POST["enable_vtiger_integration"])) {$enable_vtiger_integration=$_POST["enable_vtiger_integration"];}
if (isset($_GET["vtiger_server_ip"])) {$vtiger_server_ip=$_GET["vtiger_server_ip"];}
elseif (isset($_POST["vtiger_server_ip"])) {$vtiger_server_ip=$_POST["vtiger_server_ip"];}
if (isset($_GET["vtiger_dbname"])) {$vtiger_dbname=$_GET["vtiger_dbname"];}
elseif (isset($_POST["vtiger_dbname"])) {$vtiger_dbname=$_POST["vtiger_dbname"];}
if (isset($_GET["vtiger_login"])) {$vtiger_login=$_GET["vtiger_login"];}
elseif (isset($_POST["vtiger_login"])) {$vtiger_login=$_POST["vtiger_login"];}
if (isset($_GET["vtiger_pass"])) {$vtiger_pass=$_GET["vtiger_pass"];}
elseif (isset($_POST["vtiger_pass"])) {$vtiger_pass=$_POST["vtiger_pass"];}
if (isset($_GET["vtiger_url"])) {$vtiger_url=$_GET["vtiger_url"];}
elseif (isset($_POST["vtiger_url"])) {$vtiger_url=$_POST["vtiger_url"];}
if (isset($_GET["vtiger_search_category"])) {$vtiger_search_category=$_GET["vtiger_search_category"];}
elseif (isset($_POST["vtiger_search_category"])) {$vtiger_search_category=$_POST["vtiger_search_category"];}
if (isset($_GET["vtiger_create_call_record"])) {$vtiger_create_call_record=$_GET["vtiger_create_call_record"];}
elseif (isset($_POST["vtiger_create_call_record"])) {$vtiger_create_call_record=$_POST["vtiger_create_call_record"];}
if (isset($_GET["vtiger_create_lead_record"])) {$vtiger_create_lead_record=$_GET["vtiger_create_lead_record"];}
elseif (isset($_POST["vtiger_create_lead_record"])) {$vtiger_create_lead_record=$_POST["vtiger_create_lead_record"];}
if (isset($_GET["vtiger_screen_login"])) {$vtiger_screen_login=$_GET["vtiger_screen_login"];}
elseif (isset($_POST["vtiger_screen_login"])) {$vtiger_screen_login=$_POST["vtiger_screen_login"];}
if (isset($_GET["qc_features_active"])) {$qc_features_active=$_GET["qc_features_active"];}
elseif (isset($_POST["qc_features_active"])) {$qc_features_active=$_POST["qc_features_active"];}
if (isset($_GET["outbound_autodial_active"])) {$outbound_autodial_active=$_GET["outbound_autodial_active"];}
elseif (isset($_POST["outbound_autodial_active"])) {$outbound_autodial_active=$_POST["outbound_autodial_active"];}
if (isset($_GET["cpd_amd_action"])) {$cpd_amd_action=$_GET["cpd_amd_action"];}
elseif (isset($_POST["cpd_amd_action"])) {$cpd_amd_action=$_POST["cpd_amd_action"];}
if (isset($_GET["download_lists"])) {$download_lists=$_GET["download_lists"];}
elseif (isset($_POST["download_lists"])) {$download_lists=$_POST["download_lists"];}
if (isset($_GET["active_asterisk_server"])) {$active_asterisk_server=$_GET["active_asterisk_server"];}
elseif (isset($_POST["active_asterisk_server"])) {$active_asterisk_server=$_POST["active_asterisk_server"];}
if (isset($_GET["generate_vicidial_conf"])) {$generate_vicidial_conf=$_GET["generate_vicidial_conf"];}
elseif (isset($_POST["generate_vicidial_conf"])) {$generate_vicidial_conf=$_POST["generate_vicidial_conf"];}
if (isset($_GET["rebuild_conf_files"])) {$rebuild_conf_files=$_GET["rebuild_conf_files"];}
elseif (isset($_POST["rebuild_conf_files"])) {$rebuild_conf_files=$_POST["rebuild_conf_files"];}
if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];}
elseif (isset($_POST["template_id"])) {$template_id=$_POST["template_id"];}
if (isset($_GET["conf_override"])) {$conf_override=$_GET["conf_override"];}
elseif (isset($_POST["conf_override"])) {$conf_override=$_POST["conf_override"];}
if (isset($_GET["template_name"])) {$template_name=$_GET["template_name"];}
elseif (isset($_POST["template_name"])) {$template_name=$_POST["template_name"];}
if (isset($_GET["template_contents"])) {$template_contents=$_GET["template_contents"];}
elseif (isset($_POST["template_contents"])) {$template_contents=$_POST["template_contents"];}
if (isset($_GET["carrier_id"])) {$carrier_id=$_GET["carrier_id"];}
elseif (isset($_POST["carrier_id"])) {$carrier_id=$_POST["carrier_id"];}
if (isset($_GET["carrier_name"])) {$carrier_name=$_GET["carrier_name"];}
elseif (isset($_POST["carrier_name"])) {$carrier_name=$_POST["carrier_name"];}
if (isset($_GET["registration_string"])) {$registration_string=$_GET["registration_string"];}
elseif (isset($_POST["registration_string"])) {$registration_string=$_POST["registration_string"];}
if (isset($_GET["account_entry"])) {$account_entry=$_GET["account_entry"];}
elseif (isset($_POST["account_entry"])) {$account_entry=$_POST["account_entry"];}
if (isset($_GET["globals_string"])) {$globals_string=$_GET["globals_string"];}
elseif (isset($_POST["globals_string"])) {$globals_string=$_POST["globals_string"];}
if (isset($_GET["dialplan_entry"])) {$dialplan_entry=$_GET["dialplan_entry"];}
elseif (isset($_POST["dialplan_entry"])) {$dialplan_entry=$_POST["dialplan_entry"];}
if (isset($_GET["group_alias_id"])) {$group_alias_id=$_GET["group_alias_id"];}
elseif (isset($_POST["group_alias_id"])) {$group_alias_id=$_POST["group_alias_id"];}
if (isset($_GET["group_alias_name"])) {$group_alias_name=$_GET["group_alias_name"];}
elseif (isset($_POST["group_alias_name"])) {$group_alias_name=$_POST["group_alias_name"];}
if (isset($_GET["caller_id_number"])) {$caller_id_number=$_GET["caller_id_number"];}
elseif (isset($_POST["caller_id_number"])) {$caller_id_number=$_POST["caller_id_number"];}
if (isset($_GET["caller_id_name"])) {$caller_id_name=$_GET["caller_id_name"];}
elseif (isset($_POST["caller_id_name"])) {$caller_id_name=$_POST["caller_id_name"];}
if (isset($_GET["agent_allow_group_alias"])) {$agent_allow_group_alias=$_GET["agent_allow_group_alias"];}
elseif (isset($_POST["agent_allow_group_alias"])) {$agent_allow_group_alias=$_POST["agent_allow_group_alias"];}
if (isset($_GET["default_group_alias"])) {$default_group_alias=$_GET["default_group_alias"];}
elseif (isset($_POST["default_group_alias"])) {$default_group_alias=$_POST["default_group_alias"];}
if (isset($_GET["outbound_calls_per_second"])) {$outbound_calls_per_second=$_GET["outbound_calls_per_second"];}
elseif (isset($_POST["outbound_calls_per_second"])) {$outbound_calls_per_second=$_POST["outbound_calls_per_second"];}
if (isset($_GET["shift_enforcement"])) {$shift_enforcement=$_GET["shift_enforcement"];}
elseif (isset($_POST["shift_enforcement"])) {$shift_enforcement=$_POST["shift_enforcement"];}
if (isset($_GET["agent_shift_enforcement_override"])) {$agent_shift_enforcement_override=$_GET["agent_shift_enforcement_override"];}
elseif (isset($_POST["agent_shift_enforcement_override"])) {$agent_shift_enforcement_override=$_POST["agent_shift_enforcement_override"];}
if (isset($_GET["manager_shift_enforcement_override"])) {$manager_shift_enforcement_override=$_GET["manager_shift_enforcement_override"];}
elseif (isset($_POST["manager_shift_enforcement_override"])) {$manager_shift_enforcement_override=$_POST["manager_shift_enforcement_override"];}
if (isset($_GET["export_reports"])) {$export_reports=$_GET["export_reports"];}
elseif (isset($_POST["export_reports"])) {$export_reports=$_POST["export_reports"];}
if (isset($_GET["delete_from_dnc"])) {$delete_from_dnc=$_GET["delete_from_dnc"];}
elseif (isset($_POST["delete_from_dnc"])) {$delete_from_dnc=$_POST["delete_from_dnc"];}
if (isset($_GET["vtiger_search_dead"])) {$vtiger_search_dead=$_GET["vtiger_search_dead"];}
elseif (isset($_POST["vtiger_search_dead"])) {$vtiger_search_dead=$_POST["vtiger_search_dead"];}
if (isset($_GET["vtiger_status_call"])) {$vtiger_status_call=$_GET["vtiger_status_call"];}
elseif (isset($_POST["vtiger_status_call"])) {$vtiger_status_call=$_POST["vtiger_status_call"];}
if (isset($_GET["sale"])) {$sale=$_GET["sale"];}
elseif (isset($_POST["sale"])) {$sale=$_POST["sale"];}
if (isset($_GET["dnc"])) {$dnc=$_GET["dnc"];}
elseif (isset($_POST["dnc"])) {$dnc=$_POST["dnc"];}
if (isset($_GET["customer_contact"])) {$customer_contact=$_GET["customer_contact"];}
elseif (isset($_POST["customer_contact"])) {$customer_contact=$_POST["customer_contact"];}
if (isset($_GET["not_interested"])) {$not_interested=$_GET["not_interested"];}
elseif (isset($_POST["not_interested"])) {$not_interested=$_POST["not_interested"];}
if (isset($_GET["unworkable"])) {$unworkable=$_GET["unworkable"];}
elseif (isset($_POST["unworkable"])) {$unworkable=$_POST["unworkable"];}
if (isset($_GET["user_code"])) {$user_code=$_GET["user_code"];}
elseif (isset($_POST["user_code"])) {$user_code=$_POST["user_code"];}
if (isset($_GET["territory"])) {$territory=$_GET["territory"];}
elseif (isset($_POST["territory"])) {$territory=$_POST["territory"];}
if (isset($_GET["survey_third_digit"])) {$survey_third_digit=$_GET["survey_third_digit"];}
elseif (isset($_POST["survey_third_digit"])) {$survey_third_digit=$_POST["survey_third_digit"];}
if (isset($_GET["survey_fourth_digit"])) {$survey_fourth_digit=$_GET["survey_fourth_digit"];}
elseif (isset($_POST["survey_fourth_digit"])) {$survey_fourth_digit=$_POST["survey_fourth_digit"];}
if (isset($_GET["survey_third_audio_file"])) {$survey_third_audio_file=$_GET["survey_third_audio_file"];}
elseif (isset($_POST["survey_third_audio_file"])) {$survey_third_audio_file=$_POST["survey_third_audio_file"];}
if (isset($_GET["survey_fourth_audio_file"])) {$survey_fourth_audio_file=$_GET["survey_fourth_audio_file"];}
elseif (isset($_POST["survey_fourth_audio_file"])) {$survey_fourth_audio_file=$_POST["survey_fourth_audio_file"];}
if (isset($_GET["survey_third_status"])) {$survey_third_status=$_GET["survey_third_status"];}
elseif (isset($_POST["survey_third_status"])) {$survey_third_status=$_POST["survey_third_status"];}
if (isset($_GET["survey_fourth_status"])) {$survey_fourth_status=$_GET["survey_fourth_status"];}
elseif (isset($_POST["survey_fourth_status"])) {$survey_fourth_status=$_POST["survey_fourth_status"];}
if (isset($_GET["survey_third_exten"])) {$survey_third_exten=$_GET["survey_third_exten"];}
elseif (isset($_POST["survey_third_exten"])) {$survey_third_exten=$_POST["survey_third_exten"];}
if (isset($_GET["survey_fourth_exten"])) {$survey_fourth_exten=$_GET["survey_fourth_exten"];}
elseif (isset($_POST["survey_fourth_exten"])) {$survey_fourth_exten=$_POST["survey_fourth_exten"];}
if (isset($_GET["menu_id"])) {$menu_id=$_GET["menu_id"];}
elseif (isset($_POST["menu_id"])) {$menu_id=$_POST["menu_id"];}
if (isset($_GET["menu_name"])) {$menu_name=$_GET["menu_name"];}
elseif (isset($_POST["menu_name"])) {$menu_name=$_POST["menu_name"];}
if (isset($_GET["menu_prompt"])) {$menu_prompt=$_GET["menu_prompt"];}
elseif (isset($_POST["menu_prompt"])) {$menu_prompt=$_POST["menu_prompt"];}
if (isset($_GET["menu_timeout"])) {$menu_timeout=$_GET["menu_timeout"];}
elseif (isset($_POST["menu_timeout"])) {$menu_timeout=$_POST["menu_timeout"];}
if (isset($_GET["menu_timeout_prompt"])) {$menu_timeout_prompt=$_GET["menu_timeout_prompt"];}
elseif (isset($_POST["menu_timeout_prompt"])) {$menu_timeout_prompt=$_POST["menu_timeout_prompt"];}
if (isset($_GET["menu_invalid_prompt"])) {$menu_invalid_prompt=$_GET["menu_invalid_prompt"];}
elseif (isset($_POST["menu_invalid_prompt"])) {$menu_invalid_prompt=$_POST["menu_invalid_prompt"];}
if (isset($_GET["menu_repeat"])) {$menu_repeat=$_GET["menu_repeat"];}
elseif (isset($_POST["menu_repeat"])) {$menu_repeat=$_POST["menu_repeat"];}
if (isset($_GET["menu_time_check"])) {$menu_time_check=$_GET["menu_time_check"];}
elseif (isset($_POST["menu_time_check"])) {$menu_time_check=$_POST["menu_time_check"];}
if (isset($_GET["track_in_vdac"])) {$track_in_vdac=$_GET["track_in_vdac"];}
elseif (isset($_POST["track_in_vdac"])) {$track_in_vdac=$_POST["track_in_vdac"];}
if (isset($_GET["source_menu"])) {$source_menu=$_GET["source_menu"];}
elseif (isset($_POST["source_menu"])) {$source_menu=$_POST["source_menu"];}
if (isset($_GET["agentonly_callback_campaign_lock"])) {$agentonly_callback_campaign_lock=$_GET["agentonly_callback_campaign_lock"];}
elseif (isset($_POST["agentonly_callback_campaign_lock"])) {$agentonly_callback_campaign_lock=$_POST["agentonly_callback_campaign_lock"];}
if (isset($_GET["sounds_central_control_active"])) {$sounds_central_control_active=$_GET["sounds_central_control_active"];}
elseif (isset($_POST["sounds_central_control_active"])) {$sounds_central_control_active=$_POST["sounds_central_control_active"];}
if (isset($_GET["sounds_web_server"])) {$sounds_web_server=$_GET["sounds_web_server"];}
elseif (isset($_POST["sounds_web_server"])) {$sounds_web_server=$_POST["sounds_web_server"];}
if (isset($_GET["sounds_web_directory"])) {$sounds_web_directory=$_GET["sounds_web_directory"];}
elseif (isset($_POST["sounds_web_directory"])) {$sounds_web_directory=$_POST["sounds_web_directory"];}
if (isset($_GET["sounds_update"])) {$sounds_update=$_GET["sounds_update"];}
elseif (isset($_POST["sounds_update"])) {$sounds_update=$_POST["sounds_update"];}
if (isset($_GET["active_voicemail_server"])) {$active_voicemail_server=$_GET["active_voicemail_server"];}
elseif (isset($_POST["active_voicemail_server"])) {$active_voicemail_server=$_POST["active_voicemail_server"];}
if (isset($_GET["auto_dial_limit"])) {$auto_dial_limit=$_GET["auto_dial_limit"];}
elseif (isset($_POST["auto_dial_limit"])) {$auto_dial_limit=$_POST["auto_dial_limit"];}
if (isset($_GET["user_territories_active"])) {$user_territories_active=$_GET["user_territories_active"];}
elseif (isset($_POST["user_territories_active"])) {$user_territories_active=$_POST["user_territories_active"];}
if (isset($_GET["vicidial_recording_limit"])) {$vicidial_recording_limit=$_GET["vicidial_recording_limit"];}
elseif (isset($_POST["vicidial_recording_limit"])) {$vicidial_recording_limit=$_POST["vicidial_recording_limit"];}
if (isset($_GET["phone_context"])) {$phone_context=$_GET["phone_context"];}
elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];}
if (isset($_GET["carrier_logging_active"])) {$carrier_logging_active=$_GET["carrier_logging_active"];}
elseif (isset($_POST["carrier_logging_active"])) {$carrier_logging_active=$_POST["carrier_logging_active"];}
if (isset($_GET["drop_lockout_time"])) {$drop_lockout_time=$_GET["drop_lockout_time"];}
elseif (isset($_POST["drop_lockout_time"])) {$drop_lockout_time=$_POST["drop_lockout_time"];}
if (isset($_GET["allow_custom_dialplan"])) {$allow_custom_dialplan=$_GET["allow_custom_dialplan"];}
elseif (isset($_POST["allow_custom_dialplan"])) {$allow_custom_dialplan=$_POST["allow_custom_dialplan"];}
if (isset($_GET["custom_dialplan_entry"])) {$custom_dialplan_entry=$_GET["custom_dialplan_entry"];}
elseif (isset($_POST["custom_dialplan_entry"])) {$custom_dialplan_entry=$_POST["custom_dialplan_entry"];}
if (isset($_GET["phone_ring_timeout"])) {$phone_ring_timeout=$_GET["phone_ring_timeout"];}
elseif (isset($_POST["phone_ring_timeout"])) {$phone_ring_timeout=$_POST["phone_ring_timeout"];}
if (isset($_GET["conf_secret"])) {$conf_secret=$_GET["conf_secret"];}
elseif (isset($_POST["conf_secret"])) {$conf_secret=$_POST["conf_secret"];}
if (isset($_GET["tracking_group"])) {$tracking_group=$_GET["tracking_group"];}
elseif (isset($_POST["tracking_group"])) {$tracking_group=$_POST["tracking_group"];}
if (isset($_GET["no_agent_no_queue"])) {$no_agent_no_queue=$_GET["no_agent_no_queue"];}
elseif (isset($_POST["no_agent_no_queue"])) {$no_agent_no_queue=$_POST["no_agent_no_queue"];}
if (isset($_GET["no_agent_action"])) {$no_agent_action=$_GET["no_agent_action"];}
elseif (isset($_POST["no_agent_action"])) {$no_agent_action=$_POST["no_agent_action"];}
if (isset($_GET["no_agent_action_value"])) {$no_agent_action_value=$_GET["no_agent_action_value"];}
elseif (isset($_POST["no_agent_action_value"])) {$no_agent_action_value=$_POST["no_agent_action_value"];}
if (isset($_GET["quick_transfer_button"])) {$quick_transfer_button=$_GET["quick_transfer_button"];}
elseif (isset($_POST["quick_transfer_button"])) {$quick_transfer_button=$_POST["quick_transfer_button"];}
if (isset($_GET["prepopulate_transfer_preset"])) {$prepopulate_transfer_preset=$_GET["prepopulate_transfer_preset"];}
elseif (isset($_POST["prepopulate_transfer_preset"])) {$prepopulate_transfer_preset=$_POST["prepopulate_transfer_preset"];}
if (isset($_GET["enable_tts_integration"])) {$enable_tts_integration=$_GET["enable_tts_integration"];}
elseif (isset($_POST["enable_tts_integration"])) {$enable_tts_integration=$_POST["enable_tts_integration"];}
if (isset($_GET["tts_id"])) {$tts_id=$_GET["tts_id"];}
elseif (isset($_POST["tts_id"])) {$tts_id=$_POST["tts_id"];}
if (isset($_GET["tts_name"])) {$tts_name=$_GET["tts_name"];}
elseif (isset($_POST["tts_name"])) {$tts_name=$_POST["tts_name"];}
if (isset($_GET["tts_text"])) {$tts_text=$_GET["tts_text"];}
elseif (isset($_POST["tts_text"])) {$tts_text=$_POST["tts_text"];}
if (isset($_GET["drop_rate_group"])) {$drop_rate_group=$_GET["drop_rate_group"];}
elseif (isset($_POST["drop_rate_group"])) {$drop_rate_group=$_POST["drop_rate_group"];}
if (isset($_GET["agent_status_viewable_groups"])) {$agent_status_viewable_groups=$_GET["agent_status_viewable_groups"];}
elseif (isset($_POST["agent_status_viewable_groups"])) {$agent_status_viewable_groups=$_POST["agent_status_viewable_groups"];}
if (isset($_GET["agent_status_view_time"])) {$agent_status_view_time=$_GET["agent_status_view_time"];}
elseif (isset($_POST["agent_status_view_time"])) {$agent_status_view_time=$_POST["agent_status_view_time"];}
if (isset($_GET["view_calls_in_queue"])) {$view_calls_in_queue=$_GET["view_calls_in_queue"];}
elseif (isset($_POST["view_calls_in_queue"])) {$view_calls_in_queue=$_POST["view_calls_in_queue"];}
if (isset($_GET["view_calls_in_queue_launch"])) {$view_calls_in_queue_launch=$_GET["view_calls_in_queue_launch"];}
elseif (isset($_POST["view_calls_in_queue_launch"])) {$view_calls_in_queue_launch=$_POST["view_calls_in_queue_launch"];}
if (isset($_GET["grab_calls_in_queue"])) {$grab_calls_in_queue=$_GET["grab_calls_in_queue"];}
elseif (isset($_POST["grab_calls_in_queue"])) {$grab_calls_in_queue=$_POST["grab_calls_in_queue"];}
if (isset($_GET["call_requeue_button"])) {$call_requeue_button=$_GET["call_requeue_button"];}
elseif (isset($_POST["call_requeue_button"])) {$call_requeue_button=$_POST["call_requeue_button"];}
if (isset($_GET["pause_after_each_call"])) {$pause_after_each_call=$_GET["pause_after_each_call"];}
elseif (isset($_POST["pause_after_each_call"])) {$pause_after_each_call=$_POST["pause_after_each_call"];}
if (isset($_GET["no_hopper_dialing"])) {$no_hopper_dialing=$_GET["no_hopper_dialing"];}
elseif (isset($_POST["no_hopper_dialing"])) {$no_hopper_dialing=$_POST["no_hopper_dialing"];}
if (isset($_GET["agent_dial_owner_only"])) {$agent_dial_owner_only=$_GET["agent_dial_owner_only"];}
elseif (isset($_POST["agent_dial_owner_only"])) {$agent_dial_owner_only=$_POST["agent_dial_owner_only"];}
if (isset($_GET["reset_time"])) {$reset_time=$_GET["reset_time"];}
elseif (isset($_POST["reset_time"])) {$reset_time=$_POST["reset_time"];}
if (isset($_GET["allow_alerts"])) {$allow_alerts=$_GET["allow_alerts"];}
elseif (isset($_POST["allow_alerts"])) {$allow_alerts=$_POST["allow_alerts"];}
if (isset($_GET["agent_display_dialable_leads"])) {$agent_display_dialable_leads=$_GET["agent_display_dialable_leads"];}
elseif (isset($_POST["agent_display_dialable_leads"])) {$agent_display_dialable_leads=$_POST["agent_display_dialable_leads"];}
if (isset($_GET["vicidial_balance_rank"])) {$vicidial_balance_rank=$_GET["vicidial_balance_rank"];}
elseif (isset($_POST["vicidial_balance_rank"])) {$vicidial_balance_rank=$_POST["vicidial_balance_rank"];}
if (isset($_GET["agent_script_override"])) {$agent_script_override=$_GET["agent_script_override"];}
elseif (isset($_POST["agent_script_override"])) {$agent_script_override=$_POST["agent_script_override"];}
if (isset($_GET["moh_id"])) {$moh_id=$_GET["moh_id"];}
elseif (isset($_POST["moh_id"])) {$moh_id=$_POST["moh_id"];}
if (isset($_GET["moh_name"])) {$moh_name=$_GET["moh_name"];}
elseif (isset($_POST["moh_name"])) {$moh_name=$_POST["moh_name"];}
if (isset($_GET["random"])) {$random=$_GET["random"];}
elseif (isset($_POST["random"])) {$random=$_POST["random"];}
if (isset($_GET["filename"])) {$filename=$_GET["filename"];}
elseif (isset($_POST["filename"])) {$filename=$_POST["filename"];}
if (isset($_GET["rank"])) {$rank=$_GET["rank"];}
elseif (isset($_POST["rank"])) {$rank=$_POST["rank"];}
if (isset($_GET["rebuild_music_on_hold"])) {$rebuild_music_on_hold=$_GET["rebuild_music_on_hold"];}
elseif (isset($_POST["rebuild_music_on_hold"])) {$rebuild_music_on_hold=$_POST["rebuild_music_on_hold"];}
if (isset($_GET["active_agent_login_server"])) {$active_agent_login_server=$_GET["active_agent_login_server"];}
elseif (isset($_POST["active_agent_login_server"])) {$active_agent_login_server=$_POST["active_agent_login_server"];}
if (isset($_GET["enable_second_webform"])) {$enable_second_webform=$_GET["enable_second_webform"];}
elseif (isset($_POST["enable_second_webform"])) {$enable_second_webform=$_POST["enable_second_webform"];}
if (isset($_GET["web_form_address_two"])) {$web_form_address_two=$_GET["web_form_address_two"];}
elseif (isset($_POST["web_form_address_two"])) {$web_form_address_two=$_POST["web_form_address_two"];}
if (isset($_GET["waitforsilence_options"])) {$waitforsilence_options=$_GET["waitforsilence_options"];}
elseif (isset($_POST["waitforsilence_options"])) {$waitforsilence_options=$_POST["waitforsilence_options"];}
if (isset($_GET["campaign_cid_override"])) {$campaign_cid_override=$_GET["campaign_cid_override"];}
elseif (isset($_POST["campaign_cid_override"])) {$campaign_cid_override=$_POST["campaign_cid_override"];}
if (isset($_GET["am_message_exten_override"])) {$am_message_exten_override=$_GET["am_message_exten_override"];}
elseif (isset($_POST["am_message_exten_override"])) {$am_message_exten_override=$_POST["am_message_exten_override"];}
if (isset($_GET["drop_inbound_group_override"])) {$drop_inbound_group_override=$_GET["drop_inbound_group_override"];}
elseif (isset($_POST["drop_inbound_group_override"])) {$drop_inbound_group_override=$_POST["drop_inbound_group_override"];}
if (isset($_GET["agent_select_territories"])) {$agent_select_territories=$_GET["agent_select_territories"];}
elseif (isset($_POST["agent_select_territories"])) {$agent_select_territories=$_POST["agent_select_territories"];}
if (isset($_GET["agent_choose_territories"])) {$agent_choose_territories=$_GET["agent_choose_territories"];}
elseif (isset($_POST["agent_choose_territories"])) {$agent_choose_territories=$_POST["agent_choose_territories"];}
if (isset($_GET["carrier_description"])) {$carrier_description=$_GET["carrier_description"];}
elseif (isset($_POST["carrier_description"])) {$carrier_description=$_POST["carrier_description"];}
if (isset($_GET["delete_vm_after_email"])) {$delete_vm_after_email=$_GET["delete_vm_after_email"];}
elseif (isset($_POST["delete_vm_after_email"])) {$delete_vm_after_email=$_POST["delete_vm_after_email"];}
if (isset($_GET["custom_one"])) {$custom_one=$_GET["custom_one"];}
elseif (isset($_POST["custom_one"])) {$custom_one=$_POST["custom_one"];}
if (isset($_GET["custom_two"])) {$custom_two=$_GET["custom_two"];}
elseif (isset($_POST["custom_two"])) {$custom_two=$_POST["custom_two"];}
if (isset($_GET["custom_three"])) {$custom_three=$_GET["custom_three"];}
elseif (isset($_POST["custom_three"])) {$custom_three=$_POST["custom_three"];}
if (isset($_GET["custom_four"])) {$custom_four=$_GET["custom_four"];}
elseif (isset($_POST["custom_four"])) {$custom_four=$_POST["custom_four"];}
if (isset($_GET["custom_five"])) {$custom_five=$_GET["custom_five"];}
elseif (isset($_POST["custom_five"])) {$custom_five=$_POST["custom_five"];}
if (isset($_GET["crm_popup_login"])) {$crm_popup_login=$_GET["crm_popup_login"];}
elseif (isset($_POST["crm_popup_login"])) {$crm_popup_login=$_POST["crm_popup_login"];}
if (isset($_GET["crm_login_address"])) {$crm_login_address=$_GET["crm_login_address"];}
elseif (isset($_POST["crm_login_address"])) {$crm_login_address=$_POST["crm_login_address"];}
if (isset($_GET["timer_action"])) {$timer_action=$_GET["timer_action"];}
elseif (isset($_POST["timer_action"])) {$timer_action=$_POST["timer_action"];}
if (isset($_GET["timer_action_message"])) {$timer_action_message=$_GET["timer_action_message"];}
elseif (isset($_POST["timer_action_message"])) {$timer_action_message=$_POST["timer_action_message"];}
if (isset($_GET["timer_action_seconds"])) {$timer_action_seconds=$_GET["timer_action_seconds"];}
elseif (isset($_POST["timer_action_seconds"])) {$timer_action_seconds=$_POST["timer_action_seconds"];}
if (isset($_GET["start_call_url"])) {$start_call_url=$_GET["start_call_url"];}
elseif (isset($_POST["start_call_url"])) {$start_call_url=$_POST["start_call_url"];}
if (isset($_GET["dispo_call_url"])) {$dispo_call_url=$_GET["dispo_call_url"];}
elseif (isset($_POST["dispo_call_url"])) {$dispo_call_url=$_POST["dispo_call_url"];}
if (isset($_GET["xferconf_c_number"])) {$xferconf_c_number=$_GET["xferconf_c_number"];}
elseif (isset($_POST["xferconf_c_number"])) {$xferconf_c_number=$_POST["xferconf_c_number"];}
if (isset($_GET["xferconf_d_number"])) {$xferconf_d_number=$_GET["xferconf_d_number"];}
elseif (isset($_POST["xferconf_d_number"])) {$xferconf_d_number=$_POST["xferconf_d_number"];}
if (isset($_GET["xferconf_e_number"])) {$xferconf_e_number=$_GET["xferconf_e_number"];}
elseif (isset($_POST["xferconf_e_number"])) {$xferconf_e_number=$_POST["xferconf_e_number"];}
if (isset($_GET["record_call"])) {$record_call=$_GET["record_call"];}
elseif (isset($_POST["record_call"])) {$record_call=$_POST["record_call"];}
if (isset($_GET["ignore_list_script_override"])) {$ignore_list_script_override=$_GET["ignore_list_script_override"];}
elseif (isset($_POST["ignore_list_script_override"])) {$ignore_list_script_override=$_POST["ignore_list_script_override"];}
if (isset($_GET["external_server_ip"])) {$external_server_ip=$_GET["external_server_ip"];}
elseif (isset($_POST["external_server_ip"])){$external_server_ip=$_POST["external_server_ip"];}
if (isset($_GET["is_webphone"])) {$is_webphone=$_GET["is_webphone"];}
elseif (isset($_POST["is_webphone"])) {$is_webphone=$_POST["is_webphone"];}
if (isset($_GET["use_external_server_ip"])) {$use_external_server_ip=$_GET["use_external_server_ip"];}
elseif (isset($_POST["use_external_server_ip"])){$use_external_server_ip=$_POST["use_external_server_ip"];}
if (isset($_GET["default_webphone"])) {$default_webphone=$_GET["default_webphone"];}
elseif (isset($_POST["default_webphone"])) {$default_webphone=$_POST["default_webphone"];}
if (isset($_GET["default_external_server_ip"])) {$default_external_server_ip=$_GET["default_external_server_ip"];}
elseif (isset($_POST["default_external_server_ip"])){$default_external_server_ip=$_POST["default_external_server_ip"];}
if (isset($_GET["webphone_url"])) {$webphone_url=$_GET["webphone_url"];}
elseif (isset($_POST["webphone_url"])) {$webphone_url=$_POST["webphone_url"];}
if (isset($_GET["enable_agc_dispo_log"])) {$enable_agc_dispo_log=$_GET["enable_agc_dispo_log"];}
elseif (isset($_POST["enable_agc_dispo_log"])) {$enable_agc_dispo_log=$_POST["enable_agc_dispo_log"];}
if (isset($_GET["agent_call_log_view"])) {$agent_call_log_view=$_GET["agent_call_log_view"];}
elseif (isset($_POST["agent_call_log_view"])) {$agent_call_log_view=$_POST["agent_call_log_view"];}
if (isset($_GET["agent_call_log_view_override"])) {$agent_call_log_view_override=$_GET["agent_call_log_view_override"];}
elseif (isset($_POST["agent_call_log_view_override"])) {$agent_call_log_view_override=$_POST["agent_call_log_view_override"];}
if (isset($_GET["use_custom_cid"])) {$use_custom_cid=$_GET["use_custom_cid"];}
elseif (isset($_POST["use_custom_cid"])) {$use_custom_cid=$_POST["use_custom_cid"];}
if (isset($_GET["scheduled_callbacks_alert"])) {$scheduled_callbacks_alert=$_GET["scheduled_callbacks_alert"];}
elseif (isset($_POST["scheduled_callbacks_alert"])) {$scheduled_callbacks_alert=$_POST["scheduled_callbacks_alert"];}
if (isset($_GET["queuemetrics_loginout"])) {$queuemetrics_loginout=$_GET["queuemetrics_loginout"];}
elseif (isset($_POST["queuemetrics_loginout"])) {$queuemetrics_loginout=$_POST["queuemetrics_loginout"];}
if (isset($_GET["callcard_enabled"])) {$callcard_enabled=$_GET["callcard_enabled"];}
elseif (isset($_POST["callcard_enabled"])) {$callcard_enabled=$_POST["callcard_enabled"];}
if (isset($_GET["callcard_admin"])) {$callcard_admin=$_GET["callcard_admin"];}
elseif (isset($_POST["callcard_admin"])) {$callcard_admin=$_POST["callcard_admin"];}
if (isset($_GET["agent_xfer_consultative"])) {$agent_xfer_consultative=$_GET["agent_xfer_consultative"];}
elseif (isset($_POST["agent_xfer_consultative"])) {$agent_xfer_consultative=$_POST["agent_xfer_consultative"];}
if (isset($_GET["agent_xfer_dial_override"])) {$agent_xfer_dial_override=$_GET["agent_xfer_dial_override"];}
elseif (isset($_POST["agent_xfer_dial_override"])) {$agent_xfer_dial_override=$_POST["agent_xfer_dial_override"];}
if (isset($_GET["agent_xfer_vm_transfer"])) {$agent_xfer_vm_transfer=$_GET["agent_xfer_vm_transfer"];}
elseif (isset($_POST["agent_xfer_vm_transfer"])) {$agent_xfer_vm_transfer=$_POST["agent_xfer_vm_transfer"];}
if (isset($_GET["agent_xfer_blind_transfer"])) {$agent_xfer_blind_transfer=$_GET["agent_xfer_blind_transfer"];}
elseif (isset($_POST["agent_xfer_blind_transfer"])) {$agent_xfer_blind_transfer=$_POST["agent_xfer_blind_transfer"];}
if (isset($_GET["agent_xfer_dial_with_customer"])) {$agent_xfer_dial_with_customer=$_GET["agent_xfer_dial_with_customer"];}
elseif (isset($_POST["agent_xfer_dial_with_customer"])) {$agent_xfer_dial_with_customer=$_POST["agent_xfer_dial_with_customer"];}
if (isset($_GET["agent_xfer_park_customer_dial"])) {$agent_xfer_park_customer_dial=$_GET["agent_xfer_park_customer_dial"];}
elseif (isset($_POST["agent_xfer_park_customer_dial"])) {$agent_xfer_park_customer_dial=$_POST["agent_xfer_park_customer_dial"];}
if (isset($_GET["agent_fullscreen"])) {$agent_fullscreen=$_GET["agent_fullscreen"];}
elseif (isset($_POST["agent_fullscreen"])) {$agent_fullscreen=$_POST["agent_fullscreen"];}
if (isset($_GET["extension_id"])) {$extension_id=$_GET["extension_id"];}
elseif (isset($_POST["extension_id"])) {$extension_id=$_POST["extension_id"];}
if (isset($_GET["extension_group_id"])) {$extension_group_id=$_GET["extension_group_id"];}
elseif (isset($_POST["extension_group_id"])) {$extension_group_id=$_POST["extension_group_id"];}
if (isset($_GET["campaign_groups"])) {$campaign_groups=$_GET["campaign_groups"];}
elseif (isset($_POST["campaign_groups"])) {$campaign_groups=$_POST["campaign_groups"];}
if (isset($_GET["extension_group"])) {$extension_group=$_GET["extension_group"];}
elseif (isset($_POST["extension_group"])) {$extension_group=$_POST["extension_group"];}
if (isset($_GET["agent_choose_blended"])) {$agent_choose_blended=$_GET["agent_choose_blended"];}
elseif (isset($_POST["agent_choose_blended"])) {$agent_choose_blended=$_POST["agent_choose_blended"];}
if (isset($_GET["queuemetrics_callstatus"])) {$queuemetrics_callstatus=$_GET["queuemetrics_callstatus"];}
elseif (isset($_POST["queuemetrics_callstatus"])) {$queuemetrics_callstatus=$_POST["queuemetrics_callstatus"];}
if (isset($_GET["extension_appended_cidname"])) {$extension_appended_cidname=$_GET["extension_appended_cidname"];}
elseif (isset($_POST["extension_appended_cidname"])) {$extension_appended_cidname=$_POST["extension_appended_cidname"];}
if (isset($_GET["scheduled_callbacks_count"])) {$scheduled_callbacks_count=$_GET["scheduled_callbacks_count"];}
elseif (isset($_POST["scheduled_callbacks_count"])) {$scheduled_callbacks_count=$_POST["scheduled_callbacks_count"];}
if (isset($_GET["realtime_block_user_info"])) {$realtime_block_user_info=$_GET["realtime_block_user_info"];}
elseif (isset($_POST["realtime_block_user_info"])) {$realtime_block_user_info=$_POST["realtime_block_user_info"];}
if (isset($_GET["manual_dial_override"])) {$manual_dial_override=$_GET["manual_dial_override"];}
elseif (isset($_POST["manual_dial_override"])) {$manual_dial_override=$_POST["manual_dial_override"];}
if (isset($_GET["blind_monitor_warning"])) {$blind_monitor_warning=$_GET["blind_monitor_warning"];}
elseif (isset($_POST["blind_monitor_warning"])) {$blind_monitor_warning=$_POST["blind_monitor_warning"];}
if (isset($_GET["blind_monitor_message"])) {$blind_monitor_message=$_GET["blind_monitor_message"];}
elseif (isset($_POST["blind_monitor_message"])) {$blind_monitor_message=$_POST["blind_monitor_message"];}
if (isset($_GET["blind_monitor_filename"])) {$blind_monitor_filename=$_GET["blind_monitor_filename"];}
elseif (isset($_POST["blind_monitor_filename"])) {$blind_monitor_filename=$_POST["blind_monitor_filename"];}
if (isset($_GET["uniqueid_status_display"])) {$uniqueid_status_display=$_GET["uniqueid_status_display"];}
elseif (isset($_POST["uniqueid_status_display"])) {$uniqueid_status_display=$_POST["uniqueid_status_display"];}
if (isset($_GET["uniqueid_status_prefix"])) {$uniqueid_status_prefix=$_GET["uniqueid_status_prefix"];}
elseif (isset($_POST["uniqueid_status_prefix"])) {$uniqueid_status_prefix=$_POST["uniqueid_status_prefix"];}
if (isset($_GET["default_codecs"])) {$default_codecs=$_GET["default_codecs"];}
elseif (isset($_POST["default_codecs"])) {$default_codecs=$_POST["default_codecs"];}
if (isset($_GET["codecs_list"])) {$codecs_list=$_GET["codecs_list"];}
elseif (isset($_POST["codecs_list"])) {$codecs_list=$_POST["codecs_list"];}
if (isset($_GET["codecs_with_template"])) {$codecs_with_template=$_GET["codecs_with_template"];}
elseif (isset($_POST["codecs_with_template"])) {$codecs_with_template=$_POST["codecs_with_template"];}
if (isset($_GET["custom_fields_modify"])) {$custom_fields_modify=$_GET["custom_fields_modify"];}
elseif (isset($_POST["custom_fields_modify"])) {$custom_fields_modify=$_POST["custom_fields_modify"];}
if (isset($_GET["hold_time_option_minimum"])) {$hold_time_option_minimum=$_GET["hold_time_option_minimum"];}
elseif (isset($_POST["hold_time_option_minimum"])) {$hold_time_option_minimum=$_POST["hold_time_option_minimum"];}
if (isset($_GET["source_carrier"])) {$source_carrier=$_GET["source_carrier"];}
elseif (isset($_POST["source_carrier"])) {$source_carrier=$_POST["source_carrier"];}
if (isset($_GET["hold_time_option_press_filename"])) {$hold_time_option_press_filename=$_GET["hold_time_option_press_filename"];}
elseif (isset($_POST["hold_time_option_press_filename"])) {$hold_time_option_press_filename=$_POST["hold_time_option_press_filename"];}
if (isset($_GET["hold_time_option_callmenu"])) {$hold_time_option_callmenu=$_GET["hold_time_option_callmenu"];}
elseif (isset($_POST["hold_time_option_callmenu"])) {$hold_time_option_callmenu=$_POST["hold_time_option_callmenu"];}
if (isset($_GET["inbound_queue_no_dial"])) {$inbound_queue_no_dial=$_GET["inbound_queue_no_dial"];}
elseif (isset($_POST["inbound_queue_no_dial"])) {$inbound_queue_no_dial=$_POST["inbound_queue_no_dial"];}
if (isset($_GET["default_afterhours_filename_override"])) {$default_afterhours_filename_override=$_GET["default_afterhours_filename_override"];}
elseif (isset($_POST["default_afterhours_filename_override"])) {$default_afterhours_filename_override=$_POST["default_afterhours_filename_override"];}
if (isset($_GET["sunday_afterhours_filename_override"])) {$sunday_afterhours_filename_override=$_GET["sunday_afterhours_filename_override"];}
elseif (isset($_POST["sunday_afterhours_filename_override"])) {$sunday_afterhours_filename_override=$_POST["sunday_afterhours_filename_override"];}
if (isset($_GET["monday_afterhours_filename_override"])) {$monday_afterhours_filename_override=$_GET["monday_afterhours_filename_override"];}
elseif (isset($_POST["monday_afterhours_filename_override"])) {$monday_afterhours_filename_override=$_POST["monday_afterhours_filename_override"];}
if (isset($_GET["tuesday_afterhours_filename_override"])) {$tuesday_afterhours_filename_override=$_GET["tuesday_afterhours_filename_override"];}
elseif (isset($_POST["tuesday_afterhours_filename_override"])) {$tuesday_afterhours_filename_override=$_POST["tuesday_afterhours_filename_override"];}
if (isset($_GET["wednesday_afterhours_filename_override"])) {$wednesday_afterhours_filename_override=$_GET["wednesday_afterhours_filename_override"];}
elseif (isset($_POST["wednesday_afterhours_filename_override"])) {$wednesday_afterhours_filename_override=$_POST["wednesday_afterhours_filename_override"];}
if (isset($_GET["thursday_afterhours_filename_override"])) {$thursday_afterhours_filename_override=$_GET["thursday_afterhours_filename_override"];}
elseif (isset($_POST["thursday_afterhours_filename_override"])) {$thursday_afterhours_filename_override=$_POST["thursday_afterhours_filename_override"];}
if (isset($_GET["friday_afterhours_filename_override"])) {$friday_afterhours_filename_override=$_GET["friday_afterhours_filename_override"];}
elseif (isset($_POST["friday_afterhours_filename_override"])) {$friday_afterhours_filename_override=$_POST["friday_afterhours_filename_override"];}
if (isset($_GET["saturday_afterhours_filename_override"])) {$saturday_afterhours_filename_override=$_GET["saturday_afterhours_filename_override"];}
elseif (isset($_POST["saturday_afterhours_filename_override"])) {$saturday_afterhours_filename_override=$_POST["saturday_afterhours_filename_override"];}
if (isset($_GET["onhold_prompt_no_block"])) {$onhold_prompt_no_block=$_GET["onhold_prompt_no_block"];}
elseif (isset($_POST["onhold_prompt_no_block"])) {$onhold_prompt_no_block=$_POST["onhold_prompt_no_block"];}
if (isset($_GET["onhold_prompt_seconds"])) {$onhold_prompt_seconds=$_GET["onhold_prompt_seconds"];}
elseif (isset($_POST["onhold_prompt_seconds"])) {$onhold_prompt_seconds=$_POST["onhold_prompt_seconds"];}
if (isset($_GET["hold_time_option_no_block"])) {$hold_time_option_no_block=$_GET["hold_time_option_no_block"];}
elseif (isset($_POST["hold_time_option_no_block"])) {$hold_time_option_no_block=$_POST["hold_time_option_no_block"];}
if (isset($_GET["hold_time_option_prompt_seconds"])) {$hold_time_option_prompt_seconds=$_GET["hold_time_option_prompt_seconds"];}
elseif (isset($_POST["hold_time_option_prompt_seconds"])) {$hold_time_option_prompt_seconds=$_POST["hold_time_option_prompt_seconds"];}
if (isset($_GET["admin_web_directory"])) {$admin_web_directory=$_GET["admin_web_directory"];}
elseif (isset($_POST["admin_web_directory"])) {$admin_web_directory=$_POST["admin_web_directory"];}
if (isset($_GET["tts_voice"])) {$tts_voice=$_GET["tts_voice"];}
elseif (isset($_POST["tts_voice"])) {$tts_voice=$_POST["tts_voice"];}
if (isset($_GET["label_title"])) {$label_title=$_GET["label_title"];}
elseif (isset($_POST["label_title"])) {$label_title=$_POST["label_title"];}
if (isset($_GET["label_first_name"])) {$label_first_name=$_GET["label_first_name"];}
elseif (isset($_POST["label_first_name"])) {$label_first_name=$_POST["label_first_name"];}
if (isset($_GET["label_middle_initial"])) {$label_middle_initial=$_GET["label_middle_initial"];}
elseif (isset($_POST["label_middle_initial"])) {$label_middle_initial=$_POST["label_middle_initial"];}
if (isset($_GET["label_last_name"])) {$label_last_name=$_GET["label_last_name"];}
elseif (isset($_POST["label_last_name"])) {$label_last_name=$_POST["label_last_name"];}
if (isset($_GET["label_address1"])) {$label_address1=$_GET["label_address1"];}
elseif (isset($_POST["label_address1"])) {$label_address1=$_POST["label_address1"];}
if (isset($_GET["label_address2"])) {$label_address2=$_GET["label_address2"];}
elseif (isset($_POST["label_address2"])) {$label_address2=$_POST["label_address2"];}
if (isset($_GET["label_address3"])) {$label_address3=$_GET["label_address3"];}
elseif (isset($_POST["label_address3"])) {$label_address3=$_POST["label_address3"];}
if (isset($_GET["label_city"])) {$label_city=$_GET["label_city"];}
elseif (isset($_POST["label_city"])) {$label_city=$_POST["label_city"];}
if (isset($_GET["label_state"])) {$label_state=$_GET["label_state"];}
elseif (isset($_POST["label_state"])) {$label_state=$_POST["label_state"];}
if (isset($_GET["label_province"])) {$label_province=$_GET["label_province"];}
elseif (isset($_POST["label_province"])) {$label_province=$_POST["label_province"];}
if (isset($_GET["label_postal_code"])) {$label_postal_code=$_GET["label_postal_code"];}
elseif (isset($_POST["label_postal_code"])) {$label_postal_code=$_POST["label_postal_code"];}
if (isset($_GET["label_vendor_lead_code"])) {$label_vendor_lead_code=$_GET["label_vendor_lead_code"];}
elseif (isset($_POST["label_vendor_lead_code"])){$label_vendor_lead_code=$_POST["label_vendor_lead_code"];}
if (isset($_GET["label_gender"])) {$label_gender=$_GET["label_gender"];}
elseif (isset($_POST["label_gender"])) {$label_gender=$_POST["label_gender"];}
if (isset($_GET["label_phone_number"])) {$label_phone_number=$_GET["label_phone_number"];}
elseif (isset($_POST["label_phone_number"])) {$label_phone_number=$_POST["label_phone_number"];}
if (isset($_GET["label_phone_code"])) {$label_phone_code=$_GET["label_phone_code"];}
elseif (isset($_POST["label_phone_code"])) {$label_phone_code=$_POST["label_phone_code"];}
if (isset($_GET["label_alt_phone"])) {$label_alt_phone=$_GET["label_alt_phone"];}
elseif (isset($_POST["label_alt_phone"])) {$label_alt_phone=$_POST["label_alt_phone"];}
if (isset($_GET["label_security_phrase"])) {$label_security_phrase=$_GET["label_security_phrase"];}
elseif (isset($_POST["label_security_phrase"])) {$label_security_phrase=$_POST["label_security_phrase"];}
if (isset($_GET["label_email"])) {$label_email=$_GET["label_email"];}
elseif (isset($_POST["label_email"])) {$label_email=$_POST["label_email"];}
if (isset($_GET["label_comments"])) {$label_comments=$_GET["label_comments"];}
elseif (isset($_POST["label_comments"])) {$label_comments=$_POST["label_comments"];}
if (isset($_GET["custom_fields_enabled"])) {$custom_fields_enabled=$_GET["custom_fields_enabled"];}
elseif (isset($_POST["custom_fields_enabled"])) {$custom_fields_enabled=$_POST["custom_fields_enabled"];}
if (isset($_GET["slave_db_server"])) {$slave_db_server=$_GET["slave_db_server"];}
elseif (isset($_POST["slave_db_server"])) {$slave_db_server=$_POST["slave_db_server"];}
if (isset($_GET["reports_use_slave_db"])) {$reports_use_slave_db=$_GET["reports_use_slave_db"];}
elseif (isset($_POST["reports_use_slave_db"])) {$reports_use_slave_db=$_POST["reports_use_slave_db"];}
if (isset($_GET["hold_time_second_option"])) {$hold_time_second_option=$_GET["hold_time_second_option"];}
elseif (isset($_POST["hold_time_second_option"])) {$hold_time_second_option=$_POST["hold_time_second_option"];}
if (isset($_GET["hold_time_third_option"])) {$hold_time_third_option=$_GET["hold_time_third_option"];}
elseif (isset($_POST["hold_time_third_option"])) {$hold_time_third_option=$_POST["hold_time_third_option"];}
if (isset($_GET["wait_hold_option_priority"])) {$wait_hold_option_priority=$_GET["wait_hold_option_priority"];}
elseif (isset($_POST["wait_hold_option_priority"])) {$wait_hold_option_priority=$_POST["wait_hold_option_priority"];}
if (isset($_GET["wait_time_option"])) {$wait_time_option=$_GET["wait_time_option"];}
elseif (isset($_POST["wait_time_option"])) {$wait_time_option=$_POST["wait_time_option"];}
if (isset($_GET["wait_time_second_option"])) {$wait_time_second_option=$_GET["wait_time_second_option"];}
elseif (isset($_POST["wait_time_second_option"])) {$wait_time_second_option=$_POST["wait_time_second_option"];}
if (isset($_GET["wait_time_third_option"])) {$wait_time_third_option=$_GET["wait_time_third_option"];}
elseif (isset($_POST["wait_time_third_option"])) {$wait_time_third_option=$_POST["wait_time_third_option"];}
if (isset($_GET["wait_time_option_seconds"])) {$wait_time_option_seconds=$_GET["wait_time_option_seconds"];}
elseif (isset($_POST["wait_time_option_seconds"])) {$wait_time_option_seconds=$_POST["wait_time_option_seconds"];}
if (isset($_GET["wait_time_option_exten"])) {$wait_time_option_exten=$_GET["wait_time_option_exten"];}
elseif (isset($_POST["wait_time_option_exten"])) {$wait_time_option_exten=$_POST["wait_time_option_exten"];}
if (isset($_GET["wait_time_option_voicemail"])) {$wait_time_option_voicemail=$_GET["wait_time_option_voicemail"];}
elseif (isset($_POST["wait_time_option_voicemail"])) {$wait_time_option_voicemail=$_POST["wait_time_option_voicemail"];}
if (isset($_GET["wait_time_option_xfer_group"])) {$wait_time_option_xfer_group=$_GET["wait_time_option_xfer_group"];}
elseif (isset($_POST["wait_time_option_xfer_group"])) {$wait_time_option_xfer_group=$_POST["wait_time_option_xfer_group"];}
if (isset($_GET["wait_time_option_callmenu"])) {$wait_time_option_callmenu=$_GET["wait_time_option_callmenu"];}
elseif (isset($_POST["wait_time_option_callmenu"])) {$wait_time_option_callmenu=$_POST["wait_time_option_callmenu"];}
if (isset($_GET["wait_time_option_callback_filename"])) {$wait_time_option_callback_filename=$_GET["wait_time_option_callback_filename"];}
elseif (isset($_POST["wait_time_option_callback_filename"])) {$wait_time_option_callback_filename=$_POST["wait_time_option_callback_filename"];}
if (isset($_GET["wait_time_option_callback_list_id"])) {$wait_time_option_callback_list_id=$_GET["wait_time_option_callback_list_id"];}
elseif (isset($_POST["wait_time_option_callback_list_id"])) {$wait_time_option_callback_list_id=$_POST["wait_time_option_callback_list_id"];}
if (isset($_GET["wait_time_option_press_filename"])) {$wait_time_option_press_filename=$_GET["wait_time_option_press_filename"];}
elseif (isset($_POST["wait_time_option_press_filename"])) {$wait_time_option_press_filename=$_POST["wait_time_option_press_filename"];}
if (isset($_GET["wait_time_option_no_block"])) {$wait_time_option_no_block=$_GET["wait_time_option_no_block"];}
elseif (isset($_POST["wait_time_option_no_block"])) {$wait_time_option_no_block=$_POST["wait_time_option_no_block"];}
if (isset($_GET["wait_time_option_prompt_seconds"])) {$wait_time_option_prompt_seconds=$_GET["wait_time_option_prompt_seconds"];}
elseif (isset($_POST["wait_time_option_prompt_seconds"])) {$wait_time_option_prompt_seconds=$_POST["wait_time_option_prompt_seconds"];}
if (isset($_GET["timer_action_destination"])) {$timer_action_destination=$_GET["timer_action_destination"];}
elseif (isset($_POST["timer_action_destination"])) {$timer_action_destination=$_POST["timer_action_destination"];}
if (isset($_GET["allowed_reports"])) {$allowed_reports=$_GET["allowed_reports"];}
elseif (isset($_POST["allowed_reports"])) {$allowed_reports=$_POST["allowed_reports"];}
if (isset($_GET["filter_phone_group_id"])) {$filter_phone_group_id=$_GET["filter_phone_group_id"];}
elseif (isset($_POST["filter_phone_group_id"])) {$filter_phone_group_id=$_POST["filter_phone_group_id"];}
if (isset($_GET["filter_phone_group_name"])) {$filter_phone_group_name=$_GET["filter_phone_group_name"];}
elseif (isset($_POST["filter_phone_group_name"])) {$filter_phone_group_name=$_POST["filter_phone_group_name"];}
if (isset($_GET["filter_phone_group_description"])) {$filter_phone_group_description=$_GET["filter_phone_group_description"];}
elseif (isset($_POST["filter_phone_group_description"])) {$filter_phone_group_description=$_POST["filter_phone_group_description"];}
if (isset($_GET["filter_inbound_number"])) {$filter_inbound_number=$_GET["filter_inbound_number"];}
elseif (isset($_POST["filter_inbound_number"])) {$filter_inbound_number=$_POST["filter_inbound_number"];}
if (isset($_GET["filter_url"])) {$filter_url=$_GET["filter_url"];}
elseif (isset($_POST["filter_url"])) {$filter_url=$_POST["filter_url"];}
if (isset($_GET["filter_action"])) {$filter_action=$_GET["filter_action"];}
elseif (isset($_POST["filter_action"])) {$filter_action=$_POST["filter_action"];}
if (isset($_GET["filter_extension"])) {$filter_extension=$_GET["filter_extension"];}
elseif (isset($_POST["filter_extension"])) {$filter_extension=$_POST["filter_extension"];}
if (isset($_GET["filter_exten_context"])) {$filter_exten_context=$_GET["filter_exten_context"];}
elseif (isset($_POST["filter_exten_context"])) {$filter_exten_context=$_POST["filter_exten_context"];}
if (isset($_GET["filter_voicemail_ext"])) {$filter_voicemail_ext=$_GET["filter_voicemail_ext"];}
elseif (isset($_POST["filter_voicemail_ext"])) {$filter_voicemail_ext=$_POST["filter_voicemail_ext"];}
if (isset($_GET["filter_phone"])) {$filter_phone=$_GET["filter_phone"];}
elseif (isset($_POST["filter_phone"])) {$filter_phone=$_POST["filter_phone"];}
if (isset($_GET["filter_server_ip"])) {$filter_server_ip=$_GET["filter_server_ip"];}
elseif (isset($_POST["filter_server_ip"])) {$filter_server_ip=$_POST["filter_server_ip"];}
if (isset($_GET["filter_user"])) {$filter_user=$_GET["filter_user"];}
elseif (isset($_POST["filter_user"])) {$filter_user=$_POST["filter_user"];}
if (isset($_GET["filter_user_unavailable_action"])) {$filter_user_unavailable_action=$_GET["filter_user_unavailable_action"];}
elseif (isset($_POST["filter_user_unavailable_action"])) {$filter_user_unavailable_action=$_POST["filter_user_unavailable_action"];}
if (isset($_GET["filter_user_route_settings_ingroup"])) {$filter_user_route_settings_ingroup=$_GET["filter_user_route_settings_ingroup"];}
elseif (isset($_POST["filter_user_route_settings_ingroup"])) {$filter_user_route_settings_ingroup=$_POST["filter_user_route_settings_ingroup"];}
if (isset($_GET["filter_group_id"])) {$filter_group_id=$_GET["filter_group_id"];}
elseif (isset($_POST["filter_group_id"])) {$filter_group_id=$_POST["filter_group_id"];}
if (isset($_GET["filter_call_handle_method"])) {$filter_call_handle_method=$_GET["filter_call_handle_method"];}
elseif (isset($_POST["filter_call_handle_method"])) {$filter_call_handle_method=$_POST["filter_call_handle_method"];}
if (isset($_GET["filter_agent_search_method"])) {$filter_agent_search_method=$_GET["filter_agent_search_method"];}
elseif (isset($_POST["filter_agent_search_method"])) {$filter_agent_search_method=$_POST["filter_agent_search_method"];}
if (isset($_GET["filter_list_id"])) {$filter_list_id=$_GET["filter_list_id"];}
elseif (isset($_POST["filter_list_id"])) {$filter_list_id=$_POST["filter_list_id"];}
if (isset($_GET["filter_campaign_id"])) {$filter_campaign_id=$_GET["filter_campaign_id"];}
elseif (isset($_POST["filter_campaign_id"])) {$filter_campaign_id=$_POST["filter_campaign_id"];}
if (isset($_GET["filter_phone_code"])) {$filter_phone_code=$_GET["filter_phone_code"];}
elseif (isset($_POST["filter_phone_code"])) {$filter_phone_code=$_POST["filter_phone_code"];}
if (isset($_GET["filter_menu_id"])) {$filter_menu_id=$_GET["filter_menu_id"];}
elseif (isset($_POST["filter_menu_id"])) {$filter_menu_id=$_POST["filter_menu_id"];}
if (isset($_GET["filter_clean_cid_number"])) {$filter_clean_cid_number=$_GET["filter_clean_cid_number"];}
elseif (isset($_POST["filter_clean_cid_number"])) {$filter_clean_cid_number=$_POST["filter_clean_cid_number"];}
if (isset($_GET["webphone_url_override"])) {$webphone_url_override=$_GET["webphone_url_override"];}
elseif (isset($_POST["webphone_url_override"])) {$webphone_url_override=$_POST["webphone_url_override"];}
if (isset($_GET["calculate_estimated_hold_seconds"])) {$calculate_estimated_hold_seconds=$_GET["calculate_estimated_hold_seconds"];}
elseif (isset($_POST["calculate_estimated_hold_seconds"])) {$calculate_estimated_hold_seconds=$_POST["calculate_estimated_hold_seconds"];}
if (isset($_GET["enable_xfer_presets"])) {$enable_xfer_presets=$_GET["enable_xfer_presets"];}
elseif (isset($_POST["enable_xfer_presets"])) {$enable_xfer_presets=$_POST["enable_xfer_presets"];}
if (isset($_GET["hide_xfer_number_to_dial"])) {$hide_xfer_number_to_dial=$_GET["hide_xfer_number_to_dial"];}
elseif (isset($_POST["hide_xfer_number_to_dial"])) {$hide_xfer_number_to_dial=$_POST["hide_xfer_number_to_dial"];}
if (isset($_GET["preset_name"])) {$preset_name=$_GET["preset_name"];}
elseif (isset($_POST["preset_name"])) {$preset_name=$_POST["preset_name"];}
if (isset($_GET["preset_number"])) {$preset_number=$_GET["preset_number"];}
elseif (isset($_POST["preset_number"])) {$preset_number=$_POST["preset_number"];}
if (isset($_GET["preset_dtmf"])) {$preset_dtmf=$_GET["preset_dtmf"];}
elseif (isset($_POST["preset_dtmf"])) {$preset_dtmf=$_POST["preset_dtmf"];}
if (isset($_GET["preset_hide_number"])) {$preset_hide_number=$_GET["preset_hide_number"];}
elseif (isset($_POST["preset_hide_number"])) {$preset_hide_number=$_POST["preset_hide_number"];}
if (isset($_GET["manual_dial_prefix"])) {$manual_dial_prefix=$_GET["manual_dial_prefix"];}
elseif (isset($_POST["manual_dial_prefix"])) {$manual_dial_prefix=$_POST["manual_dial_prefix"];}
if (isset($_GET["webphone_systemkey"])) {$webphone_systemkey=$_GET["webphone_systemkey"];}
elseif (isset($_POST["webphone_systemkey"])) {$webphone_systemkey=$_POST["webphone_systemkey"];}
if (isset($_GET["webphone_dialpad"])) {$webphone_dialpad=$_GET["webphone_dialpad"];}
elseif (isset($_POST["webphone_dialpad"])) {$webphone_dialpad=$_POST["webphone_dialpad"];}
if (isset($_GET["webphone_systemkey_override"])) {$webphone_systemkey_override=$_GET["webphone_systemkey_override"];}
elseif (isset($_POST["webphone_systemkey_override"])) {$webphone_systemkey_override=$_POST["webphone_systemkey_override"];}
if (isset($_GET["webphone_dialpad_override"])) {$webphone_dialpad_override=$_GET["webphone_dialpad_override"];}
elseif (isset($_POST["webphone_dialpad_override"])) {$webphone_dialpad_override=$_POST["webphone_dialpad_override"];}
if (isset($_GET["force_change_password"])) {$force_change_password=$_GET["force_change_password"];}
elseif (isset($_POST["force_change_password"])) {$force_change_password=$_POST["force_change_password"];}
if (isset($_GET["first_login_trigger"])) {$first_login_trigger=$_GET["first_login_trigger"];}
elseif (isset($_POST["first_login_trigger"])) {$first_login_trigger=$_POST["first_login_trigger"];}
if (isset($_GET["default_phone_registration_password"])) {$default_phone_registration_password=$_GET["default_phone_registration_password"];}
elseif (isset($_POST["default_phone_registration_password"])) {$default_phone_registration_password=$_POST["default_phone_registration_password"];}
if (isset($_GET["default_phone_login_password"])) {$default_phone_login_password=$_GET["default_phone_login_password"];}
elseif (isset($_POST["default_phone_login_password"])) {$default_phone_login_password=$_POST["default_phone_login_password"];}
if (isset($_GET["default_server_password"])) {$default_server_password=$_GET["default_server_password"];}
elseif (isset($_POST["default_server_password"])) {$default_server_password=$_POST["default_server_password"];}
if (isset($_GET["customer_3way_hangup_logging"])) {$customer_3way_hangup_logging=$_GET["customer_3way_hangup_logging"];}
elseif (isset($_POST["customer_3way_hangup_logging"])) {$customer_3way_hangup_logging=$_POST["customer_3way_hangup_logging"];}
if (isset($_GET["customer_3way_hangup_seconds"])) {$customer_3way_hangup_seconds=$_GET["customer_3way_hangup_seconds"];}
elseif (isset($_POST["customer_3way_hangup_seconds"])) {$customer_3way_hangup_seconds=$_POST["customer_3way_hangup_seconds"];}
if (isset($_GET["customer_3way_hangup_action"])) {$customer_3way_hangup_action=$_GET["customer_3way_hangup_action"];}
elseif (isset($_POST["customer_3way_hangup_action"])) {$customer_3way_hangup_action=$_POST["customer_3way_hangup_action"];}
if (isset($_GET["add_lead_url"])) {$add_lead_url=$_GET["add_lead_url"];}
elseif (isset($_POST["add_lead_url"])) {$add_lead_url=$_POST["add_lead_url"];}
if (isset($_GET["ivr_park_call"])) {$ivr_park_call=$_GET["ivr_park_call"];}
elseif (isset($_POST["ivr_park_call"])) {$ivr_park_call=$_POST["ivr_park_call"];}
if (isset($_GET["ivr_park_call_agi"])) {$ivr_park_call_agi=$_GET["ivr_park_call_agi"];}
elseif (isset($_POST["ivr_park_call_agi"])) {$ivr_park_call_agi=$_POST["ivr_park_call_agi"];}
if (isset($_GET["manual_preview_dial"])) {$manual_preview_dial=$_GET["manual_preview_dial"];}
elseif (isset($_POST["manual_preview_dial"])) {$manual_preview_dial=$_POST["manual_preview_dial"];}
if (isset($_GET["eht_minimum_prompt_filename"])) {$eht_minimum_prompt_filename=$_GET["eht_minimum_prompt_filename"];}
elseif (isset($_POST["eht_minimum_prompt_filename"])) {$eht_minimum_prompt_filename=$_POST["eht_minimum_prompt_filename"];}
if (isset($_GET["eht_minimum_prompt_no_block"])) {$eht_minimum_prompt_no_block=$_GET["eht_minimum_prompt_no_block"];}
elseif (isset($_POST["eht_minimum_prompt_no_block"])) {$eht_minimum_prompt_no_block=$_POST["eht_minimum_prompt_no_block"];}
if (isset($_GET["eht_minimum_prompt_seconds"])) {$eht_minimum_prompt_seconds=$_GET["eht_minimum_prompt_seconds"];}
elseif (isset($_POST["eht_minimum_prompt_seconds"])) {$eht_minimum_prompt_seconds=$_POST["eht_minimum_prompt_seconds"];}
if (isset($_GET["realtime_agent_time_stats"])) {$realtime_agent_time_stats=$_GET["realtime_agent_time_stats"];}
elseif (isset($_POST["realtime_agent_time_stats"])) {$realtime_agent_time_stats=$_POST["realtime_agent_time_stats"];}
if (isset($_GET["admin_modify_refresh"])) {$admin_modify_refresh=$_GET["admin_modify_refresh"];}
elseif (isset($_POST["admin_modify_refresh"])) {$admin_modify_refresh=$_POST["admin_modify_refresh"];}
if (isset($_GET["nocache_admin"])) {$nocache_admin=$_GET["nocache_admin"];}
elseif (isset($_POST["nocache_admin"])) {$nocache_admin=$_POST["nocache_admin"];}
if (isset($_GET["generate_cross_server_exten"])) {$generate_cross_server_exten=$_GET["generate_cross_server_exten"];}
elseif (isset($_POST["generate_cross_server_exten"])) {$generate_cross_server_exten=$_POST["generate_cross_server_exten"];}
if (isset($_GET["queuemetrics_addmember_enabled"])) {$queuemetrics_addmember_enabled=$_GET["queuemetrics_addmember_enabled"];}
elseif (isset($_POST["queuemetrics_addmember_enabled"])) {$queuemetrics_addmember_enabled=$_POST["queuemetrics_addmember_enabled"];}
if (isset($_GET["modify_page"])) {$modify_page=$_GET["modify_page"];}
elseif (isset($_POST["modify_page"])) {$modify_page=$_POST["modify_page"];}
if (isset($_GET["modify_url"])) {$modify_url=$_GET["modify_url"];}
elseif (isset($_POST["modify_url"])) {$modify_url=$_POST["modify_url"];}
if (isset($_GET["use_auto_hopper"])) {$use_auto_hopper=$_GET["use_auto_hopper"];}
elseif (isset($_POST["use_auto_hopper"])) {$use_auto_hopper=$_POST["use_auto_hopper"];}
if (isset($_GET["auto_hopper_multi"])) {$auto_hopper_multi=$_GET["auto_hopper_multi"];}
elseif (isset($_POST["auto_hopper_multi"])) {$auto_hopper_multi=$_POST["auto_hopper_multi"];}
if (isset($_GET["auto_trim_hopper"])) {$auto_trim_hopper=$_GET["auto_trim_hopper"];}
elseif (isset($_POST["auto_trim_hopper"])) {$auto_trim_hopper=$_POST["auto_trim_hopper"];}
if (isset($_GET["api_manual_dial"])) {$api_manual_dial=$_GET["api_manual_dial"];}
elseif (isset($_POST["api_manual_dial"])) {$api_manual_dial=$_POST["api_manual_dial"];}
if (isset($_GET["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_GET["manual_dial_call_time_check"];}
elseif (isset($_POST["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_POST["manual_dial_call_time_check"];}
if (isset($_GET["queuemetrics_dispo_pause"])) {$queuemetrics_dispo_pause=$_GET["queuemetrics_dispo_pause"];}
elseif (isset($_POST["queuemetrics_dispo_pause"])) {$queuemetrics_dispo_pause=$_POST["queuemetrics_dispo_pause"];}
if (isset($_GET["lead_order_randomize"])) {$lead_order_randomize=$_GET["lead_order_randomize"];}
elseif (isset($_POST["lead_order_randomize"])) {$lead_order_randomize=$_POST["lead_order_randomize"];}
if (isset($_GET["lead_order_secondary"])) {$lead_order_secondary=$_GET["lead_order_secondary"];}
elseif (isset($_POST["lead_order_secondary"])) {$lead_order_secondary=$_POST["lead_order_secondary"];}
if (isset($_GET["per_call_notes"])) {$per_call_notes=$_GET["per_call_notes"];}
elseif (isset($_POST["per_call_notes"])) {$per_call_notes=$_POST["per_call_notes"];}
if (isset($_GET["my_callback_option"])) {$my_callback_option=$_GET["my_callback_option"];}
elseif (isset($_POST["my_callback_option"])) {$my_callback_option=$_POST["my_callback_option"];}
if (isset($_GET["agent_lead_search"])) {$agent_lead_search=$_GET["agent_lead_search"];}
elseif (isset($_POST["agent_lead_search"])) {$agent_lead_search=$_POST["agent_lead_search"];}
if (isset($_GET["agent_lead_search_method"])) {$agent_lead_search_method=$_GET["agent_lead_search_method"];}
elseif (isset($_POST["agent_lead_search_method"])) {$agent_lead_search_method=$_POST["agent_lead_search_method"];}
if (isset($_GET["queuemetrics_phone_environment"])) {$queuemetrics_phone_environment=$_GET["queuemetrics_phone_environment"];}
elseif (isset($_POST["queuemetrics_phone_environment"])) {$queuemetrics_phone_environment=$_POST["queuemetrics_phone_environment"];}
if (isset($_GET["active_twin_server_ip"])) {$active_twin_server_ip=$_GET["active_twin_server_ip"];}
elseif (isset($_POST["active_twin_server_ip"])) {$active_twin_server_ip=$_POST["active_twin_server_ip"];}
if (isset($_GET["on_hook_agent"])) {$on_hook_agent=$_GET["on_hook_agent"];}
elseif (isset($_POST["on_hook_agent"])) {$on_hook_agent=$_POST["on_hook_agent"];}
if (isset($_GET["on_hook_ring_time"])) {$on_hook_ring_time=$_GET["on_hook_ring_time"];}
elseif (isset($_POST["on_hook_ring_time"])) {$on_hook_ring_time=$_POST["on_hook_ring_time"];}
if (isset($_GET["auto_pause_precall"])) {$auto_pause_precall=$_GET["auto_pause_precall"];}
elseif (isset($_POST["auto_pause_precall"])) {$auto_pause_precall=$_POST["auto_pause_precall"];}
if (isset($_GET["auto_resume_precall"])) {$auto_resume_precall=$_GET["auto_resume_precall"];}
elseif (isset($_POST["auto_resume_precall"])) {$auto_resume_precall=$_POST["auto_resume_precall"];}
if (isset($_GET["auto_pause_precall_code"])) {$auto_pause_precall_code=$_GET["auto_pause_precall_code"];}
elseif (isset($_POST["auto_pause_precall_code"])) {$auto_pause_precall_code=$_POST["auto_pause_precall_code"];}
if (isset($_GET["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_GET["reload_dialplan_on_servers"];}
elseif (isset($_POST["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_POST["reload_dialplan_on_servers"];}
if (isset($_GET["manual_dial_cid"])) {$manual_dial_cid=$_GET["manual_dial_cid"];}
elseif (isset($_POST["manual_dial_cid"])) {$manual_dial_cid=$_POST["manual_dial_cid"];}
if (isset($_GET["post_phone_time_diff_alert"])) {$post_phone_time_diff_alert=$_GET["post_phone_time_diff_alert"];}
elseif (isset($_POST["post_phone_time_diff_alert"])) {$post_phone_time_diff_alert=$_POST["post_phone_time_diff_alert"];}
if (isset($_GET["custom_3way_button_transfer"])) {$custom_3way_button_transfer=$_GET["custom_3way_button_transfer"];}
elseif (isset($_POST["custom_3way_button_transfer"])) {$custom_3way_button_transfer=$_POST["custom_3way_button_transfer"];}
if (isset($_GET["available_only_tally_threshold"])) {$available_only_tally_threshold=$_GET["available_only_tally_threshold"];}
elseif (isset($_POST["available_only_tally_threshold"])) {$available_only_tally_threshold=$_POST["available_only_tally_threshold"];}
if (isset($_GET["available_only_tally_threshold_agents"])) {$available_only_tally_threshold_agents=$_GET["available_only_tally_threshold_agents"];}
elseif (isset($_POST["available_only_tally_threshold_agents"])) {$available_only_tally_threshold_agents=$_POST["available_only_tally_threshold_agents"];}
if (isset($_GET["dial_level_threshold"])) {$dial_level_threshold=$_GET["dial_level_threshold"];}
elseif (isset($_POST["dial_level_threshold"])) {$dial_level_threshold=$_POST["dial_level_threshold"];}
if (isset($_GET["dial_level_threshold_agents"])) {$dial_level_threshold_agents=$_GET["dial_level_threshold_agents"];}
elseif (isset($_POST["dial_level_threshold_agents"])) {$dial_level_threshold_agents=$_POST["dial_level_threshold_agents"];}
if (isset($_GET["time_zone_setting"])) {$time_zone_setting=$_GET["time_zone_setting"];}
elseif (isset($_POST["time_zone_setting"])) {$time_zone_setting=$_POST["time_zone_setting"];}
if (isset($_GET["safe_harbor_audio"])) {$safe_harbor_audio=$_GET["safe_harbor_audio"];}
elseif (isset($_POST["safe_harbor_audio"])) {$safe_harbor_audio=$_POST["safe_harbor_audio"];}
if (isset($_GET["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_GET["safe_harbor_menu_id"];}
elseif (isset($_POST["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_POST["safe_harbor_menu_id"];}
if (isset($_GET["dtmf_log"])) {$dtmf_log=$_GET["dtmf_log"];}
elseif (isset($_POST["dtmf_log"])) {$dtmf_log=$_POST["dtmf_log"];}
if (isset($_GET["webphone_auto_answer"])) {$webphone_auto_answer=$_GET["webphone_auto_answer"];}
elseif (isset($_POST["webphone_auto_answer"])) {$webphone_auto_answer=$_POST["webphone_auto_answer"];}
if (isset($_GET["survey_menu_id"])) {$survey_menu_id=$_GET["survey_menu_id"];}
elseif (isset($_POST["survey_menu_id"])) {$survey_menu_id=$_POST["survey_menu_id"];}
if (isset($_GET["callback_days_limit"])) {$callback_days_limit=$_GET["callback_days_limit"];}
elseif (isset($_POST["callback_days_limit"])) {$callback_days_limit=$_POST["callback_days_limit"];}
if (isset($_GET["dl_diff_target_method"])) {$dl_diff_target_method=$_GET["dl_diff_target_method"];}
elseif (isset($_POST["dl_diff_target_method"])) {$dl_diff_target_method=$_POST["dl_diff_target_method"];}
if (isset($_GET["disable_dispo_screen"])) {$disable_dispo_screen=$_GET["disable_dispo_screen"];}
elseif (isset($_POST["disable_dispo_screen"])) {$disable_dispo_screen=$_POST["disable_dispo_screen"];}
if (isset($_GET["disable_dispo_status"])) {$disable_dispo_status=$_GET["disable_dispo_status"];}
elseif (isset($_POST["disable_dispo_status"])) {$disable_dispo_status=$_POST["disable_dispo_status"];}
if (isset($_GET["screen_labels"])) {$screen_labels=$_GET["screen_labels"];}
elseif (isset($_POST["screen_labels"])) {$screen_labels=$_POST["screen_labels"];}
if (isset($_GET["label_hide_field_logs"])) {$label_hide_field_logs=$_GET["label_hide_field_logs"];}
elseif (isset($_POST["label_hide_field_logs"])) {$label_hide_field_logs=$_POST["label_hide_field_logs"];}
if (isset($_GET["label_id"])) {$label_id=$_GET["label_id"];}
elseif (isset($_POST["label_id"])) {$label_id=$_POST["label_id"];}
if (isset($_GET["label_name"])) {$label_name=$_GET["label_name"];}
elseif (isset($_POST["label_name"])) {$label_name=$_POST["label_name"];}
if (isset($_GET["status_display_fields"])) {$status_display_fields=$_GET["status_display_fields"];}
elseif (isset($_POST["status_display_fields"])) {$status_display_fields=$_POST["status_display_fields"];}
if (isset($_GET["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_GET["queuemetrics_pe_phone_append"];}
elseif (isset($_POST["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_POST["queuemetrics_pe_phone_append"];}
if (isset($_GET["test_campaign_calls"])) {$test_campaign_calls=$_GET["test_campaign_calls"];}
elseif (isset($_POST["test_campaign_calls"])) {$test_campaign_calls=$_POST["test_campaign_calls"];}
if (isset($_GET["agents_calls_reset"])) {$agents_calls_reset=$_GET["agents_calls_reset"];}
elseif (isset($_POST["agents_calls_reset"])) {$agents_calls_reset=$_POST["agents_calls_reset"];}
if (isset($_GET["voicemail_timezone"])) {$voicemail_timezone=$_GET["voicemail_timezone"];}
elseif (isset($_POST["voicemail_timezone"])) {$voicemail_timezone=$_POST["voicemail_timezone"];}
if (isset($_GET["voicemail_options"])) {$voicemail_options=$_GET["voicemail_options"];}
elseif (isset($_POST["voicemail_options"])) {$voicemail_options=$_POST["voicemail_options"];}
if (isset($_GET["default_voicemail_timezone"])) {$default_voicemail_timezone=$_GET["default_voicemail_timezone"];}
elseif (isset($_POST["default_voicemail_timezone"])) {$default_voicemail_timezone=$_POST["default_voicemail_timezone"];}
if (isset($_GET["default_local_gmt"])) {$default_local_gmt=$_GET["default_local_gmt"];}
elseif (isset($_POST["default_local_gmt"])) {$default_local_gmt=$_POST["default_local_gmt"];}
if (isset($script_id)) {$script_id= strtoupper($script_id);}
if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);}
if (strlen($dial_status) > 0)
{
$ADD='28';
$status = $dial_status;
}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active,custom_fields_enabled,admin_web_directory,webphone_url,first_login_trigger,hosted_settings,default_phone_registration_password,default_phone_login_password,default_server_password,test_campaign_calls,active_voicemail_server,voicemail_timezones,default_voicemail_timezone,default_local_gmt 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];
$SSenable_queuemetrics_logging = $row[1];
$SSenable_vtiger_integration = $row[2];
$SSqc_features_active = $row[3];
$SSoutbound_autodial_active = $row[4];
$SSsounds_central_control_active = $row[5];
$SSenable_second_webform = $row[6];
$SSuser_territories_active = $row[7];
$SScustom_fields_enabled = $row[8];
$SSadmin_web_directory = $row[9];
$SSwebphone_url = $row[10];
$SSfirst_login_trigger = $row[11];
$SShosted_settings = $row[12];
$SSdefault_phone_registration_password =$row[13];
$SSdefault_phone_login_password = $row[14];
$SSdefault_server_password = $row[15];
$SStest_campaign_calls = $row[16];
$SSactive_voicemail_server = $row[17];
$SSvoicemail_timezones = $row[18];
$SSdefault_voicemail_timezone = $row[19];
$SSdefault_local_gmt = $row[20];
}
##### END SETTINGS LOOKUP #####
###########################################
######################################################################################################
######################################################################################################
####### Form variable filtering for security and data integrity
######################################################################################################
######################################################################################################
if ($non_latin < 1)
{
### DIGITS ONLY ###
$adaptive_latest_server_time = ereg_replace("[^0-9]","",$adaptive_latest_server_time);
$admin_hangup_enabled = ereg_replace("[^0-9]","",$admin_hangup_enabled);
$admin_hijack_enabled = ereg_replace("[^0-9]","",$admin_hijack_enabled);
$admin_monitor_enabled = ereg_replace("[^0-9]","",$admin_monitor_enabled);
$AFLogging_enabled = ereg_replace("[^0-9]","",$AFLogging_enabled);
$agent_choose_ingroups = ereg_replace("[^0-9]","",$agent_choose_ingroups);
$agentcall_manual = ereg_replace("[^0-9]","",$agentcall_manual);
$agentonly_callbacks = ereg_replace("[^0-9]","",$agentonly_callbacks);
$AGI_call_logging_enabled = ereg_replace("[^0-9]","",$AGI_call_logging_enabled);
$allcalls_delay = ereg_replace("[^0-9]","",$allcalls_delay);
$alter_agent_interface_options = ereg_replace("[^0-9]","",$alter_agent_interface_options);
$answer_transfer_agent = ereg_replace("[^0-9]","",$answer_transfer_agent);
$ast_admin_access = ereg_replace("[^0-9]","",$ast_admin_access);
$ast_delete_phones = ereg_replace("[^0-9]","",$ast_delete_phones);
$attempt_delay = ereg_replace("[^0-9]","",$attempt_delay);
$attempt_maximum = ereg_replace("[^0-9]","",$attempt_maximum);
$auto_dial_next_number = ereg_replace("[^0-9]","",$auto_dial_next_number);
$balance_trunks_offlimits = ereg_replace("[^0-9]","",$balance_trunks_offlimits);
$call_parking_enabled = ereg_replace("[^0-9]","",$call_parking_enabled);
$CallerID_popup_enabled = ereg_replace("[^0-9]","",$CallerID_popup_enabled);
$campaign_detail = ereg_replace("[^0-9]","",$campaign_detail);
$campaign_rec_exten = ereg_replace("[^0-9]","",$campaign_rec_exten);
$campaign_vdad_exten = ereg_replace("[^0-9]","",$campaign_vdad_exten);
$change_agent_campaign = ereg_replace("[^0-9]","",$change_agent_campaign);
$closer_default_blended = ereg_replace("[^0-9]","",$closer_default_blended);
$conf_exten = ereg_replace("[^0-9]","",$conf_exten);
$conf_on_extension = ereg_replace("[^0-9]","",$conf_on_extension);
$conferencing_enabled = ereg_replace("[^0-9]","",$conferencing_enabled);
$ct_default_start = ereg_replace("[^0-9]","",$ct_default_start);
$ct_default_stop = ereg_replace("[^0-9]","",$ct_default_stop);
$ct_friday_start = ereg_replace("[^0-9]","",$ct_friday_start);
$ct_friday_stop = ereg_replace("[^0-9]","",$ct_friday_stop);
$ct_monday_start = ereg_replace("[^0-9]","",$ct_monday_start);
$ct_monday_stop = ereg_replace("[^0-9]","",$ct_monday_stop);
$ct_saturday_start = ereg_replace("[^0-9]","",$ct_saturday_start);
$ct_saturday_stop = ereg_replace("[^0-9]","",$ct_saturday_stop);
$ct_sunday_start = ereg_replace("[^0-9]","",$ct_sunday_start);
$ct_sunday_stop = ereg_replace("[^0-9]","",$ct_sunday_stop);
$ct_thursday_start = ereg_replace("[^0-9]","",$ct_thursday_start);
$ct_thursday_stop = ereg_replace("[^0-9]","",$ct_thursday_stop);
$ct_tuesday_start = ereg_replace("[^0-9]","",$ct_tuesday_start);
$ct_tuesday_stop = ereg_replace("[^0-9]","",$ct_tuesday_stop);
$ct_wednesday_start = ereg_replace("[^0-9]","",$ct_wednesday_start);
$ct_wednesday_stop = ereg_replace("[^0-9]","",$ct_wednesday_stop);
$DBX_port = ereg_replace("[^0-9]","",$DBX_port);
$DBY_port = ereg_replace("[^0-9]","",$DBY_port);
$dedicated_trunks = ereg_replace("[^0-9]","",$dedicated_trunks);
$delete_call_times = ereg_replace("[^0-9]","",$delete_call_times);
$delete_campaigns = ereg_replace("[^0-9]","",$delete_campaigns);
$delete_filters = ereg_replace("[^0-9]","",$delete_filters);
$delete_ingroups = ereg_replace("[^0-9]","",$delete_ingroups);
$delete_lists = ereg_replace("[^0-9]","",$delete_lists);
$delete_remote_agents = ereg_replace("[^0-9]","",$delete_remote_agents);
$delete_scripts = ereg_replace("[^0-9]","",$delete_scripts);
$delete_user_groups = ereg_replace("[^0-9]","",$delete_user_groups);
$delete_users = ereg_replace("[^0-9]","",$delete_users);
$dial_timeout = ereg_replace("[^0-9]","",$dial_timeout);
$dialplan_number = ereg_replace("[^0-9]","",$dialplan_number);
$enable_fast_refresh = ereg_replace("[^0-9]","",$enable_fast_refresh);
$enable_persistant_mysql = ereg_replace("[^0-9]","",$enable_persistant_mysql);
$fast_refresh_rate = ereg_replace("[^0-9]","",$fast_refresh_rate);
$hopper_level = ereg_replace("[^0-9]","",$hopper_level);
$hotkey = ereg_replace("[^0-9]","",$hotkey);
$hotkeys_active = ereg_replace("[^0-9]","",$hotkeys_active);
$list_id = ereg_replace("[^0-9]","",$list_id);
$load_leads = ereg_replace("[^0-9]","",$load_leads);
$max_vicidial_trunks = ereg_replace("[^0-9]","",$max_vicidial_trunks);
$modify_call_times = ereg_replace("[^0-9]","",$modify_call_times);
$modify_users = ereg_replace("[^0-9]","",$modify_users);
$modify_campaigns = ereg_replace("[^0-9]","",$modify_campaigns);
$modify_lists = ereg_replace("[^0-9]","",$modify_lists);
$modify_scripts = ereg_replace("[^0-9]","",$modify_scripts);
$modify_filters = ereg_replace("[^0-9]","",$modify_filters);
$modify_ingroups = ereg_replace("[^0-9]","",$modify_ingroups);
$modify_usergroups = ereg_replace("[^0-9]","",$modify_usergroups);
$modify_remoteagents = ereg_replace("[^0-9]","",$modify_remoteagents);
$modify_servers = ereg_replace("[^0-9]","",$modify_servers);
$view_reports = ereg_replace("[^0-9]","",$view_reports);
$modify_leads = ereg_replace("[^0-9]","",$modify_leads);
$monitor_prefix = ereg_replace("[^0-9]","",$monitor_prefix);
$number_of_lines = ereg_replace("[^0-9]","",$number_of_lines);
$old_conf_exten = ereg_replace("[^0-9]","",$old_conf_exten);
$outbound_cid = ereg_replace("[^0-9]","",$outbound_cid);
$park_ext = ereg_replace("[^0-9]","",$park_ext);
$park_on_extension = ereg_replace("[^0-9]","",$park_on_extension);
$phone_number = ereg_replace("[^0-9]","",$phone_number);
$QUEUE_ACTION_enabled = ereg_replace("[^0-9]","",$QUEUE_ACTION_enabled);
$recording_exten = ereg_replace("[^0-9]","",$recording_exten);
$remote_agent_id = ereg_replace("[^0-9]","",$remote_agent_id);
$telnet_port = ereg_replace("[^0-9]","",$telnet_port);
$updater_check_enabled = ereg_replace("[^0-9]","",$updater_check_enabled);
$user_level = ereg_replace("[^0-9]","",$user_level);
$user_start = ereg_replace("[^0-9]","",$user_start);
$user_switching_enabled = ereg_replace("[^0-9]","",$user_switching_enabled);
$VDstop_rec_after_each_call = ereg_replace("[^0-9]","",$VDstop_rec_after_each_call);
$VICIDIAL_park_on_extension = ereg_replace("[^0-9]","",$VICIDIAL_park_on_extension);
$vicidial_recording = ereg_replace("[^0-9]","",$vicidial_recording);
$vicidial_transfers = ereg_replace("[^0-9]","",$vicidial_transfers);
$voicemail_button_enabled = ereg_replace("[^0-9]","",$voicemail_button_enabled);
$voicemail_dump_exten = ereg_replace("[^0-9]","",$voicemail_dump_exten);
$voicemail_exten = ereg_replace("[^0-9]","",$voicemail_exten);
$wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds);
$use_non_latin = ereg_replace("[^0-9]","",$use_non_latin);
$webroot_writable = ereg_replace("[^0-9]","",$webroot_writable);
$enable_queuemetrics_logging = ereg_replace("[^0-9]","",$enable_queuemetrics_logging);
$enable_sipsak_messages = ereg_replace("[^0-9]","",$enable_sipsak_messages);
$allow_sipsak_messages = ereg_replace("[^0-9]","",$allow_sipsak_messages);
$mix_container_item = ereg_replace("[^0-9]","",$mix_container_item);
$prompt_interval = ereg_replace("[^0-9]","",$prompt_interval);
$agent_alert_delay = ereg_replace("[^0-9]","",$agent_alert_delay);
$manual_dial_list_id = ereg_replace("[^0-9]","",$manual_dial_list_id);
$qc_user_level = ereg_replace("[^0-9]","",$qc_user_level);
$qc_pass = ereg_replace("[^0-9]","",$qc_pass);
$qc_finish = ereg_replace("[^0-9]","",$qc_finish);
$qc_commit = ereg_replace("[^0-9]","",$qc_commit);
$shift_start_time = ereg_replace("[^0-9]","",$shift_start_time);
$timeclock_end_of_day = ereg_replace("[^0-9]","",$timeclock_end_of_day);
$survey_xfer_exten = ereg_replace("[^0-9]","",$survey_xfer_exten);
$add_timeclock_log = ereg_replace("[^0-9]","",$add_timeclock_log);
$modify_timeclock_log = ereg_replace("[^0-9]","",$modify_timeclock_log);
$delete_timeclock_log = ereg_replace("[^0-9]","",$delete_timeclock_log);
$vdc_agent_api_access = ereg_replace("[^0-9]","",$vdc_agent_api_access);
$vdc_agent_api_active = ereg_replace("[^0-9]","",$vdc_agent_api_active);
$hold_time_option_seconds = ereg_replace("[^0-9]","",$hold_time_option_seconds);
$hold_time_option_callback_list_id = ereg_replace("[^0-9]","",$hold_time_option_callback_list_id);
$did_id = ereg_replace("[^0-9]","",$did_id);
$source_did = ereg_replace("[^0-9]","",$source_did);
$modify_inbound_dids = ereg_replace("[^0-9]","",$modify_inbound_dids);
$delete_inbound_dids = ereg_replace("[^0-9]","",$delete_inbound_dids);
$answer_sec_pct_rt_stat_one = ereg_replace("[^0-9]","",$answer_sec_pct_rt_stat_one);
$answer_sec_pct_rt_stat_two = ereg_replace("[^0-9]","",$answer_sec_pct_rt_stat_two);
$enable_vtiger_integration = ereg_replace("[^0-9]","",$enable_vtiger_integration);
$qc_features_active = ereg_replace("[^0-9]","",$qc_features_active);
$outbound_autodial_active = ereg_replace("[^0-9]","",$outbound_autodial_active);
$download_lists = ereg_replace("[^0-9]","",$download_lists);
$caller_id_number = ereg_replace("[^0-9]","",$caller_id_number);
$outbound_calls_per_second = ereg_replace("[^0-9]","",$outbound_calls_per_second);
$manager_shift_enforcement_override = ereg_replace("[^0-9]","",$manager_shift_enforcement_override);
$export_reports = ereg_replace("[^0-9]","",$export_reports);
$delete_from_dnc = ereg_replace("[^0-9]","",$delete_from_dnc);
$menu_timeout = ereg_replace("[^0-9]","",$menu_timeout);
$menu_time_check = ereg_replace("[^0-9]","",$menu_time_check);
$track_in_vdac = ereg_replace("[^0-9]","",$track_in_vdac);
$menu_repeat = ereg_replace("[^0-9]","",$menu_repeat);
$agentonly_callback_campaign_lock = ereg_replace("[^0-9]","",$agentonly_callback_campaign_lock);
$sounds_central_control_active = ereg_replace("[^0-9]","",$sounds_central_control_active);
$user_territories_active = ereg_replace("[^0-9]","",$user_territories_active);
$vicidial_recording_limit = ereg_replace("[^0-9]","",$vicidial_recording_limit);
$allow_custom_dialplan = ereg_replace("[^0-9]","",$allow_custom_dialplan);
$phone_ring_timeout = ereg_replace("[^0-9]","",$phone_ring_timeout);
$enable_tts_integration = ereg_replace("[^0-9]","",$enable_tts_integration);
$allow_alerts = ereg_replace("[^0-9]","",$allow_alerts);
$vicidial_balance_rank = ereg_replace("[^0-9]","",$vicidial_balance_rank);
$rank = ereg_replace("[^0-9]","",$rank);
$enable_second_webform = ereg_replace("[^0-9]","",$enable_second_webform);
$campaign_cid_override = ereg_replace("[^0-9]","",$campaign_cid_override);
$agent_choose_territories = ereg_replace("[^0-9]","",$agent_choose_territories);
$timer_action_seconds = ereg_replace("[^0-9]","",$timer_action_seconds);
$default_webphone = ereg_replace("[^0-9]","",$default_webphone);
$default_external_server_ip = ereg_replace("[^0-9]","",$default_external_server_ip);
$enable_agc_xfer_log = ereg_replace("[^0-9]","",$enable_agc_xfer_log);
$enable_agc_dispo_log = ereg_replace("[^0-9]","",$enable_agc_dispo_log);
$callcard_enabled = ereg_replace("[^0-9]","",$callcard_enabled);
$callcard_admin = ereg_replace("[^0-9]","",$callcard_admin);
$extension_id = ereg_replace("[^0-9]","",$extension_id);
$agent_choose_blended = ereg_replace("[^0-9]","",$agent_choose_blended);
$realtime_block_user_info = ereg_replace("[^0-9]","",$realtime_block_user_info);
$codecs_with_template = ereg_replace("[^0-9]","",$codecs_with_template);
$custom_fields_modify = ereg_replace("[^0-9]","",$custom_fields_modify);
$hold_time_option_minimum = ereg_replace("[^0-9]","",$hold_time_option_minimum);
$onhold_prompt_seconds = ereg_replace("[^0-9]","",$onhold_prompt_seconds);
$hold_time_option_prompt_seconds = ereg_replace("[^0-9]","",$hold_time_option_prompt_seconds);
$custom_fields_enabled = ereg_replace("[^0-9]","",$custom_fields_enabled);
$wait_time_option_seconds = ereg_replace("[^0-9]","",$wait_time_option_seconds);
$wait_time_option_callback_list_id = ereg_replace("[^0-9]","",$wait_time_option_callback_list_id);
$wait_time_option_prompt_seconds = ereg_replace("[^0-9]","",$wait_time_option_prompt_seconds);
$filter_list_id = ereg_replace("[^0-9]","",$filter_list_id);
$calculate_estimated_hold_seconds = ereg_replace("[^0-9]","",$calculate_estimated_hold_seconds);
$customer_3way_hangup_seconds = ereg_replace("[^0-9]","",$customer_3way_hangup_seconds);
$eht_minimum_prompt_seconds = ereg_replace("[^0-9]","",$eht_minimum_prompt_seconds);
$admin_modify_refresh = ereg_replace("[^0-9]","",$admin_modify_refresh);
$nocache_admin = ereg_replace("[^0-9]","",$nocache_admin);
$generate_cross_server_exten = ereg_replace("[^0-9]","",$generate_cross_server_exten);
$queuemetrics_addmember_enabled = ereg_replace("[^0-9]","",$queuemetrics_addmember_enabled);
$modify_page = ereg_replace("[^0-9]","",$modify_page);
$on_hook_ring_time = ereg_replace("[^0-9]","",$on_hook_ring_time);
$reload_dialplan_on_servers = ereg_replace("[^0-9]","",$reload_dialplan_on_servers);
$available_only_tally_threshold_agents = ereg_replace("[^0-9]","",$available_only_tally_threshold_agents);
$dial_level_threshold_agents = ereg_replace("[^0-9]","",$dial_level_threshold_agents);
$dtmf_log = ereg_replace("[^0-9]","",$dtmf_log);
$callback_days_limit = ereg_replace("[^0-9]","",$callback_days_limit);
$queuemetrics_pe_phone_append = ereg_replace("[^0-9]","",$queuemetrics_pe_phone_append);
$test_campaign_calls = ereg_replace("[^0-9]","",$test_campaign_calls);
$agents_calls_reset = ereg_replace("[^0-9]","",$agents_calls_reset);
$drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds);
### DIGITS and COLONS
$shift_length = ereg_replace("[^\:0-9]","",$shift_length);
### DIGITS and HASHES and STARS
$survey_dtmf_digits = ereg_replace("[^\#\*0-9]","",$survey_dtmf_digits);
$survey_ni_digit = ereg_replace("[^\#\*0-9]","",$survey_ni_digit);
### DIGITS and DASHES
$group_rank = ereg_replace("[^-0-9]","",$group_rank);
$campaign_rank = ereg_replace("[^-0-9]","",$campaign_rank);
$queue_priority = ereg_replace("[^-0-9]","",$queue_priority);
### DIGITS and NEWLINES
$phone_numbers = ereg_replace("[^X\n0-9]","",$phone_numbers);
### Y or N ONLY ###
$allow_closers = ereg_replace("[^NY]","",$allow_closers);
$reset_hopper = ereg_replace("[^NY]","",$reset_hopper);
$amd_send_to_vmx = ereg_replace("[^NY]","",$amd_send_to_vmx);
$alt_number_dialing = ereg_replace("[^NY]","",$alt_number_dialing);
$selectable = ereg_replace("[^NY]","",$selectable);
$reset_list = ereg_replace("[^NY]","",$reset_list);
$fronter_display = ereg_replace("[^NY]","",$fronter_display);
$omit_phone_code = ereg_replace("[^NY]","",$omit_phone_code);
$available_only_ratio_tally = ereg_replace("[^NY]","",$available_only_ratio_tally);
$sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log);
$vicidial_balance_active = ereg_replace("[^NY]","",$vicidial_balance_active);
$vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs);
$campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh);
$disable_alter_custdata = ereg_replace("[^NY]","",$disable_alter_custdata);
$no_hopper_leads_logins = ereg_replace("[^NY]","",$no_hopper_leads_logins);
$human_answered = ereg_replace("[^NY]","",$human_answered);
$tovdad_display = ereg_replace("[^NY]","",$tovdad_display);
$campaign_allow_inbound = ereg_replace("[^NY]","",$campaign_allow_inbound);
$old_campaign_allow_inbound = ereg_replace("[^NY]","",$old_campaign_allow_inbound);
$display_queue_count = ereg_replace("[^NY]","",$display_queue_count);
$qc_show_recording = ereg_replace("[^NY]","",$qc_show_recording);
$sale_category = ereg_replace("[^NY]","",$sale_category);
$dead_lead_category = ereg_replace("[^NY]","",$dead_lead_category);
$agent_extended_alt_dial = ereg_replace("[^NY]","",$agent_extended_alt_dial);
$play_place_in_line = ereg_replace("[^NY]","",$play_place_in_line);
$play_estimate_hold_time = ereg_replace("[^NY]","",$play_estimate_hold_time);
$no_delay_call_route = ereg_replace("[^NY]","",$no_delay_call_route);
$did_active = ereg_replace("[^NY]","",$did_active);
$active_asterisk_server = ereg_replace("[^NY]","",$active_asterisk_server);
$generate_vicidial_conf = ereg_replace("[^NY]","",$generate_vicidial_conf);
$rebuild_conf_files = ereg_replace("[^NY]","",$rebuild_conf_files);
$agent_allow_group_alias = ereg_replace("[^NY]","",$agent_allow_group_alias);
$vtiger_status_call = ereg_replace("[^NY]","",$vtiger_status_call);
$sale = ereg_replace("[^NY]","",$sale);
$dnc = ereg_replace("[^NY]","",$dnc);
$customer_contact = ereg_replace("[^NY]","",$customer_contact);
$not_interested = ereg_replace("[^NY]","",$not_interested);
$unworkable = ereg_replace("[^NY]","",$unworkable);
$sounds_update = ereg_replace("[^NY]","",$sounds_update);
$carrier_logging_active = ereg_replace("[^NY]","",$carrier_logging_active);
$agent_status_view_time = ereg_replace("[^NY]","",$agent_status_view_time);
$no_hopper_dialing = ereg_replace("[^NY]","",$no_hopper_dialing);
$agent_display_dialable_leads = ereg_replace("[^NY]","",$agent_display_dialable_leads);
$random = ereg_replace("[^NY]","",$random);
$rebuild_music_on_hold = ereg_replace("[^NY]","",$rebuild_music_on_hold);
$active_agent_login_server = ereg_replace("[^NY]","",$active_agent_login_server);
$agent_select_territories = ereg_replace("[^NY]","",$agent_select_territories);
$delete_vm_after_email = ereg_replace("[^NY]","",$delete_vm_after_email);
$crm_popup_login = ereg_replace("[^NY]","",$crm_popup_login);
$ignore_list_script_override = ereg_replace("[^NY]","",$ignore_list_script_override);
$is_webphone = ereg_replace("[^NY]","",$is_webphone);
$use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip);
$use_custom_cid = ereg_replace("[^NY]","",$use_custom_cid);
$agent_xfer_consultative = ereg_replace("[^NY]","",$agent_xfer_consultative);
$agent_xfer_dial_override = ereg_replace("[^NY]","",$agent_xfer_dial_override);
$agent_xfer_vm_transfer = ereg_replace("[^NY]","",$agent_xfer_vm_transfer);
$agent_xfer_blind_transfer = ereg_replace("[^NY]","",$agent_xfer_blind_transfer);
$agent_xfer_dial_with_customer = ereg_replace("[^NY]","",$agent_xfer_dial_with_customer);
$agent_xfer_park_customer_dial = ereg_replace("[^NY]","",$agent_xfer_park_customer_dial);
$agent_fullscreen = ereg_replace("[^NY]","",$agent_fullscreen);
$extension_appended_cidname = ereg_replace("[^NY]","",$extension_appended_cidname);
$onhold_prompt_no_block = ereg_replace("[^NY]","",$onhold_prompt_no_block);
$hold_time_option_no_block = ereg_replace("[^NY]","",$hold_time_option_no_block);
$wait_time_option_no_block = ereg_replace("[^NY]","",$wait_time_option_no_block);
$preset_hide_number = ereg_replace("[^NY]","",$preset_hide_number);
$use_auto_hopper = ereg_replace("[^NY]","",$use_auto_hopper);
$auto_trim_hopper = ereg_replace("[^NY]","",$auto_trim_hopper);
$force_change_password = ereg_replace("[^NY]","",$force_change_password);
$first_login_trigger = ereg_replace("[^NY]","",$first_login_trigger);
$eht_minimum_prompt_no_block = ereg_replace("[^NY]","",$eht_minimum_prompt_no_block);
$lead_order_randomize = ereg_replace("[^NY]","",$lead_order_randomize);
$on_hook_agent = ereg_replace("[^NY]","",$on_hook_agent);
$auto_pause_precall = ereg_replace("[^NY]","",$auto_pause_precall);
$auto_resume_precall = ereg_replace("[^NY]","",$auto_resume_precall);
$webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer);
$qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled);
$active = ereg_replace("[^0-9NY]","",$active);
### ALPHA-NUMERIC ONLY ###
$script_id = ereg_replace("[^0-9a-zA-Z]","",$script_id);
$agent_script_override = ereg_replace("[^0-9a-zA-Z]","",$agent_script_override);
$campaign_script = ereg_replace("[^0-9a-zA-Z]","",$campaign_script);
$submit = ereg_replace("[^0-9a-zA-Z]","",$submit);
$campaign_cid = ereg_replace("[^0-9a-zA-Z]","",$campaign_cid);
$get_call_launch = ereg_replace("[^0-9a-zA-Z]","",$get_call_launch);
$campaign_recording = ereg_replace("[^0-9a-zA-Z]","",$campaign_recording);
$ADD = ereg_replace("[^0-9a-zA-Z]","",$ADD);
$dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$dial_prefix);
$state_call_time_state = ereg_replace("[^0-9a-zA-Z]","",$state_call_time_state);
$scheduled_callbacks = ereg_replace("[^0-9a-zA-Z]","",$scheduled_callbacks);
$concurrent_transfers = ereg_replace("[^0-9a-zA-Z]","",$concurrent_transfers);
$billable = ereg_replace("[^0-9a-zA-Z]","",$billable);
$pause_code = ereg_replace("[^0-9a-zA-Z]","",$pause_code);
$vicidial_recording_override = ereg_replace("[^0-9a-zA-Z]","",$vicidial_recording_override);
$ingroup_recording_override = ereg_replace("[^0-9a-zA-Z]","",$ingroup_recording_override);
$queuemetrics_log_id = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_log_id);
$after_hours_exten = ereg_replace("[^0-9a-zA-Z]","",$after_hours_exten);
$after_hours_voicemail = ereg_replace("[^0-9a-zA-Z]","",$after_hours_voicemail);
$qc_script = ereg_replace("[^0-9a-zA-Z]","",$qc_script);
$code = ereg_replace("[^0-9a-zA-Z]","",$code);
$survey_no_response_action = ereg_replace("[^0-9a-zA-Z]","",$survey_no_response_action);
$survey_ni_status = ereg_replace("[^0-9a-zA-Z]","",$survey_ni_status);
$qc_get_record_launch = ereg_replace("[^0-9a-zA-Z]","",$qc_get_record_launch);
$agent_pause_codes_active = ereg_replace("[^0-9a-zA-Z]","",$agent_pause_codes_active);
$three_way_dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$three_way_dial_prefix);
$shift_enforcement = ereg_replace("[^0-9a-zA-Z]","",$shift_enforcement);
$agent_shift_enforcement_override = ereg_replace("[^0-9a-zA-Z]","",$agent_shift_enforcement_override);
$survey_third_status = ereg_replace("[^0-9a-zA-Z]","",$survey_third_status);
$survey_fourth_status = ereg_replace("[^0-9a-zA-Z]","",$survey_fourth_status);
$sounds_web_directory = ereg_replace("[^0-9a-zA-Z]","",$sounds_web_directory);
$disable_alter_custphone = ereg_replace("[^0-9a-zA-Z]","",$disable_alter_custphone);
$view_calls_in_queue = ereg_replace("[^0-9a-zA-Z]","",$view_calls_in_queue);
$view_calls_in_queue_launch = ereg_replace("[^0-9a-zA-Z]","",$view_calls_in_queue_launch);
$grab_calls_in_queue = ereg_replace("[^0-9a-zA-Z]","",$grab_calls_in_queue);
$call_requeue_button = ereg_replace("[^0-9a-zA-Z]","",$call_requeue_button);
$pause_after_each_call = ereg_replace("[^0-9a-zA-Z]","",$pause_after_each_call);
$use_internal_dnc = ereg_replace("[^0-9a-zA-Z]","",$use_internal_dnc);
$use_campaign_dnc = ereg_replace("[^0-9a-zA-Z]","",$use_campaign_dnc);
$voicemail_id = ereg_replace("[^0-9a-zA-Z]","",$voicemail_id);
$status_id = ereg_replace("[^0-9a-zA-Z]","",$status_id);
$agent_call_log_view = ereg_replace("[^0-9a-zA-Z]","",$agent_call_log_view);
$agent_call_log_view_override = ereg_replace("[^0-9a-zA-Z]","",$agent_call_log_view_override);
$queuemetrics_loginout = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_loginout);
$queuemetrics_callstatus = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_callstatus);
$filter_inbound_number = ereg_replace("[^0-9a-zA-Z]","",$filter_inbound_number);
$enable_xfer_presets = ereg_replace("[^0-9a-zA-Z]","",$enable_xfer_presets);
$hide_xfer_number_to_dial = ereg_replace("[^0-9a-zA-Z]","",$hide_xfer_number_to_dial);
$manual_dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$manual_dial_prefix);
$customer_3way_hangup_logging = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_logging);
$customer_3way_hangup_action = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_action);
$queuemetrics_dispo_pause = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_dispo_pause);
$per_call_notes = ereg_replace("[^0-9a-zA-Z]","",$per_call_notes);
$my_callback_option = ereg_replace("[^0-9a-zA-Z]","",$my_callback_option);
$auto_pause_precall_code = ereg_replace("[^0-9a-zA-Z]","",$auto_pause_precall_code);
$disable_dispo_status = ereg_replace("[^0-9a-zA-Z]","",$disable_dispo_status);
### DIGITS and Dots
$server_ip = ereg_replace("[^\.0-9]","",$server_ip);
$auto_dial_level = ereg_replace("[^\.0-9]","",$auto_dial_level);
$adaptive_maximum_level = ereg_replace("[^\.0-9]","",$adaptive_maximum_level);
$phone_ip = ereg_replace("[^\.0-9]","",$phone_ip);
$old_server_ip = ereg_replace("[^\.0-9]","",$old_server_ip);
$computer_ip = ereg_replace("[^\.0-9]","",$computer_ip);
$queuemetrics_server_ip = ereg_replace("[^\.0-9]","",$queuemetrics_server_ip);
$vtiger_server_ip = ereg_replace("[^\.0-9]","",$vtiger_server_ip);
$active_voicemail_server = ereg_replace("[^\.0-9]","",$active_voicemail_server);
$auto_dial_limit = ereg_replace("[^\.0-9]","",$auto_dial_limit);
$adaptive_dropped_percentage = ereg_replace("[^\.0-9]","",$adaptive_dropped_percentage);
$drop_lockout_time = ereg_replace("[^\.0-9]","",$drop_lockout_time);
$filter_server_ip = ereg_replace("[^\.0-9]","",$filter_server_ip);
$auto_hopper_multi = ereg_replace("[^\.0-9]","",$auto_hopper_multi);
### ALPHA-NUMERIC and spaces and hash and star and comma
$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf);
$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_b_dtmf);
$xferconf_c_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_c_dtmf);
$xferconf_d_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_d_dtmf);
$xferconf_e_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_e_dtmf);
$survey_third_digit = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_third_digit);
$survey_fourth_digit = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_digit);
$survey_third_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_third_exten);
$survey_fourth_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_exten);
$preset_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$preset_dtmf);
### ALPHACAPS-NUMERIC
$xferconf_a_number = ereg_replace("[^0-9A-Z]","",$xferconf_a_number);
$xferconf_b_number = ereg_replace("[^0-9A-Z]","",$xferconf_b_number);
### ALPHA-NUMERIC and underscore and dash
$agi_output = ereg_replace("[^-_0-9a-zA-Z]","",$agi_output);
$ASTmgrSECRET = ereg_replace("[^-_0-9a-zA-Z]","",$ASTmgrSECRET);
$ASTmgrUSERNAME = ereg_replace("[^-_0-9a-zA-Z]","",$ASTmgrUSERNAME);
$ASTmgrUSERNAMElisten = ereg_replace("[^-_0-9a-zA-Z]","",$ASTmgrUSERNAMElisten);
$ASTmgrUSERNAMEsend = ereg_replace("[^-_0-9a-zA-Z]","",$ASTmgrUSERNAMEsend);
$ASTmgrUSERNAMEupdate = ereg_replace("[^-_0-9a-zA-Z]","",$ASTmgrUSERNAMEupdate);
$call_time_id = ereg_replace("[^-_0-9a-zA-Z]","",$call_time_id);
$campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$campaign_id);
$CoNfIrM = ereg_replace("[^-_0-9a-zA-Z]","",$CoNfIrM);
$DBX_database = ereg_replace("[^-_0-9a-zA-Z]","",$DBX_database);
$DBX_pass = ereg_replace("[^-_0-9a-zA-Z]","",$DBX_pass);
$DBX_user = ereg_replace("[^-_0-9a-zA-Z]","",$DBX_user);
$DBY_database = ereg_replace("[^-_0-9a-zA-Z]","",$DBY_database);
$DBY_pass = ereg_replace("[^-_0-9a-zA-Z]","",$DBY_pass);
$DBY_user = ereg_replace("[^-_0-9a-zA-Z]","",$DBY_user);
$dial_method = ereg_replace("[^-_0-9a-zA-Z]","",$dial_method);
$dial_status_a = ereg_replace("[^-_0-9a-zA-Z]","",$dial_status_a);
$dial_status_b = ereg_replace("[^-_0-9a-zA-Z]","",$dial_status_b);
$dial_status_c = ereg_replace("[^-_0-9a-zA-Z]","",$dial_status_c);
$dial_status_d = ereg_replace("[^-_0-9a-zA-Z]","",$dial_status_d);
$dial_status_e = ereg_replace("[^-_0-9a-zA-Z]","",$dial_status_e);
$ext_context = ereg_replace("[^-_0-9a-zA-Z]","",$ext_context);
$group_id = ereg_replace("[^-_0-9a-zA-Z]","",$group_id);
$lead_filter_id = ereg_replace("[^-_0-9a-zA-Z]","",$lead_filter_id);
$local_call_time = ereg_replace("[^-_0-9a-zA-Z]","",$local_call_time);
$login = ereg_replace("[^-_0-9a-zA-Z]","",$login);
$login_campaign = ereg_replace("[^-_0-9a-zA-Z]","",$login_campaign);
$login_pass = ereg_replace("[^-_0-9a-zA-Z]","",$login_pass);
$login_user = ereg_replace("[^-_0-9a-zA-Z]","",$login_user);
$next_agent_call = ereg_replace("[^-_0-9a-zA-Z]","",$next_agent_call);
$old_campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$old_campaign_id);
$old_server_id = ereg_replace("[^-_0-9a-zA-Z]","",$old_server_id);
$OLDuser_group = ereg_replace("[^-_0-9a-zA-Z]","",$OLDuser_group);
$park_file_name = ereg_replace("[^-_0-9a-zA-Z]","",$park_file_name);
$pass = ereg_replace("[^-_0-9a-zA-Z]","",$pass);
$phone_login = ereg_replace("[^-_0-9a-zA-Z]","",$phone_login);
$phone_pass = ereg_replace("[^-_0-9a-zA-Z]","",$phone_pass);
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW);
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER);
$protocol = ereg_replace("[^-_0-9a-zA-Z]","",$protocol);
$server_id = ereg_replace("[^-_0-9a-zA-Z]","",$server_id);
$stage = ereg_replace("[^-_0-9a-zA-Z]","",$stage);
$state_rule = ereg_replace("[^-_0-9a-zA-Z]","",$state_rule);
$trunk_restriction = ereg_replace("[^-_0-9a-zA-Z]","",$trunk_restriction);
$user = ereg_replace("[^-_0-9a-zA-Z]","",$user);
$user_group = ereg_replace("[^-_0-9a-zA-Z]","",$user_group);
$VICIDIAL_park_on_filename = ereg_replace("[^-_0-9a-zA-Z]","",$VICIDIAL_park_on_filename);
$auto_alt_dial = ereg_replace("[^-_0-9a-zA-Z]","",$auto_alt_dial);
$dial_status = ereg_replace("[^-_0-9a-zA-Z]","",$dial_status);
$queuemetrics_eq_prepend = ereg_replace("[^-_0-9a-zA-Z]","",$queuemetrics_eq_prepend);
$vicidial_agent_disable = ereg_replace("[^-_0-9a-zA-Z]","",$vicidial_agent_disable);
$alter_custdata_override = ereg_replace("[^-_0-9a-zA-Z]","",$alter_custdata_override);
$list_order_mix = ereg_replace("[^-_0-9a-zA-Z]","",$list_order_mix);
$vcl_id = ereg_replace("[^-_0-9a-zA-Z]","",$vcl_id);
$mix_method = ereg_replace("[^-_0-9a-zA-Z]","",$mix_method);
$category = ereg_replace("[^-_0-9a-zA-Z]","",$category);
$vsc_id = ereg_replace("[^-_0-9a-zA-Z]","",$vsc_id);
$moh_context = ereg_replace("[^-_0-9a-zA-Z]","",$moh_context);
$source_campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$source_campaign_id);
$source_user_id = ereg_replace("[^-_0-9a-zA-Z]","",$source_user_id);
$source_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$source_group_id);
$default_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$default_xfer_group);
$drop_exten = ereg_replace("[^-_0-9a-zA-Z]","",$drop_exten);
$safe_harbor_exten = ereg_replace("[^-_0-9a-zA-Z]","",$safe_harbor_exten);
$drop_action = ereg_replace("[^-_0-9a-zA-Z]","",$drop_action);
$drop_inbound_group = ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group);
$afterhours_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$afterhours_xfer_group);
$after_hours_action = ereg_replace("[^-_0-9a-zA-Z]","",$after_hours_action);
$alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$alias_id);
$shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$shift_id);
$qc_shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$qc_shift_id);
$survey_first_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_first_audio_file);
$survey_opt_in_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_opt_in_audio_file);
$survey_ni_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_ni_audio_file);
$survey_method = ereg_replace("[^-_0-9a-zA-Z]","",$survey_method);
$alter_custphone_override = ereg_replace("[^-_0-9a-zA-Z]","",$alter_custphone_override);
$manual_dial_filter = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_filter);
$agent_clipboard_copy = ereg_replace("[^-_0-9a-zA-Z]","",$agent_clipboard_copy);
$hold_time_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_option);
$hold_time_option_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_option_xfer_group);
$hold_recall_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$hold_recall_xfer_group);
$play_welcome_message = ereg_replace("[^-_0-9a-zA-Z]","",$play_welcome_message);
$did_route = ereg_replace("[^-_0-9a-zA-Z]","",$did_route);
$user_unavailable_action = ereg_replace("[^-_0-9a-zA-Z]","",$user_unavailable_action);
$user_route_settings_ingroup = ereg_replace("[^-_0-9a-zA-Z]","",$user_route_settings_ingroup);
$call_handle_method = ereg_replace("[^-_0-9a-zA-Z]","",$call_handle_method);
$agent_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$agent_search_method);
$hold_time_option_voicemail = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_option_voicemail);
$exten_context = ereg_replace("[^-_0-9a-zA-Z]","",$exten_context);
$three_way_call_cid = ereg_replace("[^-_0-9a-zA-Z]","",$three_way_call_cid);
$web_form_target = ereg_replace("[^-_0-9a-zA-Z]","",$web_form_target);
$recording_web_link = ereg_replace("[^-_0-9a-zA-Z]","",$recording_web_link);
$vtiger_search_category = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_search_category);
$vtiger_create_call_record = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_create_call_record);
$vtiger_create_lead_record = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_create_lead_record);
$vtiger_screen_login = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_screen_login);
$cpd_amd_action = ereg_replace("[^-_0-9a-zA-Z]","",$cpd_amd_action);
$template_id = ereg_replace("[^-_0-9a-zA-Z]","",$template_id);
$carrier_id = ereg_replace("[^-_0-9a-zA-Z]","",$carrier_id);
$source_carrier = ereg_replace("[^-_0-9a-zA-Z]","",$source_carrier);
$group_alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$group_alias_id);
$default_group_alias = ereg_replace("[^-_0-9a-zA-Z]","",$default_group_alias);
$vtiger_search_dead = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_search_dead);
$survey_third_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_third_audio_file);
$survey_fourth_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_fourth_audio_file);
$menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$menu_id);
$source_menu = ereg_replace("[^-_0-9a-zA-Z]","",$source_menu);
$call_time_id = ereg_replace("[^-_0-9a-zA-Z]","",$call_time_id);
$phone_context = ereg_replace("[^-_0-9a-zA-Z]","",$phone_context);
$conf_secret = ereg_replace("[^-_0-9a-zA-Z]","",$conf_secret);
$tracking_group = ereg_replace("[^-_0-9a-zA-Z]","",$tracking_group);
$no_agent_no_queue = ereg_replace("[^-_0-9a-zA-Z]","",$no_agent_no_queue);
$no_agent_action = ereg_replace("[^-_0-9a-zA-Z]","",$no_agent_action);
$quick_transfer_button = ereg_replace("[^-_0-9a-zA-Z]","",$quick_transfer_button);
$prepopulate_transfer_preset = ereg_replace("[^-_0-9a-zA-Z]","",$prepopulate_transfer_preset);
$tts_id = ereg_replace("[^-_0-9a-zA-Z]","",$tts_id);
$drop_rate_group = ereg_replace("[^-_0-9a-zA-Z]","",$drop_rate_group);
$agent_dial_owner_only = ereg_replace("[^-_0-9a-zA-Z]","",$agent_dial_owner_only);
$reset_time = ereg_replace("[^-_0-9a-zA-Z]","",$reset_time);
$moh_id = ereg_replace("[^-_0-9a-zA-Z]","",$moh_id);
$drop_inbound_group_override = ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group_override);
$timer_action = ereg_replace("[^-_0-9a-zA-Z]","",$timer_action);
$record_call = ereg_replace("[^-_0-9a-zA-Z]","",$record_call);
$scheduled_callbacks_alert = ereg_replace("[^-_0-9a-zA-Z]","",$scheduled_callbacks_alert);
$extension_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group_id);
$extension_group = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group);
$scheduled_callbacks_count = ereg_replace("[^-_0-9a-zA-Z]","",$scheduled_callbacks_count);
$manual_dial_override = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_override);
$blind_monitor_warning = ereg_replace("[^-_0-9a-zA-Z]","",$blind_monitor_warning);
$uniqueid_status_display = ereg_replace("[^-_0-9a-zA-Z]","",$uniqueid_status_display);
$hold_time_option_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_option_callmenu);
$inbound_queue_no_dial = ereg_replace("[^-_0-9a-zA-Z]","",$inbound_queue_no_dial);
$hold_time_second_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_second_option);
$hold_time_third_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_third_option);
$wait_hold_option_priority = ereg_replace("[^-_0-9a-zA-Z]","",$wait_hold_option_priority);
$wait_time_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option);
$wait_time_second_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_second_option);
$wait_time_third_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_third_option);
$wait_time_option_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_xfer_group);
$wait_time_option_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_callmenu);
$wait_time_option_voicemail = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_voicemail);
$filter_phone_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_phone_group_id);
$filter_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_action);
$filter_user_unavailable_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_unavailable_action);
$filter_user_route_settings_ingroup = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_route_settings_ingroup);
$filter_agent_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_agent_search_method);
$filter_campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_campaign_id);
$filter_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_group_id);
$filter_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_menu_id);
$filter_call_handle_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_call_handle_method);
$filter_user = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user);
$filter_exten_context = ereg_replace("[^-_0-9a-zA-Z]","",$filter_exten_context);
$webphone_systemkey = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_systemkey);
$webphone_dialpad = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad);
$webphone_systemkey_override = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_systemkey_override);
$webphone_dialpad_override = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad_override);
$default_phone_registration_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_phone_registration_password);
$default_phone_login_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_phone_login_password);
$default_server_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_server_password);
$ivr_park_call = ereg_replace("[^-_0-9a-zA-Z]","",$ivr_park_call);
$manual_preview_dial = ereg_replace("[^-_0-9a-zA-Z]","",$manual_preview_dial);
$realtime_agent_time_stats = ereg_replace("[^-_0-9a-zA-Z]","",$realtime_agent_time_stats);
$api_manual_dial = ereg_replace("[^-_0-9a-zA-Z]","",$api_manual_dial);
$manual_dial_call_time_check = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_call_time_check);
$lead_order_secondary = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_secondary);
$agent_lead_search = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search);
$agent_lead_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search_method);
$manual_dial_cid = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_cid);
$post_phone_time_diff_alert = ereg_replace("[^-_0-9a-zA-Z]","",$post_phone_time_diff_alert);
$custom_3way_button_transfer = ereg_replace("[^-_0-9a-zA-Z]","",$custom_3way_button_transfer);
$available_only_tally_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$available_only_tally_threshold_agents);
$dial_level_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$dial_level_threshold_agents);
$time_zone_setting = ereg_replace("[^-_0-9a-zA-Z]","",$time_zone_setting);
$safe_harbor_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$safe_harbor_menu_id);
$survey_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$survey_menu_id);
$dl_diff_target_method = ereg_replace("[^-_0-9a-zA-Z]","",$dl_diff_target_method);
$disable_dispo_screen = ereg_replace("[^-_0-9a-zA-Z]","",$disable_dispo_screen);
$screen_labels = ereg_replace("[^-_0-9a-zA-Z]","",$screen_labels);
$label_hide_field_logs = ereg_replace("[^-_0-9a-zA-Z]","",$label_hide_field_logs);
$label_id = ereg_replace("[^-_0-9a-zA-Z]","",$label_id);
$status_display_fields = ereg_replace("[^-_0-9a-zA-Z]","",$status_display_fields);
$voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$voicemail_timezone);
$default_voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$default_voicemail_timezone);
### ALPHA-NUMERIC and underscore and dash and slash and dot
$menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt);
$menu_timeout_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_timeout_prompt);
$menu_invalid_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_invalid_prompt);
$after_hours_message_filename = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$after_hours_message_filename);
$welcome_message_filename = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$welcome_message_filename);
$onhold_prompt_filename = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$onhold_prompt_filename);
$hold_time_option_callback_filename = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$hold_time_option_callback_filename);
$agent_alert_exten = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$agent_alert_exten);
$filename = ereg_replace("[^-\/\._0-9a-zA-Z]","",$filename);
$am_message_exten = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten);
$am_message_exten_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten_override);
$campaign_groups = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$campaign_groups);
$blind_monitor_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$blind_monitor_filename);
$hold_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$hold_time_option_press_filename);
$default_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$default_afterhours_filename_override);
$sunday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$sunday_afterhours_filename_override);
$monday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$monday_afterhours_filename_override);
$tuesday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$tuesday_afterhours_filename_override);
$wednesday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wednesday_afterhours_filename_override);
$thursday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$thursday_afterhours_filename_override);
$friday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$friday_afterhours_filename_override);
$saturday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$saturday_afterhours_filename_override);
$admin_web_directory = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$admin_web_directory);
$tts_voice = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$tts_voice);
$wait_time_option_callback_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_callback_filename);
$wait_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_press_filename);
$eht_minimum_prompt_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$eht_minimum_prompt_filename);
$queuemetrics_phone_environment = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$queuemetrics_phone_environment);
$active_twin_server_ip = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$active_twin_server_ip);
$safe_harbor_audio = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$safe_harbor_audio);
### ALPHA-NUMERIC and underscore and dash and comma
$logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list);
$forced_timeclock_login = ereg_replace("[^-\,\_0-9a-zA-Z]","",$forced_timeclock_login);
$uniqueid_status_prefix = ereg_replace("[^-\,\_0-9a-zA-Z]","",$uniqueid_status_prefix);
### ALPHA-NUMERIC and dots
$sounds_web_server = ereg_replace("[^\.0-9a-zA-Z]","",$sounds_web_server);
### ALPHA-NUMERIC and spaces
$lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order);
### ALPHA-NUMERIC and spaces and dashes and underscores
$preset_name = ereg_replace("[^ -\_0-9a-zA-Z]","",$preset_name);
### ALPHA-NUMERIC and hash
$group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color);
### ALPHA-NUMERIC and hash and star and dot and underscore
$hold_time_option_exten = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$hold_time_option_exten);
$did_pattern = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$did_pattern);
$voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$voicemail_ext);
$phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone);
$phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone_code);
$wait_time_option_exten = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$wait_time_option_exten);
$filter_voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_voicemail_ext);
$filter_phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone_code);
$filter_phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone);
$preset_number = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$preset_number);
### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores
$adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target);
$adaptive_intensity = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_intensity);
$asterisk_version = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$asterisk_version);
$call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments);
$call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name);
$campaign_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_name);
$campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename);
$ingroup_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$ingroup_rec_filename);
$company = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$company);
$full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name);
$fullname = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$fullname);
$group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_name);
$HKstatus = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$HKstatus);
$lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comments);
$lead_filter_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_name);
$list_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_name);
$local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt);
$phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type);
$picture = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$picture);
$script_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_comments);
$script_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_name);
$server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description);
$status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status);
$status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name);
$wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message);
$pause_code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$pause_code_name);
$campaign_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_description);
$list_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_description);
$vcl_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vcl_name);
$vsc_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_name);
$vsc_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_description);
$code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$code_name);
$alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alias_name);
$shift_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$shift_name);
$did_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$did_description);
$alt_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alt_server_ip);
$template_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$template_name);
$carrier_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$carrier_name);
$group_alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_alias_name);
$caller_id_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$caller_id_name);
$user_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$user_code);
$territory = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$territory);
$tts_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$tts_name);
$moh_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$moh_name);
$timer_action_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$timer_action_message);
$external_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$external_server_ip);
$default_codecs = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$default_codecs);
$codecs_list = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$codecs_list);
$label_title = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_title);
$label_first_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_first_name);
$label_middle_initial = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_middle_initial);
$label_last_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_last_name);
$label_address1 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address1);
$label_address2 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address2);
$label_address3 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address3);
$label_city = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_city);
$label_state = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_state);
$label_province = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_province);
$label_postal_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_postal_code);
$label_vendor_lead_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_vendor_lead_code);
$label_gender = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_gender);
$label_phone_number = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_phone_number);
$label_phone_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_phone_code);
$label_alt_phone = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_alt_phone);
$label_security_phrase = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_security_phrase);
$label_email = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_email);
$label_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_comments);
$slave_db_server = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$slave_db_server);
$filter_phone_group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_phone_group_name);
$filter_phone_group_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_phone_group_description);
$filter_clean_cid_number = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_clean_cid_number);
$label_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_name);
$default_local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$default_local_gmt);
### ALPHA-NUMERIC and underscore and dash and slash and at and dot
$call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group);
$client_browser = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$client_browser);
$DBX_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBX_server);
$DBY_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBY_server);
$dtmf_send_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$dtmf_send_extension);
$install_directory = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$install_directory);
$old_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$old_extension);
$telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host);
$queuemetrics_dbname = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_dbname);
$queuemetrics_login = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_login);
$queuemetrics_pass = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_pass);
$email = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$email);
$vtiger_dbname = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$vtiger_dbname);
$vtiger_login = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$vtiger_login);
$vtiger_pass = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$vtiger_pass);
$custom_one = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_one);
$custom_two = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_two);
$custom_three = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_three);
$custom_four = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_four);
$custom_five = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_five);
### ALPHA-NUMERIC and underscore and dash and slash and at and dot and pound and star
$extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$extension);
$timer_action_destination = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$timer_action_destination);
$filter_extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$filter_extension);
### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma
$ivr_park_call_agi = ereg_replace("[^ -\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$ivr_park_call_agi);
### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma and equal
$voicemail_options = ereg_replace("[^ -\=\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$voicemail_options);
### NUMERIC and comma and pipe
$waitforsilence_options = ereg_replace("[^\|\,0-9]","",$waitforsilence_options);
### value cleaning
$no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value);
### ALPHA-NUMERIC and underscore and dash and slash and at and space and colon
$vdc_header_date_format = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$vdc_header_date_format);
$vdc_customer_date_format = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$vdc_customer_date_format);
$menu_name = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$menu_name);
### ALPHA-NUMERIC and underscore and dash and at and space and parantheses
$vdc_header_phone_format = ereg_replace("[^- \(\)\_0-9a-zA-Z]","",$vdc_header_phone_format);
### remove semi-colons ###
$lead_filter_sql = ereg_replace(";","",$lead_filter_sql);
$list_mix_container = ereg_replace(";","",$list_mix_container);
$survey_response_digit_map = ereg_replace(";","",$survey_response_digit_map);
$survey_camp_record_dir = ereg_replace(";","",$survey_camp_record_dir);
$conf_override = ereg_replace(";","",$conf_override);
$template_contents = ereg_replace(";","",$template_contents);
$registration_string = ereg_replace(";","",$registration_string);
$account_entry = ereg_replace(";","",$account_entry);
$account_entry = ereg_replace("\r","",$account_entry);
$globals_string = ereg_replace(";","",$globals_string);
$dialplan_entry = ereg_replace(";","",$dialplan_entry);
$dialplan_entry = ereg_replace("\r","",$dialplan_entry);
$custom_dialplan_entry = ereg_replace("\\\\","",$custom_dialplan_entry);
$custom_dialplan_entry = ereg_replace("'","",$custom_dialplan_entry);
$custom_dialplan_entry = ereg_replace("\r","",$custom_dialplan_entry);
$tts_text = ereg_replace("\\\\","",$tts_text);
$tts_text = ereg_replace(";","",$tts_text);
$tts_text = ereg_replace("\r","",$tts_text);
$tts_text = ereg_replace("\"","",$tts_text);
$carrier_description = ereg_replace("\\\\","",$carrier_description);
$carrier_description = ereg_replace(";","",$carrier_description);
$carrier_description = ereg_replace("\r","",$carrier_description);
$carrier_description = ereg_replace("\"","",$carrier_description);
$blind_monitor_message = ereg_replace("\\\\","",$blind_monitor_message);
$blind_monitor_message = ereg_replace(";","",$blind_monitor_message);
$blind_monitor_message = ereg_replace("\r","",$blind_monitor_message);
$blind_monitor_message = ereg_replace("\"","",$blind_monitor_message);
$modify_url = ereg_replace("\\\\","",$modify_url);
$modify_url = ereg_replace(";","",$modify_url);
$modify_url = ereg_replace("\r","",$modify_url);
$modify_url = ereg_replace("\"","",$modify_url);
### VARIABLES TO BE mysql_real_escape_string ###
# $web_form_address
# $queuemetrics_url
# $admin_home_url
# $qc_web_form_address
# $vtiger_url
# $web_form_address_two
# $crm_login_address
# $start_call_url
# $dispo_call_url
# $add_lead_url
# $webphone_url
# $webphone_url_override
# $filter_url
### VARIABLES not filtered at all ###
# $script_text
} # end of non_latin
else
{
$PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW);
$PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER);
}
##### END VARIABLE FILTERING FOR SECURITY #####
# ViciDial database administration
# admin.php
#
# CHANGELOG:
# 50315-1110 - Added Custom Campaign Statuses
# 50317-1438 - Added Fronter Display var to inbound groups
# 50322-1355 - Added custom callerID per campaign
# 50517-1356 - Added user_groups sections and user_group to vicidial_users
# 50517-1440 - Added ability to logout (must click OK with empty user/pass)
# 50602-1622 - Added lead loader pages to load new files into vicidial_list
# 50620-1351 - Added custom vdad transfer AGI extension per campaign
# 50810-1414 - modified in groups to kick out spaces and dashes
# 50908-2136 - Added Custom Campaign HotKeys
# 50914-0950 - Fixed user search by user_group
# 50926-1358 - Modified to allow for language translation
# 50926-1615 - Added WeBRooTWritablE write controls
# 51020-1008 - Added editable web address and park ext - NEW dial campaigns
# 51020-1056 - Added fields and help for campaign recording control
# 51123-1335 - Altered code to function in php globals=off
# 51208-1038 - Added user_level changes, function controls and default user phones
# 51208-1556 - Added deletion of users/lists/campaigns/in groups/remote agents
# 51213-1706 - Added add/delete/modify vicidial scripts
# 51214-1737 - Added preview of vicidial script in popup window
# 51219-1225 - Added campaign and ingroups script selector and get_call_launch field
# 51222-1055 - Added am_message_exten to campaigns to allow for AM Message button
# 51222-1125 - Fixed new vicidial_campaigns default values not being assigned bug
# 51222-1156 - Added LOG OUT ALL AGENTS ON THIS CAMPAIGN button to campaign screen
# 60204-0659 - Fixed hopper reset bug
# 60207-1413 - Added AMD send to voicemail extension and xfer-conf dtmf presets
# 60213-1100 - Added several vicidial_users permissions fields
# 60215-1319 - Added On-hold CallBacks display and links
# 60227-1226 - Fixed vicidial_inbound_groups insert bug
# 60413-1308 - Fixed list display to have 1 row/status: count and time zone tables
# - Added status name in selected dial statuses in campaign screen
# 60417-1416 - Added vicidial_lead_filters sections
# - Changed the header links to color-coded sectional with sublinks below
# - Added filter name and script name to campaign and in-group modify sections
# - Added callback and alt dial options to campaigns section
# - Added callback, alt dial and other options to users section
# 60419-1628 - Alter Callbacks display to include status and LIVE listings, reordered
# 60421-1441 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60425-2355 - Added agent options to vicidial_users, reformatted user page
# 60502-1627 - Added drop_call_seconds and safe_harbor_ fields to campaign screen
# 60503-1228 - Added drop_call_seconds and drop_ fields to inbound groups screen
# 60505-1117 - Added initial framework for new local_call_times tables and definitions
# 60506-1033 - More revisions to the local_call_time section
# 60508-1354 - Finished call_times and state_call_times sections
# - Added modify/delete options for call_times
# 60509-1311 - Functionalize campaign dialable leads calculation
# - Change state_call_times selection from call_times to only allow one per state
# - Added dialable leads count popup to campaign screen if auto-calc is disabled
# - Added test dialable leads count popup to filter screen
# 60510-1050 - Added Wrapup seconds and Wrapup message to campaigns screen
# 60608-1401 - Added allowable inbound_groups checkboxes to CLOSER campaign detail screen
# 60609-1051 - Added add-to-dnc in LISTS section
# 60613-1415 - Added lead recycling options to campaign detail screen
# 60619-1523 - Added variable filtering to eliminate SQL injection attack threat
# 60622-1216 - Fixed HotKey addition form issues and variable filtering
# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug and filter_sql bug
# 60808-1147 - Changed filtering for and added instructions for consutative transfers
# 60816-1552 - Added allcalls_delay start delay for recordings in vicidial.php
# 60817-2226 - Fixed bug that would not allow lead recycling of non-selectable statuses
# 60821-1543 - Added option to Omit Phone Code while dialing in vicidial
# 60821-1625 - Added ALLFORCE recording option for campaign_recording
# 60823-1154 - Added fields for adaptive dialing
# 60824-1326 - Added adaptive_latest_target_gmt for ADAPT_TAPERED dial method
# 60825-1205 - Added adaptive_intensity for ADAPT_ dial methods
# 60828-1019 - Changed adaptive_latest_target_gmt to adaptive_latest_server_time
# 60828-1115 - Added adaptive_dl_diff_target and changed intensity dropdown
# 60927-1246 - Added astguiclient/admin.php functions under SERVERS tab
# 61002-1402 - Added fields for vicidial balance trunk controls
# 61003-1123 - Added functions for vicidial_server_trunks records
# 61109-1022 - Added Emergency VDAC Jam Clear function to Campaign Detail screen
# 61110-1502 - Add ability to select NONE in dial statuses, new list_id must not be < 100
# 61122-1228 - Added user group campaign restrictions
# 61122-1535 - Changed script_text to unfiltered and added more variables to SCRIPTS
# 61129-1028 - Added headers to Users and Phones with clickable order-by titles
# 70108-1405 - Added ADAPT OVERRIDE to allow for forced dial_level changes in ADAPT dial methods
# - Screen width definable at top of script, merged server_stats into this script
# 70109-1638 - Added ALTPH2 and ADDR3 hotkey options for alt number dialing with HotKeys
# 70109-1716 - Added concurrent_transfers option to vicidial_campaigns
# 70115-1152 - Aded (CLOSER|BLEND|INBND|_C$|_B$|_I$) options for CLOSER-type campaigns
# 70115-1532 - Added auto_alt_dial field to campaign screen for auto-dialing of alt numbers
# 70116-1200 - Added auto_alt_dial_status functionality to campaign screen
# 70117-1235 - Added header formatting variables at top of script
# - Moved Call Times and Phones/Server functions to Admin section
# 70118-1706 - Added new user group displays and links
# 70123-1519 - Added user permission settings for all sections
# 70124-1346 - Fixed spelling errors and formatting consistency
# 70202-1120 - Added agent_pause_codes section to campaigns
# 70205-1204 - Added memo, last dialed, timestamp and stats-refresh fields to vicidial_campaigns/lists
# 70206-1323 - Added user setting for vicidial_recording_override
# 70212-1412 - Added system settings section
# 70214-1226 - Added QueueMetrics Log ID field to system settings section
# 70219-1102 - Changed campaign dial statuses to be one string allowing for high limit
# 70223-0957 - Added queuemetrics_eq_prepend for custom ENTERQUEUE prepending of a field
# 70302-1111 - Fixed small bug in dialable leads calculation
# 70314-1133 - Added insert selection on script forms
# 70319-1423 - Added Alter Customer Data and agent disable display functions
# 70319-1625 - Added option to allow agents to login to outbound campaigns with no leads in the hopper
# 70322-1455 - Added sipsak messages parameters
# 70402-1157 - Added HOME link and entry to system_settings table, added QM link on reports section
# 70516-1628 - Started reformatting campaigns to use submenus to break up options
# 70529-1653 - Added help for list mix
# 70530-1354 - Added human_answered field to statuses, added system status modification
# 70530-1714 - Added lists for all campaign subsections
# 70531-1631 - Development on List mix admin interface
# 70601-1629 - More development on List mix admin interface, formatting, and added some javascript
# 70602-1300 - More development on List mix admin interface, more javascript
# 70608-1459 - Added option to set LIVE Callbacks to INACTIVE after one month
# 70612-1451 - Added Callback INACTIVE link for after one week, sort by user/group/entrydate
# 70614-0231 - Added Status Categories, ability to Modify Statuses, moved system statuses to sub-section
# 70623-1008 - List Mix section now allows modification of list mix entries
# 70629-1721 - List Mix section adding and removing of list entries active
# 70706-1636 - List Mix section cleanup and more error-checking
# 70908-0941 - Added agc logile enable system_settings
# 71020-1934 - Added inbound groups options: on-hold music, messages, call_times
# 71022-1343 - Added inbound group ranks for users
# 71029-1710 - Added option for campaign to be inbound and/or blended with no restrictions on the campaign_id name
# - Added 5th NEW and 6th NEW to the dial order options
# 71030-2010 - Added Manual Dial List ID field to campaigns table
# 71103-2207 - Added inbound_group_rank and fewest_calls to the inbound groups call order options
# 71113-1521 - Added campaign_rank to agent options
# - Added ability to Copy a campaign's setting to a new campaign
# 71113-2225 - Added ability to copy user and in-group settings to new users and in-groups
# 71116-0942 - Added campaign_rank and fewest_calls as methods for agent call routing
# 71122-1135 - Added default transfer group for campaigns and inbound groups
# 71125-1751 - Added allowable transfer groups to campaign detail screen
# 80107-1204 - Started framework for new QC section
# 80112-0242 - Added more options for lead order
# 80211-1901 - Added DB Schema Version to system settings display
# 80224-1334 - Added Queue Priority to in-groups and campaigns
# 80302-0232 - added drop_action and transfer to in-group for both in-groups and outbound
# 80310-1504 - added QC settings section to campaign screen
# 80317-2037 - Added Recording override settings to in-groups
# 80414-1505 - More work on QC, added vicidial_qc_codes
# 80424-0442 - Added non_latin system_settings lookup at top to override dbconnect setting
# 80505-0333 - Added phones_alias sections to allow for load-balanced-phone-logins
# 80512-1529 - Added auto-generate of User ID feature
# 80515-1345 - Added Shifts sub-section to Admin section
# 80528-0001 - Added campaign survey sub-section
# 80528-1102 - Added user timeclock edit options
# 80608-1304 - Changed add-to-DNC to allow for multiple entries per submission
# 80625-0032 - Added time/phone display format options to system settings
# 80703-0124 - Added alter cust phone and api settings
# 80715-1130 - Added Recycle leads limit count
# 80719-1351 - Changed QC settings in campaigns and In-Groups
# 80809-2305 - Added Sale and Dead Lead categories to status categories page
# 80815-1036 - Added manual dial filter to capaigns
# 80823-2124 - Added copy to clipboard campaign option
# 80829-2359 - Added EXTENDED auto_alt_dial options
# 80831-0406 - Added agent screen extended alt-dial option to campaigns
# 80909-0553 - Added campaign-specific DNC list option and add
# 81002-1101 - Added more in-group options and new DID section and user options
# 81007-0936 - Added three_way_call_cid option to campaigns
# 81012-1725 - Added INBOUND_MAN dial method allowing for manual list dialing with inbound calls
# 81030-0348 - Added campaign pause code force option
# 81030-2228 - Fixed DIDs creation issue
# 81103-1408 - Added 3way call dial prefix option
# 81107-1551 - Added Stats Percent of Calls Answered Within X seconds fields to in-groups
# 81118-0933 - Changed lists listing with links and more options
# 81119-0715 - Added ability to bulk enable/disable lists from modify campaign screen
# 81209-1538 - Added web_form_target to campaign screen
# 81210-1430 - Added http server IP and recording link options to servers
# 81222-0500 - Reformatted all listings to same format changed to field selects instead of *
# 81228-2300 - Added fields for vtiger integration and active vicidial_user display
# 90101-1216 - Added options for user synchronization with vtiger
# 90112-0335 - Added vtiger_create_lead_record and vtiger_create_lead_record options
# 90115-0502 - Activated AGENT DID routing option
# 90126-2256 - Added vtiger_screen_login campaign option and user agent alert option
# 90201-1503 - Added option to disable the viewing of inactive QC features
# 90202-0112 - Added option to disable outbound autodialing(or list dialing)
# 90202-0444 - Added cpd_amd_action option for processing of AMD messages
# 90209-1339 - Added download_lists option to allow downloading of lists
# 90210-1042 - Added options for auto-generation of asterisk conf files
# 90301-2026 - Added Vtiger group synchronization
# 90302-2046 - Changed Section heading to be on the left side of the screen
# 90303-0631 - Added web vars to agent campaign and in-group settings
# 90303-2047 - Added group aliases and default group aliases
# 90306-1214 - Added shift enforcement and server/system calls per second options
# 90308-0956 - Added server statistics
# 90309-0059 - Changed logging to admin_server_log
# 90310-2203 - Added export_reports option for call activity report data exports
# 90315-1010 - Changed revision for new trunk 2.2.0
# 90320-0424 - Fixed several small bugs conf records group alias and permissions
# 90322-0122 - Added ability to delete from the DNC lists
# 90322-1105 - Added new status settings and vtiger options
# 90409-2133 - Fixed special characters in SCRIPTS
# 90413-0755 - Fixed filter and script slashes issues
# 90417-0211 - Fixed filter and script slashes issues
# 90422-0613 - Added user_code, territory and email to vicidial_users
# 90429-0542 - Added 3rd&4th options to SURVEY campaigns
# 90430-0154 - Added RANDOM and LAST CALL TIME options to lead order for campaigns
# 90504-0901 - Added Call Menu feature, changed script to use long PHP tags
# 90511-0910 - Added agentonly_callback_campaign_lock to system_settings
# 90512-0440 - Added sounds settings to system_settings table
# 90514-0607 - Added select prompts from list in call menu and in-group screens
# 90521-0029 - Added user territories enable option
# 90522-0506 - Security fix for logins when using non-latin setting
# 90524-2307 - Changed Reports screen layout
# 90528-2055 - Added ViciDial recording limit field in servers and phone_context to phones
# 90530-1206 - Changed List Mix to allow for 40 mixes
# 90531-1802 - Added auto-generated options for users, campaigns, in-groups, etc..., added option to HIDE custphone
# 90531-2339 - Added Dynamic options for Call Menu
# 90605-0248 - Added carrier_logging_active servers option
# 90607-1716 - Changed drop percent limit to allow for 0.1 steps under 3%
# 90608-0944 - Added Drop Lockout Time feature to Campaign Detail Modification screen
# 90612-0909 - Added audio prompt selection feature to survey screen
# 90614-0827 - Added In-Group routing to Call Menu screen, Added pull-down Call Menu option to DID screen
# 90617-0733 - Added phone ring timeout and call menu custom dialplan entries
# 90621-0821 - Added phone Conf File Secret field to use a separate password from the user interface for a phone
# 90621-1220 - Added Call Menu logging tracking_group
# 90627-0547 - Added no-agent-no-queue options
# 90627-2333 - Added default transfer button and prepopulate preset options
# 90628-0924 - Added Text To Speech(TTS) fields
# 90628-2213 - Added Multi-campaign drop rate groups
# 90705-0926 - Added User Group agent view options
# 90710-1528 - Added Agent view and grab queue calls and every call pause options
# 90717-0646 - Added dialed_label and dialed_number to script variables
# 90721-1350 - Added RANK and OWNER as list order options and list screen display tables
# 90722-1235 - Added list reset time and campaign no hopper dialing, agent dial owner only options
# 90726-0153 - Added allow_alerts for users to disable agent browser alerts
# 90729-0555 - Added agent_display_dialable_leads and vicidial_balance_rank options
# 90808-0300 - Added longest_wait_time option for agent call routing
# 90827-1552 - Added agent_script_override option for lists
# 90830-2217 - Added Music On Hold section
# 90904-1536 - Added moh chooser option, timezone list ordering
# 90908-1207 - Added cross-listing linking for DIDs, CallMenus and In-groups
# 90916-1105 - Added second web form to ingroups and campaigns and added audio choose for answering machine message and waitforsilence_options
# 90917-1108 - Added Extra Voicemail boxes config in Admin section
# 90919-2251 - Removed all SELECT STAR instances in the code, code cleanup to conform to standard
# 90924-1645 - Added list_id overrides for cid, am_message and drop in-group
# 90930-2107 - Added agent territory selection options for ViciDial agents
# 91026-1050 - Added AREACODE DNC option for campaigns
# 91031-1232 - Added carrier_description field, campaigns links from in-group screen, server links on reports page, agent ranks listing active only
# 91121-0334 - Limited list called count display to 100+
# 91125-0628 - Added conf_secret for servers
# 91204-1652 - Added recording_filename and recording_id as script variables
# 91205-2231 - Added delete_vm_after_email voicemail option to phones and extra voicemail sections
# 91210-2038 - Added better logging of Campaign emergency logout
# 91211-1359 - Added custom user fields and campaign CRM login fields
# 91219-0719 - Changed some field backgrounds in the Campaign Modification screens
# 91223-1031 - Added VIDPROMPT options for in-group routing in DIDs
# 91228-1837 - Added timer action settings to in-groups and campaigns
# 100103-0727 - Added Start/Dispo call url, 3/4/5 conf number presets, Lists conf-number overrides
# 100104-1454 - Fixed in-group/campaign copy duplication issue
# 100116-0718 - Added presets to script select list
# 100122-0747 - Added NOT-LOGGED-IN-AGENTS option for User Groups
# 100123-1301 - Added DID record call option
# 100127-0601 - Added Vtiger ViciDial user_level role lookup
# 100127-1546 - Added ignore_list_script_override option for ingroups
# 100219-1309 - Added agent dispo log system settings option and user call_log options
# 100220-1411 - Added system settings and servers custom_dialplan_entry
# 100221-0924 - Added Custom CallerID capability in Campaign settings
# 100302-2133 - Added Scheduled Callbacks Alert option
# 100309-0510 - Added queuemetrics_loginout option
# 100311-2348 - Added CallCard links and settings
# 100313-0020 - Added User Group agent screen transfer-conf button display options
# 100317-1244 - Added User Group agent_fullscreen option
# 100401-0014 - Added agent_choose_blended option
# 100405-1425 - Added queuemetrics_callstatus option and full logging of user campaign/in-group settings
# 100414-1603 - Added extension_appended_cidname option to campaigns
# 100420-1010 - Added scheduled_callbacks_count campaign option
# 100423-1030 - Added realtime_block_user_info, manual dial campaign, blind monitor warnings, in-group callid, phones codecs features
# 100506-1807 - Added hidden settings for lists custom fields
# 100507-1102 - Added hold_time_option_minimum option to in-groups and copy carrier function
# 100512-1615 - Added more hold time press-1 options
# 100518-0643 - Added inbound_queue_no_dial and call time after hours override features
# 100523-0840 - Added inbound prompt and no-block options
# 100616-2232 - Added VIDPROMPT call menu options
# 100621-1010 - Added admin_web_directory system setting
# 100622-1700 - Added custom agent field names for default fields
# 100702-1142 - Added FORM get_call_launch option for custom list fields tab in agent interface
# 100703-1322 - Added LEADS ability to admin log display
# 100709-1025 - Added option for slave DB server to be used for selected reports
# 100718-2318 - Added Wait Time options to in-groups
# 100720-1332 - Small changes to Phone addition and modification pages
# 100723-1519 - Added LOCKED options for Quick Transfer Button in campaigns
# 100726-1017 - Added HANGUP, CALLMENU, EXTENSION and IN_GROUP timer actions to campaigns and in-groups
# 100802-2130 - Changed Admin links to point to links page instead of Phones listings, changed Remote Agents to allow 9-digit IDs
# 100803-1412 - Added allowed_reports option to User Groups, added CAMPLISTS_ALL for manual_dial_filter(issue #369)
# - Added allowed_campaigns enforcement for Campaign listings
# 100804-2313 - Added filter phone groups section for inbound call filtering by incoming phone number when it comes into a DID
# 100805-1539 - Added option to clean up cid numbers when calls come into DIDs
# 100806-0607 - Added validation for remote agents settings, user_start must be valid user, number of lines must not overlap
# 100811-0827 - Added webphone_url_override to User Groups and calculate_estimated_hold_seconds to In-Groups
# 100813-0544 - Added campaign presets and option to hide xfer number to dial
# 100815-0802 - Added manual_dial_prefix campaign option
# 100817-1243 - Added checking for reserved menu_id on creation of Call Menus
# 100823-1501 - Added CallCard search as an available User Group report option
# 100827-1535 - Added webphone options for dialpad and systemkey
# 100901-2055 - Added password strength grading, force password change, password default settings and first login screen
# 100908-0926 - Added 3way hangup logging options to campaigns
# 100912-0842 - Several small changes, removed Emergency VDAC clear since it does not do anything anymore
# 100927-2321 - Added entry_list_id as a script, webform, dispo_call_url variable
# 100928-1634 - Moved Realtime Block User Info user setting into the new ADMIN REPORT OPTIONS section
# 100929-1203 - Added add_lead_url feature to In-Groups
# 101008-0349 - Added Estimated Hold Time Minimum options, Manual Dial Preview settings and two new variables for recording filenames
# 101022-1427 - Added ability to change user in-group prefs from in-group mod screen, added realtime_agent_time_stats campaign option
# 101106-1850 - Added admin refrech, no-cache, cross-server-exten, QM-addmember options
# 101109-1621 - Added Auto Hopper Level which allows Vicidial to adjust the hopper for a campaign as needed (MikeC)
# - Added Auto Trim Hopper which will allow Vicidial to remove excess leads from the hopper (MikeC)
# 101115-1355 - Added more options for the concurrent transfer limit campaign setting
# 101123-2214 - Added api_manual_dial and manual_dial_call_time_check campaign options
# 101127-2232 - Added webform override options to lists
# 101208-0341 - Changed some descriptions and field names in Phones
# 101209-2027 - Added display_leads_count option for campaign modification screens
# 101216-1838 - Changed Realtime report links to go to new realtime_report
# 101227-1320 - Added dialplan off toggle options
# 110103-1135 - Added queuemetrics_dispo_pause and lead_order_randomize features
# 110111-1305 - Added sort by list name for list listings in list section and campaign screens
# 110124-1134 - Small query fix for large queue_log tables
# 110212-2048 - Added Scheduled Callback as status flag to allow for custom scheduled callback statuses
# 110214-0001 - Added campaign settings for lead_order_secondary, per_call_notes and my_callback_option
# 110215-1721 - Added add-a-new-lead link to the lists submenu
# 110215-2135 - Added agent_lead_search options to user and campaign
# 110222-2039 - Added USER, GROUP and TERRITORY restrictions to agent lead search
# 110224-1427 - Added queuemetrics_phone_environment and active_twin_server_ip options
# 110301-1206 - Added options for ring-all in-group next-agent-call
# 110304-1651 - Added DEFER options to the scheduled callbacks alert campaign feature
# 110310-0311 - Added pre-call auto-pause and resume with pause code, for auto-pausing of callback-check, lead search, etc...
# 110408-0433 - Added Multi-alt block code and system settings reload dialplan setting
# 110428-1108 - Added manual_dial_cid campaign option
# 110430-1642 - Added post_phone_time_diff_alert campaign option
# 110506-1537 - Added custom_3way_button_transfer campaign option
# 110514-1351 - Added dial level and available only tally threshold campaign settings, and time zone list setting
# 110524-1401 - Small help text fix, issue #486
# 110525-2109 - Added safe_harbor_audio, safe_harbor_menu_id campaign options and dtmf_log call menu option
# 110526-1715 - Added webphone_auto_answer option
# 110528-2304 - Added campaign survey callmenu option
# 110531-2009 - Added callback_days_limit campaign option
# 110602-0941 - Added dl_diff_target_method campaign option
# 110619-1942 - Added disable_dispo_ agent screen options
# 110624-0842 - Added Export Leads Report links and permissions
# 110624-2246 - Added Screen Labels subsection for Admin and status_display_fields feature
# 110625-2338 - Added queuemetrics_pe_phone_append option
# 110703-1400 - Added test_campaign_calls and agents_calls_reset features
# 110707-0725 - Added AGENTEXT notes for in-groups settings
# 110707-1402 - Added last_inbound_call_time and finish to next agent call options for in-groups
# 110727-0130 - Added more voicemail box options and default timezone and voicemail zone to system settings
# 110730-2249 - Added DISPO_SELECT_DISABLED option for the Dispo Disable setting in campaigns
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
$admin_version = '2.4-326a';
$build = '110730-2249';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
$REPORTdate = date("Y-m-d");
$CIDdate = date("mdHis");
while (strlen($CIDdate) > 9) {$CIDdate = substr("$CIDdate", 1);}
$MT[0]='';
$US='_';
$active_lists=0;
$inactive_lists=0;
$modify_refresh_set=0;
$modify_footer_refresh=0;
$check_time = ($STARTtime - 86400);
$SSanswer_transfer_agent = '8368';
$month_old = mktime(0, 0, 0, date("m")-1, date("d"), date("Y"));
$past_month_date = date("Y-m-d H:i:s",$month_old);
$week_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y"));
$past_week_date = date("Y-m-d H:i:s",$week_old);
$dtmf[0]='0'; $dtmf_key[0]='0';
$dtmf[1]='1'; $dtmf_key[1]='1';
$dtmf[2]='2'; $dtmf_key[2]='2';
$dtmf[3]='3'; $dtmf_key[3]='3';
$dtmf[4]='4'; $dtmf_key[4]='4';
$dtmf[5]='5'; $dtmf_key[5]='5';
$dtmf[6]='6'; $dtmf_key[6]='6';
$dtmf[7]='7'; $dtmf_key[7]='7';
$dtmf[8]='8'; $dtmf_key[8]='8';
$dtmf[9]='9'; $dtmf_key[9]='9';
$dtmf[10]='HASH'; $dtmf_key[10]='#';
$dtmf[11]='STAR'; $dtmf_key[11]='*';
$dtmf[12]='A'; $dtmf_key[12]='A';
$dtmf[13]='B'; $dtmf_key[13]='B';
$dtmf[14]='C'; $dtmf_key[14]='C';
$dtmf[15]='D'; $dtmf_key[15]='D';
$dtmf[16]='TIMECHECK'; $dtmf_key[16]='TIMECHECK';
$dtmf[17]='TIMEOUT'; $dtmf_key[17]='TIMEOUT';
$dtmf[18]='INVALID'; $dtmf_key[18]='INVALID';
if ($force_logout)
{
if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) )
{
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
Header("HTTP/1.0 401 Unauthorized");
}
echo "You have now logged out. Thank you\n";
exit;
}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan,callcard_enabled,admin_modify_refresh,nocache_admin 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];
$SSauto_dial_limit = $row[1];
$SSuser_territories_active = $row[2];
$SSallow_custom_dialplan = $row[3];
$SScallcard_enabled = $row[4];
$SSadmin_modify_refresh = $row[5];
$SSnocache_admin = $row[6];
}
##### END SETTINGS LOOKUP #####
###########################################
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and active='Y';";
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='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and active='Y' and view_reports='1';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$reports_auth=$row[0];
$reports_only_user=0;
if ( ($reports_auth > 0) and ($auth < 1) )
{
$ADD=999999;
$reports_only_user=1;
}
if ($WeBRooTWritablE > 0)
{$fp = fopen ("./project_auth_entries.txt", "a");}
$date = date("r");
$ip = getenv("REMOTE_ADDR");
$browser = getenv("HTTP_USER_AGENT");
if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ( ($auth < 1 ) and ($reports_auth < 1) ) )
{
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
Header("HTTP/1.0 401 Unauthorized");
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
exit;
}
if ( ($auth > 0) or ($reports_auth > 0) )
{
$office_no=strtoupper($PHP_AUTH_USER);
$password=strtoupper($PHP_AUTH_PW);
$stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$LOGfull_name =$row[3];
$LOGuser_level =$row[4];
$LOGuser_group =$row[5];
$LOGdelete_users =$row[8];
$LOGdelete_user_groups =$row[9];
$LOGdelete_lists =$row[10];
$LOGdelete_campaigns =$row[11];
$LOGdelete_ingroups =$row[12];
$LOGdelete_remote_agents =$row[13];
$LOGload_leads =$row[14];
$LOGcampaign_detail =$row[15];
$LOGast_admin_access =$row[16];
$LOGast_delete_phones =$row[17];
$LOGdelete_scripts =$row[18];
$LOGdelete_filters =$row[29];
$LOGalter_agent_interface =$row[30];
$LOGdelete_call_times =$row[32];
$LOGmodify_call_times =$row[33];
$LOGmodify_users =$row[34];
$LOGmodify_campaigns =$row[35];
$LOGmodify_lists =$row[36];
$LOGmodify_scripts =$row[37];
$LOGmodify_filters =$row[38];
$LOGmodify_ingroups =$row[39];
$LOGmodify_usergroups =$row[40];
$LOGmodify_remoteagents =$row[41];
$LOGmodify_servers =$row[42];
$LOGview_reports =$row[43];
$LOGmodify_dids =$row[56];
$LOGdelete_dids =$row[57];
$LOGmanager_shift_enforcement_override=$row[61];
$LOGexport_reports =$row[64];
$LOGdelete_from_dnc =$row[65];
$LOGcallcard_admin =$row[70];
$LOGforce_change_password =$row[71];
$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$LOGallowed_campaigns = $row[0];
$LOGallowed_reports = $row[1];
$LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) )
{
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
}
$regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
if ($WeBRooTWritablE > 0)
{
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n");
fclose($fp);
}
$first_login_link=0;
if ($LOGforce_change_password=='Y')
{
$ADD=999997;
$reports_only_user=1;
}
if ($SSfirst_login_trigger=='Y')
{
if ($ADD==999996)
{$reports_only_user=1;}
else
{
$ADD=999995;
$first_login_link=1;
}
}
if ($ADD==999995)
{
$reports_only_user=1;
}
}
else
{
if ($WeBRooTWritablE > 0)
{
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
fclose($fp);
}
}
######################################################################################################
######################################################################################################
####### Header settings
######################################################################################################
######################################################################################################
header ("Content-type: text/html; charset=utf-8");
if ($SSnocache_admin=='1')
{
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
}
echo "<html>\n";
echo "<head>\n";
echo "<!-- VERSION: $admin_version BUILD: $build ADD: $ADD PHP_SELF: $PHP_SELF-->\n";
echo "<META NAME=\"ROBOTS\" CONTENT=\"NONE\">\n";
echo "<META NAME=\"COPYRIGHT\" CONTENT=\"&copy; 2011 ViciDial Group\">\n";
echo "<META NAME=\"AUTHOR\" CONTENT=\"ViciDial Group\">\n";
if ($SSnocache_admin=='1')
{
echo "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n";
echo "<META HTTP-EQUIV=\"Expires\" CONTENT=\"-1\">\n";
echo "<META HTTP-EQUIV=\"CACHE-CONTROL\" CONTENT=\"NO-CACHE\">\n";
}
if ( ($SSadmin_modify_refresh > 1) and (preg_match("/^3/",$ADD)) )
{
$modify_refresh_set=1;
if (preg_match("/^3/",$ADD)) {$modify_url = "$PHP_SELF?$QUERY_STRING";}
echo "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"$SSadmin_modify_refresh;URL=$modify_url\">\n";
}
echo "<title>ADMINISTRATION: ";
if (!isset($ADD)) {$ADD=0;}
if ($ADD=="1") {$hh='users'; echo "Add New User";}
if ($ADD=="1A") {$hh='users'; echo "Copy User";}
if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Add New Campaign";}
if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Copy Campaign";}
if ($ADD==111) {$hh='lists'; echo "Add New List";}
if ($ADD==121) {$hh='lists'; echo "Add New DNC";}
if ($ADD==171) {$hh='ingroups'; echo "Filter Phone Group Numbers";}
if ($ADD==1111) {$hh='ingroups'; echo "Add New In-Group";}
if ($ADD==1211) {$hh='ingroups'; echo "Copy In-Group";}
if ($ADD==1311) {$hh='ingroups'; echo "Add New DID";}
if ($ADD==1411) {$hh='ingroups'; echo "Copy DID";}
if ($ADD==1511) {$hh='ingroups'; echo "Add Call Menu";}
if ($ADD==1611) {$hh='ingroups'; echo "Copy Call Menu";}
if ($ADD==1711) {$hh='ingroups'; echo "Add Filter Phone Group";}
if ($ADD==11111) {$hh='remoteagent'; echo "Add New Remote Agents";}
if ($ADD==12111) {$hh='remoteagent'; echo "Add Extension Group";}
if ($ADD==111111) {$hh='usergroups'; echo "Add New Users Group";}
if ($ADD==1111111) {$hh='scripts'; echo "Add New Script";}
if ($ADD==11111111) {$hh='filters'; echo "Add New Filter";}
if ($ADD==111111111) {$hh='admin'; $sh='times'; echo "Add New Call Time";}
if ($ADD==131111111) {$hh='admin'; $sh='shifts'; echo "Add New Shift";}
if ($ADD==1111111111) {$hh='admin'; $sh='times'; echo "Add New State Call Time";}
if ($ADD==11111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW PHONE";}
if ($ADD==12111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW PHONE ALIAS";}
if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW GROUP ALIAS";}
if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "ADD NEW SERVER";}
if ($ADD==131111111111) {$hh='admin'; $sh='templates'; echo "ADD NEW CONF TEMPLATE";}
if ($ADD==141111111111) {$hh='admin'; $sh='carriers'; echo "ADD NEW CARRIER";}
if ($ADD==140111111111) {$hh='admin'; $sh='carriers'; echo "ADD COPIED CARRIER";}
if ($ADD==151111111111) {$hh='admin'; $sh='tts'; echo "ADD NEW TTS ENTRY";}
if ($ADD==161111111111) {$hh='admin'; $sh='moh'; echo "ADD NEW MUSIC ON HOLD ENTRY";}
if ($ADD==171111111111) {$hh='admin'; $sh='vm'; echo "ADD NEW VOICEMAIL BOX";}
if ($ADD==181111111111) {$hh='admin'; $sh='label'; echo "ADD NEW SCREEN LABEL";}
if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW CONFERENCE";}
if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";}
if ($ADD=='2') {$hh='users'; echo "New User Addition";}
if ($ADD=='2A') {$hh='users'; echo "New Copied User Addition";}
if ($ADD==20) {$hh='campaigns'; $sh='basic'; echo "New Copied Campaign Addition";}
if ($ADD==21) {$hh='campaigns'; $sh='basic'; echo "New Campaign Addition";}
if ($ADD==22) {$hh='campaigns'; $sh='status'; echo "New Campaign Status Addition";}
if ($ADD==23) {$hh='campaigns'; $sh='hotkey'; echo "New Campaign HotKey Addition";}
if ($ADD==25) {$hh='campaigns'; $sh='recycle'; echo "New Campaign Lead Recycle Addition";}
if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "New Auto Alt Dial Status";}
if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "New Agent Pause Code";}
if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Campaign Dial Status Added";}
if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Campaign List Mix Added";}
if ($ADD==201) {$hh='campaigns'; $sh='preset'; echo "Campaign Preset Added";}
if ($ADD==211) {$hh='lists'; echo "New List Addition";}
if ($ADD==2111) {$hh='ingroups'; echo "New In-Group Addition";}
if ($ADD==2011) {$hh='ingroups'; echo "New Copied In-Group Addition";}
if ($ADD==2311) {$hh='ingroups'; echo "New DID Addition";}
if ($ADD==2411) {$hh='ingroups'; echo "New Copied DID Addition";}
if ($ADD==2511) {$hh='ingroups'; echo "New Call Menu";}
if ($ADD==2611) {$hh='ingroups'; echo "New Call Menu";}
if ($ADD==2711) {$hh='ingroups'; echo "New Filter Phone Group";}
if ($ADD==21111) {$hh='remoteagent'; echo "New Remote Agents Addition";}
if ($ADD==22111) {$hh='remoteagent'; echo "New Group Extension Addition";}
if ($ADD==211111) {$hh='usergroups'; echo "New Users Group Addition";}
if ($ADD==2111111) {$hh='scripts'; echo "New Script Addition";}
if ($ADD==21111111) {$hh='filters'; echo "New Filter Addition";}
if ($ADD==211111111) {$hh='admin'; $sh='times'; echo "New Call Time Addition";}
if ($ADD==231111111) {$hh='admin'; $sh='shifts'; echo "New Shift Addition";}
if ($ADD==2111111111) {$hh='admin'; $sh='times'; echo "New State Call Time Addition";}
if ($ADD==21111111111) {$hh='admin'; $sh='phones'; echo "ADDING NEW PHONE";}
if ($ADD==22111111111) {$hh='admin'; $sh='phones'; echo "ADDING NEW PHONE ALIAS";}
if ($ADD==23111111111) {$hh='admin'; $sh='phones'; echo "ADDING NEW GROUP ALIAS";}
if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "ADDING NEW SERVER";}
if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADDING NEW SERVER VICIDIAL TRUNK RECORD";}
if ($ADD==231111111111) {$hh='admin'; $sh='templates'; echo "ADDING NEW CONF TEMPLATE";}
if ($ADD==241111111111) {$hh='admin'; $sh='carriers'; echo "ADDING NEW CARRIER";}
if ($ADD==240111111111) {$hh='admin'; $sh='carriers'; echo "ADDING COPIED CARRIER";}
if ($ADD==251111111111) {$hh='admin'; $sh='tts'; echo "ADDING NEW TTS ENTRY";}
if ($ADD==261111111111) {$hh='admin'; $sh='moh'; echo "ADDING NEW MUSIC ON HOLD ENTRY";}
if ($ADD==271111111111) {$hh='admin'; $sh='vm'; echo "ADDING NEW VOICEMAIL BOX";}
if ($ADD==281111111111) {$hh='admin'; $sh='label'; echo "ADDING NEW SCREEN LABEL";}
if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW CONFERENCE";}
if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";}
if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "ADDING VICIDIAL SYSTEM STATUSES";}
if ($ADD==231111111111111) {$hh='admin'; $sh='status'; echo "ADDING VICIDIAL STATUS CATEGORY";}
if ($ADD==241111111111111) {$hh='admin'; $sh='status'; echo "ADDING VICIDIAL QC STATUS CODE";}
if ($ADD==3) {$hh='users'; echo "Modify User";}
if ($ADD==30) {$hh='campaigns'; echo "Campaign Not Allowed";}
if ($ADD==31)
{
$hh='campaigns'; $sh='detail'; echo "Modify Campaign - Detail - $campaign_id";
if ($SUB==22) {echo " - Statuses";}
if ($SUB==23) {echo " - HotKeys";}
if ($SUB==25) {echo " - Lead Recycle Entries";}
if ($SUB==26) {echo " - Auto Alt Dial Statuses";}
if ($SUB==27) {echo " - Agent Pause Codes";}
if ($SUB==28) {echo " - QC";}
if ($SUB==29) {echo " - List Mixes";}
if ($SUB=='20A') {echo " - Survey";}
if ($SUB==201) {echo " - Presets";}
}
if ($ADD==34)
{
$hh='campaigns'; $sh='basic'; echo "Modify Campaign - Basic View - $campaign_id";
if ($SUB==22) {echo " - Statuses";}
if ($SUB==23) {echo " - HotKeys";}
if ($SUB==25) {echo " - Lead Recycle Entries";}
if ($SUB==26) {echo " - Auto Alt Dial Statuses";}
if ($SUB==27) {echo " - Agent Pause Codes";}
if ($SUB==28) {echo " - QC";}
if ($SUB==29) {echo " - List Mixes";}
if ($SUB=='20A') {echo " - Survey";}
if ($SUB==201) {echo " - Presets";}
}
if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Campaign Statuses";}
if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Campaign HotKeys";}
if ($ADD==35) {$hh='campaigns'; $sh='recycle'; echo "Campaign Lead Recycle Entries";}
if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Campaign Auto Alt Dial Statuses";}
if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Campaign Agent Pause Codes";}
if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Campaign Dial Statuses";}
if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Campaign List Mixes";}
if ($ADD==301) {$hh='campaigns'; $sh='preset'; echo "Campaign Presets";}
if ($ADD==311) {$hh='lists'; echo "Modify List";}
if ($ADD==3111) {$hh='ingroups'; echo "Modify In-Group";}
if ($ADD==3311) {$hh='ingroups'; echo "Modify DID";}
if ($ADD==3511) {$hh='ingroups'; echo "Modify Call Menu";}
if ($ADD==3711) {$hh='ingroups'; echo "Modify Filter Phone Group";}
if ($ADD==31111) {$hh='remoteagent'; echo "Modify Remote Agents";}
if ($ADD==32111) {$hh='remoteagent'; echo "Modify Extension Group";}
if ($ADD==311111) {$hh='usergroups'; echo "Modify Users Groups";}
if ($ADD==3111111) {$hh='scripts'; echo "Modify Script";}
if ($ADD==31111111) {$hh='filters'; echo "Modify Filter";}
if ($ADD==311111111) {$hh='admin'; $sh='times'; echo "Modify Call Time";}
if ($ADD==321111111) {$hh='admin'; $sh='times'; echo "Modify Call Time State Definitions List";}
if ($ADD==331111111) {$hh='admin'; $sh='shifts'; echo "Modify Shift";}
if ($ADD==3111111111) {$hh='admin'; $sh='times'; echo "Modify State Call Time";}
if ($ADD==31111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE";}
if ($ADD==32111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE ALIAS";}
if ($ADD==33111111111) {$hh='admin'; $sh='phones'; echo "MODIFY GROUP ALIAS";}
if ($ADD==311111111111) {$hh='admin'; $sh='server'; echo "MODIFY SERVER";}
if ($ADD==331111111111) {$hh='admin'; $sh='templates'; echo "MODIFY CONF TEMPLATE";}
if ($ADD==341111111111) {$hh='admin'; $sh='carriers'; echo "MODIFY CARRIER";}
if ($ADD==351111111111) {$hh='admin'; $sh='tts'; echo "MODIFY TTS ENTRY";}
if ($ADD==361111111111) {$hh='admin'; $sh='moh'; echo "MODIFY MUSIC ON HOLD ENTRY";}
if ($ADD==371111111111) {$hh='admin'; $sh='vm'; echo "MODIFY VOICEMAIL BOX";}
if ($ADD==381111111111) {$hh='admin'; $sh='label'; echo "MODIFY SCREEN LABEL";}
if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY CONFERENCE";}
if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";}
if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "MODIFY VICIDIAL SYSTEM SETTINGS";}
if ($ADD==321111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL SYSTEM STATUSES";}
if ($ADD==331111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL STATUS CATEGORY";}
if ($ADD==341111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL QC STATUS CODE";}
if ($ADD=="4A") {$hh='users'; echo "Modify User - Admin";}
if ($ADD=="4B") {$hh='users'; echo "Modify User - Admin";}
if ($ADD==4) {$hh='users'; echo "Modify User";}
if ($ADD==41) {$hh='campaigns'; $sh='detail'; echo "Modify Campaign";}
if ($ADD==42) {$hh='campaigns'; $sh='status'; echo "Modify Campaign Status";}
if ($ADD==43) {$hh='campaigns'; $sh='hotkey'; echo "Modify Campaign HotKey";}
if ($ADD==44) {$hh='campaigns'; $sh='basic'; echo "Modify Campaign - Basic View";}
if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Modify Campaign Lead Recycle";}
if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Modify Agent Pause Code";}
if ($ADD==48) {$hh='campaigns'; $sh='qc'; echo "Modify Campaign QC Settings";}
if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Modify Campaign List Mix";}
if ($ADD==401) {$hh='campaigns'; $sh='preset'; echo "Modify Campaign Preset";}
if ($ADD=='40A') {$hh='campaigns'; $sh='survey'; echo "Modify Campaign Survey";}
if ($ADD==411) {$hh='lists'; echo "Modify List";}
if ($ADD==4111) {$hh='ingroups'; echo "Modify In-Group";}
if ($ADD==4311) {$hh='ingroups'; echo "Modify DID";}
if ($ADD==4511) {$hh='ingroups'; echo "Modify Call Menu";}
if ($ADD==4711) {$hh='ingroups'; echo "Modify Filter Phone Group";}
if ($ADD==41111) {$hh='remoteagent'; echo "Modify Remote Agents";}
if ($ADD==42111) {$hh='remoteagent'; echo "Modify Extension Group";}
if ($ADD==411111) {$hh='usergroups'; echo "Modify Users Groups";}
if ($ADD==4111111) {$hh='scripts'; echo "Modify Script";}
if ($ADD==41111111) {$hh='filters'; echo "Modify Filter";}
if ($ADD==411111111) {$hh='admin'; $sh='times'; echo "Modify Call Time";}
if ($ADD==431111111) {$hh='admin'; $sh='shifts'; echo "Modify Shift";}
if ($ADD==4111111111) {$hh='admin'; $sh='times'; echo "Modify State Call Time";}
if ($ADD==41111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE";}
if ($ADD==42111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE ALIAS";}
if ($ADD==43111111111) {$hh='admin'; $sh='phones'; echo "MODIFY GROUP ALIAS";}
if ($ADD==411111111111) {$hh='admin'; $sh='server'; echo "MODIFY SERVER";}
if ($ADD==421111111111) {$hh='admin'; $sh='server'; echo "MODIFY SERVER VICIDIAL TRUNK RECORD";}
if ($ADD==431111111111) {$hh='admin'; $sh='templates'; echo "MODIFY CONF TEMPLATE";}
if ($ADD==441111111111) {$hh='admin'; $sh='carriers'; echo "MODIFY CARRIER";}
if ($ADD==451111111111) {$hh='admin'; $sh='tts'; echo "MODIFY TTS ENTRY";}
if ($ADD==461111111111) {$hh='admin'; $sh='moh'; echo "MODIFY MUSIC ON HOLD ENTRY";}
if ($ADD==471111111111) {$hh='admin'; $sh='vm'; echo "MODIFY VOICEMAIL BOX";}
if ($ADD==481111111111) {$hh='admin'; $sh='label'; echo "MODIFY SCREEN LABEL";}
if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY CONFERENCE";}
if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";}
if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "MODIFY VICIDIAL SYSTEM SETTINGS";}
if ($ADD==421111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL SYSTEM STATUSES";}
if ($ADD==431111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL STATUS CATEGORIES";}
if ($ADD==441111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL QC STATUS CODE";}
if ($ADD==5) {$hh='users'; echo "Delete User";}
if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "Delete Campaign";}
if ($ADD==52) {$hh='campaigns'; $sh='detail'; echo "Logout Agents";}
if ($ADD==53) {$hh='campaigns'; $sh='detail'; echo "Emergency VDAC Jam Clear";}
if ($ADD==511) {$hh='lists'; echo "Delete List";}
if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";}
if ($ADD==5311) {$hh='ingroups'; echo "Delete DID";}
if ($ADD==5511) {$hh='ingroups'; echo "Delete Call Menu";}
if ($ADD==5711) {$hh='ingroups'; echo "Delete Phone Filter Group";}
if ($ADD==51111) {$hh='remoteagent'; echo "Delete Remote Agents";}
if ($ADD==52111) {$hh='remoteagent'; echo "Delete Extension Group";}
if ($ADD==511111) {$hh='usergroups'; echo "Delete Users Group";}
if ($ADD==5111111) {$hh='scripts'; echo "Delete Script";}
if ($ADD==51111111) {$hh='filters'; echo "Delete Filter";}
if ($ADD==511111111) {$hh='admin'; $sh='times'; echo "Delete Call Time";}
if ($ADD==531111111) {$hh='admin'; $sh='shifts'; echo "Delete Shift";}
if ($ADD==5111111111) {$hh='admin'; $sh='times'; echo "Delete State Call Time";}
if ($ADD==51111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";}
if ($ADD==52111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE ALIAS";}
if ($ADD==53111111111) {$hh='admin'; $sh='phones'; echo "DELETE GROUP ALIAS";}
if ($ADD==511111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";}
if ($ADD==531111111111) {$hh='admin'; $sh='templates'; echo "DELETE CONF TEMPLATE";}
if ($ADD==541111111111) {$hh='admin'; $sh='carriers'; echo "DELETE CARRIER";}
if ($ADD==551111111111) {$hh='admin'; $sh='tts'; echo "DELETE TTS ENTRY";}
if ($ADD==561111111111) {$hh='admin'; $sh='moh'; echo "DELETE MUSIC ON HOLD ENTRY";}
if ($ADD==571111111111) {$hh='admin'; $sh='vm'; echo "DELETE VOICEMAIL BOX";}
if ($ADD==581111111111) {$hh='admin'; $sh='label'; echo "DELETE SCREEN LABEL";}
if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";}
if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";}
if ($ADD==6) {$hh='users'; echo "Delete User";}
if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "Delete Campaign";}
if ($ADD==62) {$hh='campaigns'; $sh='detail'; echo "Logout Agents";}
if ($ADD==63) {$hh='campaigns'; $sh='detail'; echo "Emergency VDAC Jam Clear";}
if ($ADD==65) {$hh='campaigns'; $sh='recycle'; echo "Delete Lead Recycle";}
if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Delete Auto Alt Dial Status";}
if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Delete Agent Pause Code";}
if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Campaign Dial Status Removed";}
if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "Campaign List Mix Removed";}
if ($ADD==601) {$hh='campaigns'; $sh='preset'; echo "Campaign Preset Removed";}
if ($ADD==611) {$hh='lists'; echo "Delete List";}
if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";}
if ($ADD==6311) {$hh='ingroups'; echo "Delete DID";}
if ($ADD==6511) {$hh='ingroups'; echo "Delete Call Menu";}
if ($ADD==6711) {$hh='ingroups'; echo "Delete Phone Filter Group";}
if ($ADD==61111) {$hh='remoteagent'; echo "Delete Remote Agents";}
if ($ADD==62111) {$hh='remoteagent'; echo "Delete Extension Group";}
if ($ADD==611111) {$hh='usergroups'; echo "Delete Users Group";}
if ($ADD==6111111) {$hh='scripts'; echo "Delete Script";}
if ($ADD==61111111) {$hh='filters'; echo "Delete Filter";}
if ($ADD==611111111) {$hh='admin'; $sh='times'; echo "Delete Call Time";}
if ($ADD==631111111) {$hh='admin'; $sh='shifts'; echo "Delete Shift";}
if ($ADD==6111111111) {$hh='admin'; $sh='times'; echo "Delete State Call Time";}
if ($ADD==61111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";}
if ($ADD==62111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE ALIAS";}
if ($ADD==63111111111) {$hh='admin'; $sh='phones'; echo "DELETE GROUP ALIAS";}
if ($ADD==611111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";}
if ($ADD==621111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER VICIDIAL TRUNK RECORD";}
if ($ADD==631111111111) {$hh='admin'; $sh='templates'; echo "DELETE CONF TEMPLATE";}
if ($ADD==641111111111) {$hh='admin'; $sh='carriers'; echo "DELETE CARRIER";}
if ($ADD==651111111111) {$hh='admin'; $sh='tts'; echo "DELETE TTS ENTRY";}
if ($ADD==661111111111) {$hh='admin'; $sh='moh'; echo "DELETE MUSIC ON HOLD ENTRY";}
if ($ADD==671111111111) {$hh='admin'; $sh='vm'; echo "DELETE VOICEMAIL BOX";}
if ($ADD==681111111111) {$hh='admin'; $sh='label'; echo "DELETE SCREEN LABEL";}
if ($ADD==6111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";}
if ($ADD==61111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";}
if ($ADD==73) {$hh='campaigns'; echo "Dialable Lead Count";}
if ($ADD==7111111) {$hh='scripts'; echo "Preview Script";}
if ($ADD==700000000000000) {$hh='reports'; echo "VICIDIAL ADMIN CHANGE LOG";}
if ($ADD==710000000000000) {$hh='reports'; echo "VICIDIAL USER ADMIN CHANGE LOG";}
if ($ADD==720000000000000) {$hh='reports'; echo "VICIDIAL SECTION ADMIN CHANGE LOG";}
if ($ADD==730000000000000) {$hh='reports'; echo "VICIDIAL DETAIL ADMIN CHANGE LOG";}
if ($ADD==0) {$hh='users'; echo "Users List";}
if ($ADD==8) {$hh='users'; echo "CallBacks Within Agent";}
if ($ADD==81) {$hh='campaigns'; $sh='list'; echo "CallBacks Within Campaign";}
if ($ADD==811) {$hh='lists'; echo "CallBacks Within List";}
if ($ADD==8111) {$hh='usergroups'; echo "CallBacks Within User Group";}
if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Campaigns";}
if ($ADD==100) {$hh='lists'; echo "Lists";}
if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";}
if ($ADD==1300) {$hh='ingroups'; echo "DIDs";}
if ($ADD==1500) {$hh='ingroups'; echo "Call Menus";}
if ($ADD==1700) {$hh='ingroups'; echo "Filter Phone Groups";}
if ($ADD==10000) {$hh='remoteagent'; echo "Remote Agents";}
if ($ADD==12000) {$hh='remoteagent'; echo "Extension Groups";}
if ($ADD==100000) {$hh='usergroups'; echo "User Groups";}
if ($ADD==1000000) {$hh='scripts'; echo "Scripts";}
if ($ADD==10000000) {$hh='filters'; echo "Filters";}
if ($ADD==100000000) {$hh='admin'; $sh='times'; echo "Call Times";}
if ($ADD==130000000) {$hh='admin'; $sh='shifts'; echo "Shifts";}
if ($ADD==1000000000) {$hh='admin'; $sh='times'; echo "State Call Times";}
if ($ADD==10000000000) {$hh='admin'; $sh='phones'; echo "PHONE LIST";}
if ($ADD==12000000000) {$hh='admin'; $sh='phones'; echo "PHONE ALIAS LIST";}
if ($ADD==13000000000) {$hh='admin'; $sh='phones'; echo "GROUP ALIAS LIST";}
if ($ADD==100000000000) {$hh='admin'; $sh='server'; echo "SERVER LIST";}
if ($ADD==130000000000) {$hh='admin'; $sh='templates'; echo "CONF TEMPLATE LIST";}
if ($ADD==140000000000) {$hh='admin'; $sh='carriers'; echo "CARRIER LIST";}
if ($ADD==150000000000) {$hh='admin'; $sh='tts'; echo "TTS ENTRY LIST";}
if ($ADD==160000000000) {$hh='admin'; $sh='moh'; echo "MUSIC ON HOLD ENTRY LIST";}
if ($ADD==170000000000) {$hh='admin'; $sh='vm'; echo "VOICEMAIL BOXES LIST";}
if ($ADD==180000000000) {$hh='admin'; $sh='label'; echo "SCREEN LABELS LIST";}
if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "CONFERENCE LIST";}
if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "VICIDIAL CONFERENCE LIST";}
if ($ADD==550) {$hh='users'; echo "Search Form";}
if ($ADD==551) {$hh='users'; echo "SEARCH PHONES";}
if ($ADD==660) {$hh='users'; echo "Search Results";}
if ($ADD==661) {$hh='users'; echo "SEARCH PHONES RESULTS";}
if ($ADD==99999) {$hh='users'; echo "HELP";}
if ($ADD==999999) {$hh='reports'; echo "REPORTS";}
if ($ADD==999998) {$hh='admin'; echo "ADMIN";}
if ($ADD==999997) {$hh='reports'; echo "CHANGE PASSWORD";}
if ($ADD==999996) {$hh='reports'; echo "INITIAL INSTALL WELCOME";}
if ($ADD==999995) {$hh='reports'; echo "COPYRIGHT TRADEMARK LICENSE";}
if ($ADD==999994) {$hh='reports'; echo "ADMIN UTILITIES";}
if ( ($ADD>9) and ($ADD < 99998) )
{
##### get scripts listing for dynamic pulldown
$stmt="SELECT script_id,script_name from vicidial_scripts order by script_id";
$rslt=mysql_query($stmt, $link);
$scripts_to_print = mysql_num_rows($rslt);
$scripts_list="<option value=\"\">NONE</option>\n";
$o=0;
while ($scripts_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$scripts_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$scriptname_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
##### get filters listing for dynamic pulldown
$stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id";
$rslt=mysql_query($stmt, $link);
$filters_to_print = mysql_num_rows($rslt);
$filters_list="<option value=\"\">NONE</option>\n";
$o=0;
while ($filters_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$filters_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$filtername_list["$rowx[0]"] = "$rowx[1]";
$filtersql_list["$rowx[0]"] = "$rowx[2]";
$o++;
}
##### get call_times listing for dynamic pulldown
$stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id";
$rslt=mysql_query($stmt, $link);
$times_to_print = mysql_num_rows($rslt);
$o=0;
while ($times_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$call_times_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$call_timename_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
}
if ( ( (strlen($ADD)>4) and ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD<70)) or ($ADD=="4A") or ($ADD=="4B") or (strlen($ADD)==12) )
{
##### BEGIN get campaigns listing for rankings #####
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$campaigns_list='';
$campaigns_value='';
$RANKcampaigns_list="<tr><td>CAMPAIGN</td><td> &nbsp; &nbsp; RANK</td><td> &nbsp; &nbsp; CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n";
$o=0;
while ($campaigns_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$campaign_id_values[$o] = $rowx[0];
$campaign_name_values[$o] = $rowx[1];
$o++;
}
$o=0;
while ($campaigns_to_print > $o)
{
$group_web_vars='';
$campaign_web='';
$stmt="SELECT campaign_rank,calls_today,group_web_vars from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]'";
$rslt=mysql_query($stmt, $link);
$ranks_to_print = mysql_num_rows($rslt);
if ($ranks_to_print > 0)
{
$row=mysql_fetch_row($rslt);
$SELECT_campaign_rank = $row[0];
$calls_today = $row[1];
$group_web_vars = $row[2];
}
else
{$calls_today=0; $SELECT_campaign_rank=0; $group_web_vars='';}
if ( ($ADD=="4A") or ($ADD=="4B") )
{
$stmt_grp_values='';
if (isset($_GET["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_GET["RANK_$campaign_id_values[$o]"];}
elseif (isset($_POST["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_POST["RANK_$campaign_id_values[$o]"];}
if (isset($_GET["WEB_$campaign_id_values[$o]"])) {$campaign_web=$_GET["WEB_$campaign_id_values[$o]"];}
elseif (isset($_POST["WEB_$campaign_id_values[$o]"])) {$campaign_web=$_POST["WEB_$campaign_id_values[$o]"];}
if ($non_latin < 1)
{
$campaign_rank = ereg_replace("[^-\_0-9]","",$campaign_rank);
$campaign_web = preg_replace("/;|\"|\'/","",$campaign_web);
}
if ($ranks_to_print > 0)
{
$stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', group_web_vars='$campaign_web' where campaign_id='$campaign_id_values[$o]' and user='$user';";
$rslt=mysql_query($stmt, $link);
$stmt_grp_values .= "$stmt|";
}
else
{
$stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';";
$rslt=mysql_query($stmt, $link);
$stmt_grp_values .= "$stmt|";
}
$stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';";
$rslt=mysql_query($stmt, $link);
$stmt_grp_values .= "$stmt|";
}
else {$campaign_rank = $SELECT_campaign_rank;}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
# disable non user-group allowable campaign ranks
$stmt="SELECT user_group from vicidial_users where user='$user';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$Ruser_group = $row[0];
$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$allowed_campaigns = $row[0];
$allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns);
$UGcampaigns = explode(" ", $allowed_campaigns);
$p=0; $RANK_camp_active=0; $CR_disabled = '';
if (eregi('-ALL-CAMPAIGNS-',$allowed_campaigns))
{$RANK_camp_active++;}
else
{
$UGcampaign_ct = count($UGcampaigns);
while ($p < $UGcampaign_ct)
{
if ($campaign_id_values[$o] == $UGcampaigns[$p])
{$RANK_camp_active++;}
$p++;
}
}
if ($RANK_camp_active < 1) {$CR_disabled = 'DISABLED';}
$RANKcampaigns_list .= "<tr $bgcolor><td>";
$campaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] <BR>\n";
$RANKcampaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] </td>";
$RANKcampaigns_list .= "<td> &nbsp; &nbsp; <select size=1 name=RANK_$campaign_id_values[$o] $CR_disabled>\n";
$h="9";
while ($h>=-9)
{
$RANKcampaigns_list .= "<option value=\"$h\"";
if ($h==$campaign_rank)
{$RANKcampaigns_list .= " SELECTED";}
$RANKcampaigns_list .= ">$h</option>";
$h--;
}
if ( (strlen($campaign_web) < 1) and (strlen($group_web_vars) > 0) )
{$campaign_web=$group_web_vars;}
$RANKcampaigns_list .= "</select></td>\n";
$RANKcampaigns_list .= "<td align=right> &nbsp; &nbsp; $calls_today</td>\n";
$RANKcampaigns_list .= "<td> &nbsp; &nbsp; <input type=text size=25 maxlength=255 name=WEB_$campaign_id_values[$o] value=\"$campaign_web\"></td></tr>\n";
$o++;
}
##### END get campaigns listing for rankings #####
##### BEGIN get inbound groups listing for checkboxes #####
$xfer_groupsSQL='';
if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) or ( ($ADD==41) and (eregi('list_activation', $stage))) )
{
$stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$closer_campaigns = $row[0];
$closer_campaigns = preg_replace("/ -$/","",$closer_campaigns);
$groups = explode(" ", $closer_campaigns);
$xfer_groups = $row[1];
$xfer_groups = preg_replace("/ -$/","",$xfer_groups);
$XFERgroups = explode(" ", $xfer_groups);
$xfer_groupsSQL = preg_replace("/^ | -$/","",$xfer_groups);
$xfer_groupsSQL = preg_replace("/ /","','",$xfer_groupsSQL);
$xfer_groupsSQL = "WHERE group_id IN('$xfer_groupsSQL')";
}
if ($ADD==41)
{
$p=0;
$XFERgroup_ct = count($XFERgroups);
while ($p < $XFERgroup_ct)
{
$xfer_groups .= " $XFERgroups[$p]";
$p++;
}
$xfer_groupsSQL = preg_replace("/^ | -$/","",$xfer_groups);
$xfer_groupsSQL = preg_replace("/ /","','",$xfer_groupsSQL);
$xfer_groupsSQL = "WHERE group_id IN('$xfer_groupsSQL')";
}
if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) )
{
$stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$closer_campaigns = $row[0];
$closer_campaigns = preg_replace("/ -$/","",$closer_campaigns);
$groups = explode(" ", $closer_campaigns);
}
if ($ADD==3)
{
$stmt="SELECT closer_campaigns from vicidial_users where user='$user';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$closer_campaigns = $row[0];
$closer_campaigns = preg_replace("/ -$/","",$closer_campaigns);
$groups = explode(" ", $closer_campaigns);
}
$stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id";
# $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id";
$rslt=mysql_query($stmt, $link);
$groups_to_print = mysql_num_rows($rslt);
$groups_list='';
$groups_value='';
$XFERgroups_list='';
$RANKgroups_list="<tr><td>INBOUND GROUP</td><td> &nbsp; &nbsp; RANK</td><td> &nbsp; &nbsp; CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n";
$o=0;
while ($groups_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$group_id_values[$o] = $rowx[0];
$group_name_values[$o] = $rowx[1];
$o++;
}
$o=0;
while ($groups_to_print > $o)
{
$group_web_vars='';
$group_web='';
$stmt="SELECT group_rank,calls_today,group_web_vars from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]'";
$rslt=mysql_query($stmt, $link);
$ranks_to_print = mysql_num_rows($rslt);
if ($ranks_to_print > 0)
{
$row=mysql_fetch_row($rslt);
$SELECT_group_rank = $row[0];
$calls_today = $row[1];
$group_web_vars = $row[2];
}
else
{$calls_today=0; $SELECT_group_rank=0;}
if ( ($ADD=="4A") or ($ADD=="4B") )
{
if (isset($_GET["RANK_$group_id_values[$o]"])) {$group_rank=$_GET["RANK_$group_id_values[$o]"];}
elseif (isset($_POST["RANK_$group_id_values[$o]"])) {$group_rank=$_POST["RANK_$group_id_values[$o]"];}
if (isset($_GET["WEB_$group_id_values[$o]"])) {$group_web=$_GET["WEB_$group_id_values[$o]"];}
elseif (isset($_POST["WEB_$group_id_values[$o]"])) {$group_web=$_POST["WEB_$group_id_values[$o]"];}
if ($non_latin < 1)
{
$group_rank = ereg_replace("[^-\_0-9]","",$group_rank);
$group_web = preg_replace("/;|\"|\'/","",$group_web);
}
if ($ranks_to_print > 0)
{
$stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_web_vars='$group_web' where group_id='$group_id_values[$o]' and user='$user';";
$rslt=mysql_query($stmt, $link);
$stmt_grp_values .= "$stmt|";
}
else
{
$stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';";
$rslt=mysql_query($stmt, $link);
$stmt_grp_values .= "$stmt|";
}
$stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';";
$rslt=mysql_query($stmt, $link);
$stmt_grp_values .= "$stmt|";
}
else {$group_rank = $SELECT_group_rank;}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
$groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_values[$o]\"";
$XFERgroups_list .= "<input type=\"checkbox\" name=\"XFERgroups[]\" value=\"$group_id_values[$o]\"";
$RANKgroups_list .= "<tr $bgcolor><td><input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_values[$o]\"";
$p=0;
$group_ct = count($groups);
while ($p < $group_ct)
{
if ($group_id_values[$o] == $groups[$p])
{
$groups_list .= " CHECKED";
$RANKgroups_list .= " CHECKED";
$groups_value .= " $group_id_values[$o]";
}
$p++;
}
$p=0;
$XFERgroup_ct = count($XFERgroups);
while ($p < $XFERgroup_ct)
{
if ($group_id_values[$o] == $XFERgroups[$p])
{
$XFERgroups_list .= " CHECKED";
$XFERgroups_value .= " $group_id_values[$o]";
}
$p++;
}
$stmt="SELECT queue_priority from vicidial_inbound_groups where group_id='$group_id_values[$o]';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$VIG_priority = $row[0];
$groups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] - $VIG_priority <BR>\n";
$XFERgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] <BR>\n";
$RANKgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] </td>";
$RANKgroups_list .= "<td> &nbsp; &nbsp; <select size=1 name=RANK_$group_id_values[$o]>\n";
$h="9";
while ($h>=-9)
{
$RANKgroups_list .= "<option value=\"$h\"";
if ($h==$group_rank)
{$RANKgroups_list .= " SELECTED";}
$RANKgroups_list .= ">$h</option>";
$h--;
}
if ( (strlen($group_web) < 1) and (strlen($group_web_vars) > 0) )
{$group_web=$group_web_vars;}
$RANKgroups_list .= "</select></td>\n";
$RANKgroups_list .= "<td align=right> &nbsp; &nbsp; $calls_today</td>\n";
$RANKgroups_list .= "<td> &nbsp; &nbsp; <input type=text size=25 maxlength=255 name=WEB_$group_id_values[$o] value=\"$group_web\"></td></tr>\n";
$o++;
}
if (strlen($groups_value)>2) {$groups_value .= " -";}
if (strlen($XFERgroups_value)>2) {$XFERgroups_value .= " -";}
}
##### END get inbound groups listing for checkboxes #####
##### BEGIN get campaigns listing for checkboxes #####
if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($ADD==611111) )
{
if ( ($ADD==211111) or ($ADD==311111) or ($ADD==511111) or ($ADD==611111) )
{
$stmt="SELECT allowed_campaigns,qc_allowed_campaigns,qc_allowed_inbound_groups from vicidial_user_groups where user_group='$user_group';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$allowed_campaigns = $row[0];
$qc_allowed_campaigns = $row[1];
$qc_allowed_inbound_groups = $row[2];
$allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns);
$campaigns = explode(" ", $allowed_campaigns);
$qc_allowed_campaigns = preg_replace("/ -$/","",$qc_allowed_campaigns);
$qc_campaigns = explode(" ", $qc_allowed_campaigns);
$qc_allowed_inbound_groups = preg_replace("/ -$/","",$qc_allowed_inbound_groups);
$qc_groups = explode(" ", $qc_allowed_inbound_groups);
}
$campaigns_value='';
$campaigns_list='<B><input type="checkbox" name="campaigns[]" value="-ALL-CAMPAIGNS-"';
$qc_campaigns_value='';
$qc_campaigns_list='<B><input type="checkbox" name="qc_campaigns[]" value="-ALL-CAMPAIGNS-"';
$qc_groups_value='';
$qc_groups_list='<B><input type="checkbox" name="qc_groups[]" value="-ALL-GROUPS-"';
$p=0;
while ($p<2000)
{
if (eregi('ALL-CAMPAIGNS',$campaigns[$p]))
{
$campaigns_list.=" CHECKED";
$campaigns_value .= " -ALL-CAMPAIGNS-";
}
if (eregi('ALL-CAMPAIGNS',$qc_campaigns[$p]))
{
$qc_campaigns_list.=" CHECKED";
$qc_campaigns_value .= " -ALL-CAMPAIGNS-";
}
if (eregi('ALL-GROUPS',$qc_groups[$p]))
{
$qc_groups_list.=" CHECKED";
$qc_groups_value .= " -ALL-GROUPS-";
}
$p++;
}
$campaigns_list.="> ALL-CAMPAIGNS - USERS CAN VIEW ANY CAMPAIGN</B><BR>\n";
$qc_campaigns_list.="> ALL-CAMPAIGNS - USERS CAN QC ANY CAMPAIGN</B><BR>\n";
$qc_groups_list.="> ALL-GROUPS - USERS CAN QC ANY INBOUND GROUP</B><BR>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$o=0;
while ($campaigns_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$campaign_id_value = $rowx[0];
$campaign_name_value = $rowx[1];
$campaigns_list .= "<input type=\"checkbox\" name=\"campaigns[]\" value=\"$campaign_id_value\"";
$qc_campaigns_list .= "<input type=\"checkbox\" name=\"qc_campaigns[]\" value=\"$campaign_id_value\"";
$p=0;
while ($p<1000)
{
if ( ($campaign_id_value == $campaigns[$p]) and (strlen($campaign_id_value) > 1) )
{
# echo "<!-- X $p|$campaign_id_value|$campaigns[$p]| -->";
$campaigns_list .= " CHECKED";
$campaigns_value .= " $campaign_id_value";
}
if ($campaign_id_value == $qc_campaigns[$p])
{
$qc_campaigns_list .= " CHECKED";
$qc_campaigns_value .= " $campaign_id_value";
}
# echo "<!-- O $p|$campaign_id_value|$campaigns[$p]| -->";
$p++;
}
$campaigns_list .= "> $campaign_id_value - $campaign_name_value<BR>\n";
$qc_campaigns_list .= "> $campaign_id_value - $campaign_name_value<BR>\n";
$o++;
}
$stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id";
$rslt=mysql_query($stmt, $link);
$groups_to_print = mysql_num_rows($rslt);
$o=0;
while ($groups_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$group_id_value = $rowx[0];
$group_name_value = $rowx[1];
$qc_groups_list .= "<input type=\"checkbox\" name=\"qc_groups[]\" value=\"$group_id_value\"";
$p=0;
while ($p<2000)
{
if ( ($group_id_value == $qc_groups[$p]) and (strlen($group_id_value) > 1) )
{
$qc_groups_list .= " CHECKED";
$qc_groups_value .= " $group_id_value";
}
$p++;
}
$qc_groups_list .= "> $group_id_value - $group_name_value<BR>\n";
$o++;
}
if (strlen($campaigns_value)>2) {$campaigns_value .= " -";}
if (strlen($qc_campaigns_value)>2) {$qc_campaigns_value .= " -";}
if (strlen($qc_groups_value)>2) {$qc_groups_value .= " -";}
}
##### END get campaigns listing for checkboxes #####
if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999) ) or ($ADD=='141111111111') or ($ADD=='140111111111') or ($ADD=='341111111111') or ($ADD=='311111111111111') or ( (strlen($ADD)>4) and ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD<70)) or ($ADD=="4A") or ($ADD=="4B") or (strlen($ADD)==12) )
{
##### get server listing for dynamic pulldown
$stmt="SELECT server_ip,server_description,external_server_ip from servers order by server_ip";
$rsltx=mysql_query($stmt, $link);
$servers_to_print = mysql_num_rows($rsltx);
$servers_list='';
$o=0;
while ($servers_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
$servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1] - $rowx[2]</option>\n";
$o++;
}
}
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('$PHP_SELF?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
######################################################################################################
######################################################################################################
####### 9 series, HELP screen
######################################################################################################
######################################################################################################
######################
# ADD=99999 display the HELP SCREENS
######################
if ($ADD==99999)
{
echo "</title>\n";
echo "</head>\n";
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
echo "<CENTER>\n";
echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=4><B>ADMINISTRATION: HELP<BR></B></FONT><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><BR><BR>\n";
?>
<B><FONT SIZE=3>VICIDIAL_USERS TABLE</FONT></B><BR><BR>
<A NAME="vicidial_users-user">
<BR>
<B>User ID -</B> This field is where you put the VICIDIAL users ID number, can be up to 8 digits in length, Must be at least 2 characters in length.
<BR>
<A NAME="vicidial_users-pass">
<BR>
<B>Password -</B> This field is where you put the VICIDIAL users password. Must be at least 2 characters in length. A strong user password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number.
<BR>
<A NAME="vicidial_users-force_change_password">
<BR>
<B>Force Change Password -</B> If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N.
<BR>
<A NAME="vicidial_users-full_name">
<BR>
<B>Full Name -</B> This field is where you put the VICIDIAL users full name. Must be at least 2 characters in length.
<BR>
<A NAME="vicidial_users-user_level">
<BR>
<B>User Level -</B> This menu is where you select the VICIDIAL users user level. Must be a level of 1 to log into VICIDIAL, Must be level greater than 2 to log in as a closer, Must be user level 8 or greater to get into admin web section.
<BR>
<A NAME="vicidial_users-user_group">
<BR>
<B>User Group -</B> This menu is where you select the VICIDIAL users group that this user will belong to. This does not have any restrictions at this time, this is just to subdivide users and allow for future features based upon it.
<BR>
<A NAME="vicidial_users-phone_login">
<BR>
<B>Phone Login -</B> Here is where you can set a default phone login value for when the user logs into vicidial.php. This value will populate the phone_login automatically when the user logs in with their user-pass-campaign in the vicidial.php login screen.
<BR>
<A NAME="vicidial_users-phone_pass">
<BR>
<B>Phone Pass -</B> Here is where you can set a default phone pass value for when the user logs into vicidial.php. This value will populate the phone_pass automatically when the user logs in with their user-pass-campaign in the vicidial.php login screen.
<BR>
<A NAME="vicidial_users-active">
<BR>
<B>Active -</B> This field defines whether the user is active in the system and can use VICIDIAL resources. Default is Y
<BR>
<A NAME="vicidial_users-voicemail_id">
<BR>
<B>Voicemail ID -</B> This is the voicemail box that calls will be directed to in an AGENTDIRECT in-group at the drop time if the in-group has the drop method set to VOICEMAIL and the Voicemail field set to AGENTVMAIL.
<BR>
<A NAME="vicidial_users-optional">
<BR>
<B>Email, User Code and Territory -</B> These are optional fields.
<BR>
<A NAME="vicidial_users-hotkeys_active">
<BR>
<B>Hot Keys Active -</B> This option if set to 1 allows the user to use the Hot Keys quick-dispositioning function in vicidial.php.
<BR>
<A NAME="vicidial_users-agent_choose_ingroups">
<BR>
<B>Agent Choose Ingroups -</B> This option if set to 1 allows the user to choose the ingroups that they will receive calls from when they login to a CLOSER or INBOUND campaign. Otherwise the Manager will need to set this in their user detail screen of the admin page.
<BR>
<A NAME="vicidial_users-agent_choose_blended">
<BR>
<B>Agent Choose Blended -</B> This option if set to 1 allows the user to choose if the agent has their campaign set to blended or not, and if not then the default blended setting will be used. Default is 1 for enabled.
<BR>
<A NAME="vicidial_users-agent_choose_territories">
<BR>
<B>Agent Choose Territories -</B> This option if set to 1 allows the user to choose the territories that they will receive calls from when they login to a MANUAL or INBOUND_MAN campaign. Otherwise the user will be set to use all of the territories that they are set to belong to in the User Territories administrative section.
<BR>
<A NAME="vicidial_users-scheduled_callbacks">
<BR>
<B>Scheduled Callbacks -</B> This option allows an agent to disposition a call as CALLBK and choose the date and time at which the lead will be re-activated.
<BR>
<A NAME="vicidial_users-agentonly_callbacks">
<BR>
<B>Agent-Only Callbacks -</B> This option allows an agent to set a callback so that they are the only Agent that can call the customer back. This also allows the agent to see their callback listings and call them back any time they want to.
<BR>
<A NAME="vicidial_users-agentcall_manual">
<BR>
<B>Agent Call Manual -</B> This option allows an agent to manually enter a new lead into the system and call them. This also allows the calling of any phone number from their vicidial screen and puts that call into their session. Use this option with caution.
<BR>
<A NAME="vicidial_users-vicidial_recording">
<BR>
<B>Vicidial Recording -</B> This option can prevent an agent from doing any recordings after they log in to vicidial. This option must be on for vicidial to follow the campaign recording session.
<BR>
<A NAME="vicidial_users-vicidial_transfers">
<BR>
<B>Vicidial Transfers -</B> This option can prevent an agent from opening the transfer - conference session of vicidial. If this is disabled, the agent cannot third party call or blind transfer any calls.
<?php
if ($SSoutbound_autodial_active > 0)
{
?>
<BR>
<A NAME="vicidial_users-closer_default_blended">
<BR>
<B>Closer Default Blended -</B> This option simply defaults the Blended checkbox on a CLOSER login screen.
<?php
}
?>
<BR>
<A NAME="vicidial_users-vicidial_recording_override">
<BR>
<B>VICIDIAL Recording Override -</B> This option will override whatever the option is in the campaign for recording. DISABLED will not override the campaign recording setting. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording. For ALLCALLS and ALLFORCE there is an option to use the Recording Delay to cut down on very short recordings and recude system load.
<BR>
<A NAME="vicidial_users-agent_shift_enforcement_override">
<BR>
<B>Agent Shift Enforcement Override -</B> This setting will override whatever the users user group has set for Shift Enforcement. DISABLED will use the user group setting. OFF will not enforce shifts at all. START will only enforce the login time but will not affect an agent that is running over their shift time if they are already logged in. ALL will enforce shift start time and will log an agent out after they run over the end of their shift time. Default is DISABLED.
<BR>
<A NAME="vicidial_users-agent_call_log_view_override">
<BR>
<B>Agent Call Log View Override -</B> This setting will override whatever the users user group has set for Agent Call Log View. DISABLED will use the user group setting. N will not allow showing the users call log. Y will allow showing the user call log. Default is DISABLED.
<BR>
<A NAME="vicidial_users-agent_lead_search_override">
<BR>
<B>Agent Lead Search Override -</B> This setting will override whatever the campaign has set for Agent Lead Search. NOT_ACTIVE will use the campaign setting. ENABLED will allow lead searching and DISABLED will not allow lead searching. Default is NOT_ACTIVE.
<BR>
<A NAME="vicidial_users-alert_enabled">
<BR>
<B>Alert Enabled -</B> This field shows whether the agent has web browser alerts enabled for when calls come into their vicidial.php session. Default is 0 for NO.
<BR>
<A NAME="vicidial_users-allow_alerts">
<BR>
<B>Allow Alerts -</B> This field gives you the ability to allow agent browser alerts to be enabled by the agent for when calls come into their vicidial.php session. Default is 0 for NO.
<BR>
<A NAME="vicidial_users-vicidial_users-campaign_ranks">
<BR>
<B>Campaign Ranks -</B> In this section you can define the rank an agent will have for each campaign. These ranks can be used to allow for preferred call routing when Next Agent Call is set to campaign_rank. Also in this section are the WEB VARs for each campaign. These allow each agent to have a different variable string that can be added to the WEB FORM or SCRIPT tab URLs by simply putting --A--web_vars--B-- as you would put any other field.
<BR>
<A NAME="vicidial_users-closer_campaigns">
<BR>
<B>Inbound Groups -</B> Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign. You will also be able to set the rank, or skill level, in this section for each of the inbound groups as well as being able to see the number of calls received from each inbound group for this specific agent. Also in this section is the ability to give the agent a rank for each inbound group. These ranks can be used for preferred call routing when that option is selected in the in-group screen. Also in this section are the WEB VARs for each campaign. These allow each agent to have a different variable string that can be added to the WEB FORM or SCRIPT tab URLs by simply putting --A--web_vars--B-- as you would put any other field.
<BR>
<A NAME="vicidial_users-alter_custdata_override">
<BR>
<B>Agent Alter Customer Data Override -</B> This option will override whatever the option is in the campaign for altering of customer data. NOT_ACTIVE will use whatever setting is present for the campaign. ALLOW_ALTER will always allow for the agent to alter the customer data, no matter what the campaign setting is. Default is NOT_ACTIVE.
<BR>
<A NAME="vicidial_users-alter_custphone_override">
<BR>
<B>Agent Alter Customer Phone Override -</B> This option will override whatever the option is in the campaign for altering of customer phone number. NOT_ACTIVE will use whatever setting is present for the campaign. ALLOW_ALTER will always allow for the agent to alter the customer phone number, no matter what the campaign setting is. Default is NOT_ACTIVE.
<BR>
<A NAME="vicidial_users-custom_one">
<BR>
<B>Custom User Fields -</B> These five fields can be used for various purposes, and they can be populated in the web form addresses and scripts as user_custom_one and so on. The Custom 5 field can be used as a field to define a dialplan number to send a call to from an AGENTDIRECT in-group if the user is unavailable, you just need to put AGENTEXT in the MESSAGE or EXTENSION field in the AGENTDIRECT in-group and the system will look up the custom five field and send the call to that dialplan number.
<BR>
<A NAME="vicidial_users-alter_agent_interface_options">
<BR>
<B>Alter Agent Interface Options -</B> This option if set to 1 allows the administrative user to modify the Agents interface options in admin.php.
<BR>
<A NAME="vicidial_users-delete_users">
<BR>
<B>Delete Users -</B> This option if set to 1 allows the user to delete other users of equal or lesser user level from the system.
<BR>
<A NAME="vicidial_users-delete_user_groups">
<BR>
<B>Delete User Groups -</B> This option if set to 1 allows the user to delete user groups from the system.
<BR>
<A NAME="vicidial_users-delete_lists">
<BR>
<B>Delete Lists -</B> This option if set to 1 allows the user to delete vicidial lists from the system.
<BR>
<A NAME="vicidial_users-delete_campaigns">
<BR>
<B>Delete Campaigns -</B> This option if set to 1 allows the user to delete vicidial campaigns from the system.
<BR>
<A NAME="vicidial_users-delete_ingroups">
<BR>
<B>Delete In-Groups -</B> This option if set to 1 allows the user to delete vicidial In-Groups from the system.
<BR>
<A NAME="vicidial_users-delete_remote_agents">
<BR>
<B>Delete Remote Agents -</B> This option if set to 1 allows the user to delete vicidial remote agents from the system.
<?php
if ($SSoutbound_autodial_active > 0)
{
?>
<BR>
<A NAME="vicidial_users-load_leads">
<BR>
<B>Load Leads -</B> This option if set to 1 allows the user to load vicidial leads into the vicidial_list table by way of the web based lead loader.
<?php
}
if ($SScustom_fields_enabled > 0)
{
?>
<BR>
<A NAME="vicidial_users-custom_fields_modify">
<BR>
<B>Custom Fields Modify -</B> This option if set to 1 allows the user to modify custom list fields.
<?php
}
?>
<BR>
<A NAME="vicidial_users-campaign_detail">
<BR>
<B>Campaign Detail -</B> This option if set to 1 allows the user to view and modify the campaign detail screen elements.
<BR>
<A NAME="vicidial_users-ast_admin_access">
<BR>
<B>AGC Admin Access -</B> This option if set to 1 allows the user to login to the astGUIclient admin pages.
<BR>
<A NAME="vicidial_users-ast_delete_phones">
<BR>
<B>AGC Delete Phones -</B> This option if set to 1 allows the user to delete phone entries in the astGUIclient admin pages.
<BR>
<A NAME="vicidial_users-delete_scripts">
<BR>
<B>Delete Scripts -</B> This option if set to 1 allows the user to delete Campaign scripts in the script modification screen.
<BR>
<A NAME="vicidial_users-modify_leads">
<BR>
<B>Modify Leads -</B> This option if set to 1 allows the user to modify leads in the admin section lead search results page.
<BR>
<A NAME="vicidial_users-change_agent_campaign">
<BR>
<B>Change Agent Campaign -</B> This option if set to 1 allows the user to alter the campaign that an agent is logged into while they are logged into it.
<?php
if ($SSoutbound_autodial_active > 0)
{
?>
<BR>
<A NAME="vicidial_users-delete_filters">
<BR>
<B>Delete Filters -</B> This option allows the user to be able to delete vicidial lead filters from the system.
<?php
}
?>
<BR>
<A NAME="vicidial_users-delete_call_times">
<BR>
<B>Delete Call Times -</B> This option allows the user to be able to delete vicidial call times records and vicidial state call times records from the system.
<BR>
<A NAME="vicidial_users-modify_call_times">
<BR>
<B>Modify Call Times -</B> This option allows the user to view and modify the call times and state call times records. A user doesn't need this option enabled if they only need to change the call times option on the campaigns screen.
<BR>
<A NAME="vicidial_users-modify_sections">
<BR>
<B>Modify Sections -</B> These options allow the user to view and modify each sections records. If set to 0, the user will be able to see the section list, but not the detail or modification screen of a record in that section.
<BR>
<A NAME="vicidial_users-view_reports">
<BR>
<B>View Reports -</B> This option allows the user to view the VICIDIAL reports.
<?php
if ($SSqc_features_active > 0)
{
?>
<BR>
<A NAME="vicidial_users-qc_enabled">
<BR>
<B>QC Enabled -</B> This option allows the user to log in to the Quality Control agent screen.
<BR>
<A NAME="vicidial_users-qc_user_level">
<BR>
<B>QC User Level -</B> This setting defines what the agent Quality Control user level is. This will dictate the level of functionality for the agent in the QC section:<BR>
1 - Modify Nothing<BR>
2 - Modify Nothing Except Status<BR>
3 - Modify All Fields<BR>
4 - Verify First Round of QC<BR>
5 - View QC Statistics<BR>
6 - Ability to Modify FINISHed records<BR>
7 - Manager Level<BR>
<BR>
<A NAME="vicidial_users-qc_pass">
<BR>
<B>QC Record Pass -</B> This option allows the agent to specify that a record has passed the first round of QC after reviewing the record.
<BR>
<A NAME="vicidial_users-qc_finish">
<BR>
<B>QC Record Finish -</B> This option allows the agent to specify that a record has finished the second round of QC after reviewing the passed record.
<BR>
<A NAME="vicidial_users-qc_commit">
<BR>
<B>QC Record Commit -</B> This option allows the agent to specify that a record has been committed in QC. It can no longer be modified by anyone.
<?php
}
?>
<BR>
<A NAME="vicidial_users-add_timeclock_log">
<BR>
<B>Add Timeclock Log Record -</B> This option allows the user to add records to the timeclock log.
<BR>
<A NAME="vicidial_users-modify_timeclock_log">
<BR>
<B>Modify Timeclock Log Record -</B> This option allows the user to modify records in the timeclock log.
<BR>
<A NAME="vicidial_users-delete_timeclock_log">
<BR>
<B>Delete Timeclock Log Record -</B> This option allows the user to delete records in the timeclock log.
<BR>
<A NAME="vicidial_users-vdc_agent_api_access">
<BR>
<B>Agent API Access -</B> This option allows the account to be used with the vicidial agent API commands.
<BR>
<A NAME="vicidial_users-manager_shift_enforcement_override">
<BR>
<B>Manager Shift Enforcement Override -</B> This setting if set to 1 will allow a manager to enter their user and password on an agent screen to override the shift restrictions on an agent session if the agent is trying to log in outside of their shift. Default is 0.
<BR>
<A NAME="vicidial_users-download_lists">
<BR>
<B>Download Lists -</B> This setting if set to 1 will allow a manager to click on the download list link at the bottom of a list modification screen to export the entire contents of a list to a flat data file. Default is 0.
<BR>
<A NAME="vicidial_users-export_reports">
<BR>
<B>Export Reports -</B> This setting if set to 1 will allow a manager to access the export call and lead reports on the REPORTS screen. Default is 0. For the Export Calls and Leads Reports, the following field order is used for exports: <BR>call_date, phone_number_dialed, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, 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, length_in_sec, user_group, alt_dial/queue_seconds, rank, owner
<BR>
<A NAME="vicidial_users-delete_from_dnc">
<BR>
<B>Delete From DNC Lists -</B> This setting if set to 1 will allow a manager to remove phone numbers from the DNC lists in the VICIDIAL system.
<BR>
<A NAME="vicidial_users-realtime_block_user_info">
<BR>
<B>Realtime Block User Info -</B> This setting if set to 1 will block user and station information from being displayed in the Real-time report. Default is 0 for disabled.
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_CAMPAIGNS TABLE</FONT></B><BR><BR>
<A NAME="vicidial_campaigns-campaign_id">
<BR>
<B>Campaign ID -</B> This is the short name of the campaign, it is not editable after initial submission, cannot contain spaces and must be between 2 and 8 characters in length.
<BR>
<A NAME="vicidial_campaigns-campaign_name">
<BR>
<B>Campaign Name -</B> This is the description of the campaign, it must be between 6 and 40 characters in length.
<BR>
<A NAME="vicidial_campaigns-campaign_description">
<BR>
<B>Campaign Description -</B> This is a memo field for the campaign, it is optional and can be a maximum of 255 characters in length.
<BR>
<A NAME="vicidial_campaigns-campaign_changedate">
<BR>
<B>Campaign Change Date -</B> This is the last time that the settings for this campaign were modified in any way.
<BR>
<A NAME="vicidial_campaigns-campaign_logindate">
<BR>
<B>Last Campaign Login Date -</B> This is the last time that an agent was logged into this campaign.
<BR>
<A NAME="vicidial_campaigns-campaign_calldate">
<BR>
<B>Last Campaign Call Date -</B> This is the last time that a call was handled by an agent logged into this campaign.
<BR>
<A NAME="vicidial_campaigns-campaign_stats_refresh">
<BR>
<B>Campaign Stats Refresh -</B> This checkbox will allow you to force a vicidial stats refresh, even if the campaign is not active.
<BR>
<A NAME="vicidial_campaigns-realtime_agent_time_stats">
<BR>
<B>Real-Time Agent Time Stats -</B> Setting this to anything but DISABLED will enable the gathering of agent time stats for today for this campaign, that are viewable through the Real-Time report. CALLS are the average calls handled per agent, WAIT is the average agent wait time, CUST is the average customer talk time, ACW is the average After Call Work time, PAUSE is the average pause time. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-active">
<BR>
<B>Active -</B> This is where you set the campaign to Active or Inactive. If Inactive, noone can log into it.
<BR>
<A NAME="vicidial_campaigns-park_ext">
<BR>
<B>Park Music-on-Hold -</B> This is where you can define the on-hold music context for this campaign. Make sure you select a valid music on hold context from the select list and that the context that you have selected has valid files in it. Default is default.
<BR>
<A NAME="vicidial_campaigns-park_file_name">
<BR>
<B>Park File Name -</B> NOT USED.
<BR>
<A NAME="vicidial_campaigns-web_form_address">
<BR>
<B>Web Form -</B> This is where you can set the custom web page that will be opened when the user clicks on the WEB FORM button. To customize the query string after the web form, simply begin the web form with VAR and then the URL that you want to use, replacing the variables with the variable names that you want to use --A--phone_number--B-- just like in the SCRIPTS tab section. If you want to use custom fields in a web form address, you need to add &CF_uses_custom_fields=Y as part of your URL.
<BR>
<A NAME="vicidial_campaigns-web_form_target">
<BR>
<B>Web Form Target-</B> This is where you can set the custom web page frame that the web form will be opened in when the user clicks on the WEB FORM button. Default is _blank.
<BR>
<A NAME="vicidial_campaigns-allow_closers">
<BR>
<B>Allow Closers -</B> This is where you can set whether the users of this campaign will have the option to send the call to a closer.
<BR>
<A NAME="vicidial_campaigns-default_xfer_group">
<BR>
<B>Default Transfer Group -</B> This field is the default In-Group that will be automatically selected when the agent goes to the transfer-conference frame in their agent interface.
<BR>
<A NAME="vicidial_campaigns-xfer_groups">
<BR>
<B>Allowed Transfer Groups -</B> With these checkbox listings you can select the groups that agents in this campaign can transfer calls to. Allow Closers must be enabled for this option to show up.
<?php
if ($SSoutbound_autodial_active > 0)
{
?>
<BR>
<A NAME="vicidial_campaigns-campaign_allow_inbound">
<BR>
<B>Allow Inbound and Blended -</B> This is where you can set whether the users of this campaign will have the option to take inbound calls with this campaign. If you want to do blended inbound and outbound then this must be set to Y. If you only want to do outbound dialing on this campaign set this to N. Default is N.
<BR>
<A NAME="vicidial_campaigns-dial_status">
<BR>
<B>Dial Status -</B> This is where you set the statuses that you are wanting to dial on within the lists that are active for the campaign below. To add another status to dial, select it from the drop-down list and click ADD. To remove one of the dial statuses, click on the REMOVE link next to the status you want to remove.
<BR>
<A NAME="vicidial_campaigns-lead_order">
<BR>
<B>List Order -</B> This menu is where you select how the leads that match the statuses selected above will be put in the lead hopper:
<BR> &nbsp; - DOWN: select the first leads loaded into the vicidial_list table
<BR> &nbsp; - UP: select the last leads loaded into the vicidial_list table
<BR> &nbsp; - UP PHONE: select the highest phone number and works its way down
<BR> &nbsp; - DOWN PHONE: select the lowest phone number and works its way up
<BR> &nbsp; - UP LAST NAME: starts with last names starting with Z and works its way down
<BR> &nbsp; - DOWN LAST NAME: starts with last names starting with A and works its way up
<BR> &nbsp; - UP COUNT: starts with most called leads and works its way down
<BR> &nbsp; - DOWN COUNT: starts with least called leads and works its way up
<BR> &nbsp; - DOWN COUNT 2nd NEW: starts with least called leads and works its way up inserting a NEW lead in every other lead - Must NOT have NEW selected in the dial statuses
<BR> &nbsp; - DOWN COUNT 3nd NEW: starts with least called leads and works its way up inserting a NEW lead in every third lead - Must NOT have NEW selected in the dial statuses
<BR> &nbsp; - DOWN COUNT 4th NEW: starts with least called leads and works its way up inserting a NEW lead in every forth lead - Must NOT have NEW selected in the dial statuses
<BR> &nbsp; - RANDOM: Randomly grabs lead within the statuses and lists defined
<BR> &nbsp; - UP LAST CALL TIME: Sorts by the newest local call time for the leads
<BR> &nbsp; - DOWN LAST CALL TIME: Sorts by the oldest local call time for the leads
<BR> &nbsp; - UP RANK: Starts with the highest rank and works its way down
<BR> &nbsp; - DOWN RANK: Starts with the lowest rank and works its way up
<BR> &nbsp; - UP OWNER: Starts with owners beginning with Z and works its way down
<BR> &nbsp; - DOWN OWNER: Starts with owners beginning with A and works its way up
<BR> &nbsp; - UP TIMEZONE: Starts with Eastern timezones and works West
<BR> &nbsp; - DOWN TIMEZONE: Starts with Western timezones and works East
<BR>
<A NAME="vicidial_campaigns-lead_order_randomize">
<BR>
<B>List Order Randomize -</B> This option allows you to randomize the order of the leads in the hopper load within the results defined by the criteria set above. For instance, the List Order will be preserved, but the results will be randomized within that sorting. Setting this option to Y will enable this feature. Default is N for disabled. NOTE, if you have a large number of leads this option may slow down the speed of the hopper loading script.
<BR>
<A NAME="vicidial_campaigns-lead_order_secondary">
<BR>
<B>List Order Secondary -</B> This option allows you to select the second sorting order of the leads in the hopper load after the List Order and within the results defined by the criteria set above. For instance, the List Order will be used for the first sort of the leads, but the results will be sorted a second time within that sorting across the same set of the first List Order. For example, if you have List Order set to DOWN COUNT and you only have leads that have been attempted 1 and 2 times, then if you have the List Order Secondary set to LEAD_ASCEND all of the attempt 1 leads will be sorted by the oldest leads first and will be put into the hopper that way. Default is LEAD_ASCEND. NOTE, if you have a large number of leads using one of the CALLTIME options may slow down the speed of the hopper loading script. If List Order Randomize is enabled, this option will be ignored.
<BR>
<A NAME="vicidial_campaigns-hopper_level">
<BR>
<B>Minimum Hopper Level -</B> This is the minimum number of leads the VDhopper script tries to keep in the vicidial_hopper table for this campaign. If running VDhopper script every minute, make this slightly greater than the number of leads you go through in a minute.
<BR>
<A NAME="vicidial_campaigns-use_auto_hopper">
<BR>
<B>Automatic Hopper Level -</B> Setting thing to Y will allow Vicidial to automatically adjust the hopper based off the settings you have in your campaign. The formula it uses to do this is:<BR>Number of Active Agents * Auto Dial Level * ( 60 seconds / Dial Timeout ) * Auto Hopper Multiplier<BR>Default is Y.
<BR>
<A NAME="vicidial_campaigns-auto_hopper_multi">
<BR>
<B>Automatic Hopper Multiplier -</B> This is multiplier for the Auto Hopper. Setting this less than 1 will cause the Auto Hopper algorithm to load less leads than it normally would. Setting this greater than 1 will cause the Auto Hopper algorithm to load more leads than it normally would. Default is 1.
<BR>
<A NAME="vicidial_campaigns-auto_trim_hopper">
<BR>
<B>Auto Trim Hopper -</B> Setting thing to Y will allow Vicidial to automatically remove excess leads from the hopper. Default is Y.
<BR>
<A NAME="vicidial_campaigns-lead_filter_id">
<BR>
<B>Lead Filter -</B> This is a method of filtering your leads using a fragment of a SQL query. Use this feature with caution, it is easy to stop dialing accidentally with the slightest alteration to the SQL statement. Default is NONE.
<BR>
<A NAME="vicidial_campaigns-drop_lockout_time">
<BR>
<B>Drop Lockout Time -</B> This is a number of hours that DROP abandon calls will be prevented from being dialed, to disable set to 0. This setting is very useful in countries like the UK where there are regulations preventing the attempted calling of customers within 72 hours of an Abandon, or DROP. Default is 0.
<BR>
<A NAME="vicidial_campaigns-force_reset_hopper">
<BR>
<B>Force Reset of Hopper -</B> This allows you to wipe out the hopper contents upon form submission. It should be filled again when the VDhopper script runs.
<BR>
<A NAME="vicidial_campaigns-dial_method">
<BR>
<B>Dial Method -</B> This field is the way to define how dialing is to take place. If MANUAL then the auto_dial_level will be locked at 0 unless Dial Method is changed. If RATIO then the normal dialing a number of lines for Active agents. ADAPT_HARD_LIMIT will dial predictively up to the dropped percentage and then not allow aggressive dialing once the drop limit is reached until the percentage goes down again. ADAPT_TAPERED allows for running over the dropped percentage in the first half of the shift -as defined by call_time selected for campaign- and gets more strict as the shift goes on. ADAPT_AVERAGE tries to maintain an average or the dropped percentage not imposing hard limits as aggressively as the other two methods. You cannot change the Auto Dial Level if you are in any of the ADAPT dial methods. Only the Dialer can change the dial level when in predictive dialing mode. INBOUND_MAN allows the agent to place manual dial calls from a campaign list while being able to take inbound calls between manual dial calls.
<BR>
<A NAME="vicidial_campaigns-auto_dial_level">
<BR>
<B>Auto Dial Level -</B> This is where you set how many lines VICIDIAL should use per active agent. zero 0 means auto dialing is off and the agents will click to dial each number. Otherwise VICIDIAL will keep dialing lines equal to active agents multiplied by the dial level to arrive at how many lines this campaign on each server should allow. The ADAPT OVERRIDE checkbox allows you to force a new dial level even though the dial method is in an ADAPT mode. This is useful if there is a dramatic shift in the quality of leads and you want to drastically change the dial_level manually.
<BR>
<A NAME="vicidial_campaigns-dial_level_threshold">
<BR>
<B>Auto Dial Level Threshold -</B> This setting only works with an ADAPT or RATIO Dial Method, and it must be set to something other than DISABLED and the number of agents setting must be above 0. This feature allows you to set a minimum number agents that predictive algorithm will work at. If the number of agents falls below the number that you have set, then the dial level will go to 1.0 until more agents log in or go into the selected state. LOGGED-IN_AGENTS will count all agents logged into the campaign, NON-PAUSED_AGENTS will only count agents that are waiting or talking, and WAITING_AGENTS will only count agents that are waiting for a call. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-available_only_ratio_tally">
<BR>
<B>Available Only Tally -</B> This field if set to Y will leave out INCALL and QUEUE status agents when calculating the number of calls to dial when not in MANUAL dial mode. Default is N.
<BR>
<A NAME="vicidial_campaigns-available_only_tally_threshold">
<BR>
<B>Available Only Tally Threshold -</B> This setting only works with an ADAPT or RATIO Dial Method, Available Only Tally must be set to N, this setting must be set to something other than DISABLED and the number of agents setting must be above 0. This feature allows you to set the number of agents below which Available Only Tally will be enabled. If the number of agents falls below the number that you have set, then the Available Only Tally setting with go to Y temporarily until more agents log in or go into the selected state. LOGGED-IN_AGENTS will count all agents logged into the campaign, NON-PAUSED_AGENTS will only count agents that are waiting or talking, and WAITING_AGENTS will only count agents that are waiting for a call. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-adaptive_dropped_percentage">
<BR>
<B>Drop Percentage Limit -</B> This field is where you set the limit of the percentage of dropped calls you would like while using an adaptive-predictive dial method, not MANUAL or RATIO.
<BR>
<A NAME="vicidial_campaigns-adaptive_maximum_level">
<BR>
<B>Maximum Adapt Dial Level -</B> This field is where you set the limit of the limit to the numbr of lines you would like dialed per agent while using an adaptive-predictive dial method, not MANUAL or RATIO. This number can be higher than the Auto Dial Level if your hardware will support it. Value must be a positive number greater than one and can have decimal places Default 3.0.
<BR>
<A NAME="vicidial_campaigns-adaptive_latest_server_time">
<BR>
<B>Latest Server Time -</B> This field is only used by the ADAPT_TAPERED dial method. You should enter in the hour and minute that you will stop calling on this campaign, 2100 would mean that you will stop dialing this campaign at 9PM server time. This allows the Tapered algorithm to decide how aggressively to dial by how long you have until you will be finished calling.
<BR>
<A NAME="vicidial_campaigns-adaptive_intensity">
<BR>
<B>Adapt Intensity Modifier -</B> This field is used to adjust the predictive intensity either higher or lower. The higher a positive number you select, the greater the dialer will increase the call pacing when it goes up and the slower the dialer will decrease the call pacing when it goes down. The lower the negative number you select here, the slower the dialer will increase the call pacing and the faster the dialer will lower the call pacing when it goes down. Default is 0. This field is not used by the MANUAL or RATIO dial methods.
<BR>
<A NAME="vicidial_campaigns-adaptive_dl_diff_target">
<BR>
<B>Dial Level Difference Target -</B> This field is used to define whether you want to target having a specific number of agents waiting for calls or calls waiting for agents. For example if you would always like to have on average one agent free to take calls immediately you would set this to -1, if you would like to target always having one call on hold waiting for an agent you would set this to 1. Default is 0. This field is not used by the MANUAL or INBOUND_MAN dial methods.
<BR>
<A NAME="vicidial_campaigns-dl_diff_target_method">
<BR>
<B>Dial Level Difference Target Method -</B> This option allows you to define whether the dial level difference target setting is applied only to the calculation of the dial level or also to the actual dialing on each dialing server. If you are running a small campaign with agents logged in on many servers you may want to use the ADAPT_CALC_ONLY option, because the CALLS_PLACED option may result in fewer calls being placed than deisred. This option is only active if Dial Level Difference Target is set to something other than 0. Default is ADAPT_CALC_ONLY.
<BR>
<A NAME="vicidial_campaigns-concurrent_transfers">
<BR>
<B>Concurrent Transfers -</B> This setting is used to define the number of calls that can be sent to agents at the same time. It is recommended that this setting is left at AUTO. This field is not used by the MANUAL dial method.
<BR>
<A NAME="vicidial_campaigns-queue_priority">
<BR>
<B>Queue Priority -</B> This setting is used to define the order in which the calls from this outbound campaign should be answered in relation to the inbound calls if this campaign is in blended mode. We do not recommend setting inbound calls to a higher priority than the outbound campaign calls because people calling in expect to wait and people being called expect for someone to be there on the phone.
<BR>
<A NAME="vicidial_campaigns-drop_rate_group">
<BR>
<B>Multiple Campaign Drop Rate Group -</B> This feature allows you to set a campaign as a member of a Campaign Drop Rate Group, or a group of campaigns whose Human Answered calls and Drop calls for all campaigns in the group will be combined into a shared drop percentage, or abandon rate. This allows you to to run multiple campaigns at once and more easily control your drop rate. This is particularly useful in the UK where regulations permit this drop rate calculation method with campaign grouping for the same company even if there are several campaigns that company is running during the same day. To enable this for a campaign, just select a group from the list. There are 10 groups defined in the system by default, you can contact your system administrator to add more. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-inbound_queue_no_dial">
<BR>
<B>Inbound Queue No Dial -</B> This feature if set to ENABLED allows you to prevent outbound auto-dialing of this campaign if there are any inbound calls waiting in queue that are part of the allowed inbound groups set in this campaign. Setting this to ALL_SERVERS will change the algorithm to calculate all inbound calls as active calls on this server even if they are on another server which will reduce the chance of placing unnecessary outbound calls if you have calls coming in on another server. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-auto_alt_dial">
<BR>
<B>Auto Alt-Number Dialing -</B> This setting is used to automatically dial alternate number fields while dialing in the RATIO and ADAPT dial methods when there is no contact at the main phone number for a lead, the NA, B, DC and N statuses. This setting is not used by the MANUAL dial method. EXTENDED alternate numbers are numbers loaded into the system outside of the standard lead information screen. Using EXTENDED you can have hundreds of phone numbers for a single customer record. Using MULTI_LEAD allows you to use a separate lead for each number on a customer account that all share a common vendor_lead_code, and the type of phone number for each is defined with a label in the Owner field. This option will disable some options on the Modify Campaign screen and show a link to the Multi-Alt Settings page which allows you to set which phone number types, defined by the label of each lead, will be dialed and in what order. This will create a special lead filter and will alter the Rank field of all of the leads inside the lists set to this campaign in order to call them in the order you have specified.
<BR>
<A NAME="vicidial_campaigns-dial_timeout">
<BR>
<B>Dial Timeout -</B> If defined, calls that would normally hang up after the timeout defined in extensions.conf would instead timeout at this amount of seconds if it is less than the extensions.conf timeout. This allows for quickly changing dial timeouts from server to server and limiting the effects to a single campaign. If you are having a lot of Answering Machine or Voicemail calls you may want to try changing this value to between 21-26 and see if results improve.
<BR>
<A NAME="vicidial_campaigns-campaign_vdad_exten">
<BR>
<B>Routing Extension -</B> This field allows for a custom outbound routing extension. This allows you to use different call handling methods depending upon how you want to route calls through your outbound campaign. Formerly called Campaign VDAD extension.
<BR>- 8364 - same as 8368
<BR>- 8365 - Will send the call only to an agent on the same server as the call is placed on
<BR>- 8366 - Used for press-1, broadcast and survey campaigns
<BR>- 8367 - Will try to first send the call to an agent on the local server, then it will look on other servers
<BR>- 8368 - DEFAULT - Will send the call to the next available agent no matter what server they are on
<BR>- 8369 - Used for Answering Machine Detection after that, same behavior as 8368
<BR>- 8373 - Used for Answering Machine Detection after that same behavior as 8366
<BR>- 8374 - Used for press-1, broadcast and survey campaigns with Cepstral Text-to-speech
<BR>- 8375 - Used for Answering Machine Detection then press-1, broadcast and survey campaigns with Cepstral Text-to-speech
<BR>
<A NAME="vicidial_campaigns-am_message_exten">
<BR>
<B>Answering Machine Message -</B> This field is for entering the prompt to play when the agent gets an answering machine and clicks on the Answering Machine Message button in the transfer conference frame. You must set this to either an audio file in the audio store or a TTS prompt if TTS is enabled on your system.
<BR>
<A NAME="vicidial_campaigns-waitforsilence_options">
<BR>
<B>WaitForSilence Options -</B> If Wait For Silence is desired on calls that are detected as Answering Machines then this field has those options. There are two settings separated by a comma, the first option is how long to detect silence in milliseconds and the second option is for how many times to detect that before playing the message. Default is EMPTY for disabled. A standard value for this would be wait for 2 seconds of silence twice: 2000,2
<BR>
<A NAME="vicidial_campaigns-amd_send_to_vmx">
<BR>
<B>AMD send to vm exten -</B> This menu allows you to define whether a message is left on an answering machine when it is detected. the call will be immediately forwarded to the Answering-Machine-Message extension if AMD is active and it is determined that the call is an answering machine.
<BR>
<A NAME="vicidial_campaigns-cpd_amd_action">
<BR>
<B>CPD AMD Action -</B> If you are using the Sangoma ParaXip Call Progress Detection software then you will want to enable this setting either setting it to DISPO which will disposition the call as AA and hang it up if the call is being processed and has not been sent to an agent yet or MESSAGE which will send the call to the defined Answering Machine Message for this campaign. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-alt_number_dialing">
<BR>
<B>Agent Alt Num Dialing -</B> This option allows an agent to manually dial the alternate phone number or address3 field after the main number has been called.
<BR>
<A NAME="vicidial_campaigns-drop_call_seconds">
<BR>
<B>Drop Call Seconds -</B> The number of seconds from the time the customer line is picked up until the call is considered a DROP, only applies to outbound calls.
<BR>
<A NAME="vicidial_campaigns-drop_action">
<BR>
<B>Drop Action -</B> This menu allows you to choose what happens to a call when it has been waiting for longer than what is set in the Drop Call Seconds field. HANGUP will simply hang up the call, MESSAGE will send the call the Drop Exten that you have defined below, VOICEMAIL will send the call to the voicemail box that you have defined below and IN_GROUP will send the call to the Inbound Group that is defined below
<BR>
<A NAME="vicidial_campaigns-safe_harbor_exten">
<BR>
<B>Safe Harbor Exten -</B> This is the dial plan extension that the desired Safe Harbor audio file is located at on your server.
<BR>
<A NAME="vicidial_campaigns-safe_harbor_audio">
<BR>
<B>Safe Harbor Audio -</B> This is the audio prompt file that is played if the Drop Action is set to AUDIO. Default is buzz.
<BR>
<A NAME="vicidial_campaigns-safe_harbor_menu_id">
<BR>
<B>Safe Harbor Call Menu -</B> This is the call menu that a call is sent to if the Drop Action is set to CALLMENU.
<BR>
<A NAME="vicidial_campaigns-voicemail_ext">
<BR>
<B>Voicemail -</B> If defined, calls that would normally DROP would instead be directed to this voicemail box to hear and leave a message.
<BR>
<A NAME="vicidial_campaigns-drop_inbound_group">
<BR>
<B>Drop Transfer Group -</B> If Drop Action is set to IN_GROUP, the call will be sent to this inbound group if it reaches Drop Call Seconds.
<BR>
<A NAME="vicidial_campaigns-no_hopper_leads_logins">
<BR>
<B>Allow No-Hopper-Leads Logins -</B> If set to Y, allows agents to login to the campaign even if there are no leads loaded into the hopper for that campaign. This function is not needed in CLOSER-type campaigns. Default is N.
<BR>
<A NAME="vicidial_campaigns-no_hopper_dialing">
<BR>
<B>No Hopper Dialing -</B> If This is enabled, the hopper will not run for this campaign. This option is only available when the dial method is set to MANUAL or INBOUND_MAN. It is recommended that you do not enable this option if you have a very large lead database, over 100,000 leads. With No Hopper Dialing, the following features do not work: lead recycling, auto-alt-dialing, list mix, list ordering with Xth NEW. If you want to use Owner Only Dialing you must have No Hopper Dialing enabled. Default is N for disabled.
<BR>
<A NAME="vicidial_campaigns-agent_dial_owner_only">
<BR>
<B>Owner Only Dialing -</B> If This is enabled, the agent will only receive leads that they are within the ownership parameters for. If this is set to USER then the agent must be the user defined in the database as the owner of this lead. If this is set to TERRITORY then the owner of the lead must match the territory listed in the User Modification screen for this agent. If this is set to USER_GROUP then the owner of the lead must match the user group that the agent is a member of. For this feature to work the dial method must be set to MANUAL or INBOUND_MAN and No Hopper Dialing must be enabled. Default is NONE for disabled.
<?php
if ($SSuser_territories_active > 0)
{
?>
<BR>
<A NAME="vicidial_campaigns-agent_select_territories">
<BR>
<B>Agent Select Territories -</B> If this option is enabled and the agent belongs to at least one territory, the agent will have the option of selecting territories to dial leads from. The agent will see a list of available territories upon login and they will have the ability to go back to that territory list when paused to change their territories. For this function to work the Owner Only Dialing option must be set to TERRITORY and User Terriories must be enabled in the System Settings.
<?php
}
?>
<BR>
<A NAME="vicidial_campaigns-list_order_mix">
<BR>
<B>List Order Mix -</B> Overrides the Lead Order and Dial Status fields. Will use the List and status parameters for the selected List Mix entry in the List Mix sub section instead. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-vcl_id">
<BR>
<B>List Mix ID -</B> ID of the list mix. Must be from 2-20 characters in length with no spaces or other special punctuation.
<BR>
<A NAME="vicidial_campaigns-vcl_name">
<BR>
<B>List Mix Name -</B> Descriptive name of the list mix. Must be from 2-50 characters in length.
<BR>
<A NAME="vicidial_campaigns-list_mix_container">
<BR>
<B>List Mix Detail -</B> The composition of the List Mix entry. Contains the List ID, mix order, percentages and statuses that make up this List Mix. The percentages always have to add up to 100, and the lists all have to be active and set to the campaign for the order mix entry to be Activated.
<BR>
<A NAME="vicidial_campaigns-mix_method">
<BR>
<B>List Mix Method -</B> The method of mixing all of the parts of the List Mix Detail together. EVEN_MIX will mix leads from each part interleaved with the other parts, like this 1,2,3,1,2,3,1,2,3. IN_ORDER will put the leads in the order in which they are listed in the List Mix Detail screen 1,1,1,2,2,2,3,3,3. RANDOM will put them in RANDOM order 1,3,2,1,1,3,2,1,3. Default is IN_ORDER.
<BR>
<A NAME="vicidial_campaigns-agent_extended_alt_dial">
<BR>
<B>Agent Screen Extended Alt Dial -</B> This feature allows for agents to access extended alternate phone numbers for leads beyond the standard Alt Phone and Address3 fields that can be used in VICIDIAL for phone numbers beyond the main phone number. The Extended phone numbers can be dialed automatically using the Auto-Alt-Dial feature in VICIDIAL Campaign settings, but enabling this Agent Screen feature will also allow for the agent to call these numbers from their agent screen as well as edit their information.
<BR>
<A NAME="vicidial_campaigns-survey_first_audio_file">
<BR>
<B>Survey First Audio File -</B> This is the audio filename that is played as soon as the customer picks up the phone when running a survey campaign.
<BR>
<A NAME="vicidial_campaigns-survey_dtmf_digits">
<BR>
<B>Survey DTMF Digits -</B> This field is where you define the digits that a customer can press as an option on a survey campaign. valid dtmf digits are 0123456789*#. All options except for the Not Interested, Third and Fourth digit options will move on to the Survey Method call path.
<BR>
<A NAME="vicidial_campaigns-survey_ni_digit">
<BR>
<B>Survey Not Interested Digit -</B> This field is where you define the customer digit pressed that will show they are Not Interested.
<BR>
<A NAME="vicidial_campaigns-survey_ni_status">
<BR>
<B>Survey Not Interested Status -</B> This field is where you select the status to be used for Not Interested. If DNC is used and the campaign is set to use DNC then the phone number will be automatically added to the VICIDIAL internal DNC list and possibly the campaign-specific DNC list.
<BR>
<A NAME="vicidial_campaigns-survey_opt_in_audio_file">
<BR>
<B>Survey Opt-in Audio File -</B> This is the audio filename that is played when the customer has opted-in to the survey, not opted-out or not responded if the no-response-action is set to OPTOUT. After this audio file is played, the Survey Method action is taken.
<BR>
<A NAME="vicidial_campaigns-survey_ni_audio_file">
<BR>
<B>Survey Not Interested Audio File -</B> This is the audio filename that is played when the customer has opted-out of the survey, not opted-in or not responded if the no-response-action is set to OPTIN. After this audio file is played, the call will be hung up.
<BR>
<A NAME="vicidial_campaigns-survey_method">
<BR>
<B>Survey Method -</B> This option defines what happens to a call after the customer has opted-in. AGENT_XFER will send the call to the next available agent. VOICEMAIL will send the call to the voicemail box that is specified in the Voicemail field. EXTENSION will send the customer to the extension defined in the Survey Xfer Extension field. HANGUP will hang up the customer. CAMPREC_60_WAV will send the customer to have a recording made with their response, this recording will be placed in a folder named as the campaign inside of the Survey Campaign Recording Directory. CALLMENU will send the customer to the Call Menu defined in the select list below.
<BR>
<A NAME="vicidial_campaigns-survey_no_response_action">
<BR>
<B>Survey No-Response Action -</B> This is where you define what will happen if there is no response to the survey question. OPTIN will only send the call on to the Survey Method if the customer presses a dtmf digit. OPTOUT will send the customer on to the Survey Method even if they do not press a dtmf digit.
<BR>
<A NAME="vicidial_campaigns-survey_response_digit_map">
<BR>
<B>Survey Response Digit Map -</B> This is the section where you can define a description to go with each dtmf digit option that the customer may select.
<BR>
<A NAME="vicidial_campaigns-survey_xfer_exten">
<BR>
<B>Survey Xfer Extension -</B> If the Survey Method of EXTENSION is selected then the customer call would be directed to this dialplan extension.
<BR>
<A NAME="vicidial_campaigns-survey_camp_record_dir">
<BR>
<B>Survey Campaign Recording Directory -</B> If the Survey Method of CAMPREC_60_WAV is selected then the customer response will be recorded and placed in a directory named after the campaign inside of this directory.
<BR>
<A NAME="vicidial_campaigns-survey_third_digit">
<BR>
<B>Survey Third Digit -</B> This allows for a third call path if the Third digit as defined in this field is pressed by the customer.
<BR>
<A NAME="vicidial_campaigns-survey_fourth_digit">
<BR>
<B>Survey Fourth Digit -</B> This allows for a fourth call path if the Fourth digit as defined in this field is pressed by the customer.
<BR>
<A NAME="vicidial_campaigns-survey_third_audio_file">
<BR>
<B>Survey Third Audio File -</B> This is the third audio file to be played upon the selection by the customer of the Third Digit option.
<BR>
<A NAME="vicidial_campaigns-survey_third_status">
<BR>
<B>Survey Third Status -</B> This is the third status used for the call upon the selection by the customer of the Third Digit option.
<BR>
<A NAME="vicidial_campaigns-survey_third_exten">
<BR>
<B>Survey Third Extension -</B> This is the third extension used for the call upon the selection by the customer of the Third Digit option. Default is 8300 which immediately hangs up the call after the Audio File message is played.
<BR>
<A NAME="vicidial_campaigns-agent_display_dialable_leads">
<BR>
<B>Agent Display Dialable Leads -</B> This option if enabled will show the number of dialable leads available in the campaign in the agent screen. This number is updated in the system once a minute and will be refreshed on the agent screen every few seconds.
<BR>
<A NAME="vicidial_campaigns-survey_menu_id">
<BR>
<B>Survey Call Menu -</B> If the method is set to CALLMENU, this is the Call Menu that the customer is sent to if they opt-in.
<?php
}
?>
<BR>
<A NAME="vicidial_campaigns-next_agent_call">
<BR>
<B>Next Agent Call -</B> This determines which agent receives the next call that is available:
<BR> &nbsp; - random: orders by the random update value in the vicidial_live_agents table
<BR> &nbsp; - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall.
<BR> &nbsp; - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call.
<BR> &nbsp; - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls.
<BR> &nbsp; - campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest.
<BR> &nbsp; - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first.
<BR> &nbsp; - longest_wait_time: orders by the amount of time agent has been actively waiting for a call.
<BR>
<A NAME="vicidial_campaigns-local_call_time">
<BR>
<B>Local Call Time -</B> This is where you set during which hours you would like to dial, as determined by the local time in the are in which you are calling. This is controlled by area code and is adjusted for Daylight Savings time if applicable. General Guidelines in the USA for Business to Business is 9am to 5pm and Business to Consumer calls is 9am to 9pm.
<BR>
<A NAME="vicidial_campaigns-dial_prefix">
<BR>
<B>Dial Prefix -</B> This field allows for more easily changing a path of dialing to go out through a different method without doing a reload in Asterisk. Default is 9 based upon a 91NXXNXXXXXX in the dial plan - extensions.conf.
<BR>
<A NAME="vicidial_campaigns-manual_dial_prefix">
<BR>
<B>Manual Dial Prefix -</B> This optional field allows you to set the dial prefix to be used only when placing manual dial calls from the agent interface, such as using the MANUAL DIAL feature, or Dial Next Number when in the MANUAL dial method, or manual alt number dialing, or scheduled user-only callbacks. Default is empty for disabled, which will use the Dial Prefix defined in the field above. This option does not interfere with the 3way Dial Prefix option.
<BR>
<A NAME="vicidial_campaigns-omit_phone_code">
<BR>
<B>Omit Phone Code -</B> This field allows you to leave out the phone_code field while dialing within VICIDIAL. For instance if you are dialing in the UK from the UK you would have 44 in as your phone_code field for all leads, but you just want to dial 10 digits in your dial plan extensions.conf to place calls instead of 44 then 10 digits. Default is N.
<BR>
<A NAME="vicidial_campaigns-campaign_cid">
<BR>
<B>Campaign CallerID -</B> This field allows for the sending of a custom callerid number on the outbound calls. This is the number that would show up on the callerid of the person you are calling. The default is UNKNOWN. If you are using T1 or E1s to dial out this option is only available if you are using PRIs - ISDN T1s or E1s - that have the custom callerid feature turned on, this will not work with Robbed-bit service -RBS- circuits. This will also work through most VOIP -SIP or IAX trunks- providers that allow dynamic outbound callerID. The custom callerID only applies to calls placed for the VICIDIAL campaign directly, any 3rd party calls or transfers will not send the custom callerID. NOTE: Sometimes putting UNKNOWN or PRIVATE in the field will yield the sending of your default callerID number by your carrier with the calls. You may want to test this and put 0000000000 in the callerid field instead if you do not want to send you CallerID.
<BR>
<A NAME="vicidial_campaigns-use_custom_cid">
<BR>
<B>Custom CallerID -</B> When set to Y, this option allows you to use the security_phrase field in the vicidial_list table as the CallerID to send out when placing for each specific lead. If this field has no CID in it then the Campaign CallerID defined above will be used instead. This option will disable the list CallerID Override if there is a CID present in the security_phrase field. Default is N.
<BR>
<A NAME="vicidial_campaigns-campaign_rec_exten">
<BR>
<B>Campaign Rec extension -</B> This field allows for a custom recording extension to be used with VICIDIAL. This allows you to use different extensions depending upon how long you want to allow a maximum recording and what type of codec you want to record in. The default exten is 8309 which if you follow the SCRATCH_INSTALL examples will record in the WAV format for upto one hour. Another option included in the examples is 8310 which will record in GSM format for upto one hour.
<BR>
<A NAME="vicidial_campaigns-campaign_recording">
<BR>
<B>Campaign Recording -</B> This menu allows you to choose what level of recording is allowed on this campaign. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording. For ALLCALLS and ALLFORCE there is an option to use the Recording Delay to cut down on very short recordings and recude system load.
<BR>
<A NAME="vicidial_campaigns-campaign_rec_filename">
<BR>
<B>Campaign Rec Filename -</B> This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT VENDORLEADCODE LEADID. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max.
<BR>
<A NAME="vicidial_campaigns-allcalls_delay">
<BR>
<B>Recording Delay -</B> For ALLCALLS and ALLFORCE recording only. This setting will delay the starting of the recording on all calls for the number of seconds specified in this field. Default is 0.
<BR>
<A NAME="vicidial_campaigns-per_call_notes">
<BR>
<B>Call Notes Per Call -</B> Setting this option to ENABLED will allow agents to enter in notes for every call they handle in the agent interface. The notes entry field will appear below the Comments field in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for a lead at any time. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-agent_lead_search">
<BR>
<B>Agent Lead Search -</B> Setting this option to ENABLED will allow agents to search for leads and view lead information while paused in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for any lead that they are viewing information on. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-agent_lead_search_method">
<BR>
<B>Agent Lead Search Method -</B> If Agent Lead Search is enabled, this setting defines where the agent will be allowed to search for leads. SYSTEM will search the entire system, CAMPAIGNLISTS will search inside all of the active lists within the campaign, CAMPLISTS_ALL will search inside all of the active and inactive lists within the campaign, LIST will search only within the Manual Dial List ID as defined in the campaign. Default is CAMPLISTS_ALL. One of these options with USER_ in front will only search within leads that have the owner field matching the user ID of the agent, the options with GROUP_ in front will only search within leads that have the owner field matching the user group that the user is a member of, the options with TERRITORY_ in front will only search within leads that have the owner field matching the territories that the agent has selected.
<BR>
<A NAME="vicidial_campaigns-campaign_script">
<BR>
<B>Campaign Script -</B> This menu allows you to choose the script that will appear on the agents screen for this campaign. Select NONE to show no script for this campaign.
<BR>
<A NAME="vicidial_campaigns-get_call_launch">
<BR>
<B>Get Call Launch -</B> This menu allows you to choose whether you want to auto-launch the web-form page in a separate window, auto-switch to the SCRIPT tab or do nothing when a call is sent to the agent for this campaign. If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent.
<BR>
<A NAME="vicidial_campaigns-xferconf_a_dtmf">
<BR>
<B>Xfer-Conf DTMF -</B> These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. If you want to allow Consultative Transfers, a fronter to a closer, have the agent use the CONSULTATIVE checkbox, which does not work for third party non-ViciDial consultative calls. For those just have the agent click the Dial With Customer button. Then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER, for instance if you want to do a call to a special IVR you have set to extension 83900 you would put AXFER83900 in the number-to-dial field.
<BR>
<A NAME="vicidial_campaigns-quick_transfer_button">
<BR>
<B>Quick Transfer Button -</B> This option will add a Quick Transfer button to the agent screen below the Transfer-Conf button that will allow one click blind transferring of calls to the selected In-Group or number. IN_GROUP will send calls to the Default Xfer Group for this Campaign, or In-Group if there was an inbound call. The PRESET options will send the calls to the preset selected. Default is N for disabled. The LOCKED options are used to lock the value to the Quick Transfer Button even if the agent uses the transfer conference features during a call before using the Quick Transfer Button.
<BR>
<A NAME="vicidial_campaigns-custom_3way_button_transfer">
<BR>
<B>Custom 3-Way Button Transfer -</B> This option will add a Custom Transfer button to the agent screen below the Transfer-Conf button that will allow one click three way calls using the selected preset or field. The PRESET_ options will place calls using the defined preset value. The FIELD_ options will place calls using the number in the selected field from the lead. DISABLED will not show the button on the agent screen. The PARK_ options will park the customer before dialing. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-prepopulate_transfer_preset">
<BR>
<B>PrePopulate Transfer Preset -</B> This option will fill in the Number to Dial field in the Transfer Conference frame of the agent screen if defined. Default is N for disabled.
<BR>
<A NAME="vicidial_campaigns-enable_xfer_presets">
<BR>
<B>Enable Transfer Presets -</B> This option will enable the Presets sub menu to appear at the top of the Campaign Modification page, and also you will have the ability to specify Preset dialing numbers for Agents to use in the Transfer-Conference frame of the agent interface. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-hide_xfer_number_to_dial">
<BR>
<B>Hide Transfer Number to Dial -</B> This option will hide the Number to Dial field in the Transfer-Conference frame of the agent interface. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-ivr_park_call">
<BR>
<B>Park Call IVR -</B> This option will allow an agent to park a call with a separate IVR PARK CALL button on their agent interface if this is ENABLED or ENABLED_PARK_ONLY. The ENABLED_PARK_ONLY option will allow the agent to send the call to park but not click to retrieve the call like the ENABLED option. The ENABLED_BUTTON_HIDDEN option allows the function through the API only. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-ivr_park_call_agi">
<BR>
<B>Park Call IVR AGI -</B> If the Park Call IVR field is not DISABLED, then this field is used as the AGI application string that the customer is sent to. This is a setting that should be set by your administrator if possible.
<BR>
<A NAME="vicidial_campaigns-timer_action">
<BR>
<B>Timer Action -</B> This feature allows you to trigger actions after a certain amount of time. the D1 and D2 DIAL options will launch a call to the Transfer Conference Number presets and send them to the agent session, this is usually used for simple IVR validation AGI applications or just to play a pre-recorded message. WEBFORM will open the web form address. MESSAGE_ONLY will simply display the message that is in the field below. NONE will disable this feature and is the default. HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Call Menu specified in the Timer Action Destination field, EXTENSION will send the call to the Extension that is specified in the Timer Action Destination field, IN_GROUP will send the call to the In-Group specified in the Timer Action Destination field.
<BR>
<A NAME="vicidial_campaigns-timer_action_message">
<BR>
<B>Timer Action Message -</B> This is the message that appears on the agent screen at the time the Timer Action is triggered.
<BR>
<A NAME="vicidial_campaigns-timer_action_seconds">
<BR>
<B>Timer Action Seconds -</B> This is the amount of time after the call is connected to the customer that the Timer Action is triggered. Default is -1 which is also inactive.
<BR>
<A NAME="vicidial_campaigns-timer_action_destination">
<BR>
<B>Timer Action Destination -</B> This field is where you specify the Call Menu, Extension or In-Group that you want the call sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty.
<BR>
<A NAME="vicidial_campaigns-scheduled_callbacks">
<BR>
<B>Scheduled Callbacks -</B> This option allows an agent to disposition a call as CALLBK and choose the data and time at which the lead will be re-activated.
<BR>
<A NAME="vicidial_campaigns-scheduled_callbacks_alert">
<BR>
<B>Scheduled Callbacks Alert -</B> This option allows the callbacks status line in the agent interface to be red, blink or blink red when there are AGENTONLY scheduled callbacks that have hit their trigger time and date. Default is NONE for standard status line. The DEFER options will stop blinking and-or displaying in red when you check the callbacks, until the number of callbacks changes.
<BR>
<A NAME="vicidial_campaigns-scheduled_callbacks_count">
<BR>
<B>Scheduled Callbacks Count -</B> This option allows you to set whether only LIVE callbacks, user-only scheduled callbacks that have hit their trigger date and time, or ALL_ACTIVE callbacks, user-only callbacks that are active in the system as well as LIVE callbacks, should be3 counted int he agent callback alert section on the agent screen. Default is ALL_ACTIVE.
<BR>
<A NAME="vicidial_campaigns-callback_days_limit">
<BR>
<B>Scheduled Callbacks Days Limit -</B> This option allows you to reduce the agent scheduled callbacks calendar to a selectable number of days from today, the full 12 month calendar will still be displayed, but only the set number of days will be selectable. Default is 0 for unlimited.
<BR>
<A NAME="vicidial_campaigns-my_callback_option">
<BR>
<B>My Callbacks Checkbox Default -</B> This option allows you to pre-set the My Callback checkbox on the agent scheduled callback screen. CHECKED will check the checkbox automatically for every call. Default is UNCHECKED.
<BR>
<A NAME="vicidial_campaigns-wrapup_seconds">
<BR>
<B>Wrap Up Seconds -</B> The number of seconds to force an agent to wait before allowing them to receive or dial another call. The timer begins as soon as an agent hangs up on their customer - or in the case of alternate number dialing when the agent finishes the lead - Default is 0 seconds. If the timer runs out before the agent has dispositioned the call, the agent still will NOT move on to the next call until they select a disposition.
<BR>
<A NAME="vicidial_campaigns-wrapup_message">
<BR>
<B>Wrap Up Message -</B> This is a campaign-specific message to be displayed on the wrap up screen if wrap up seconds is set.
<BR>
<A NAME="vicidial_campaigns-disable_dispo_screen">
<BR>
<B>Disable Dispo Screen -</B> This option allows you to disable the disposition screen in the agent interface. The Disable Dispo Status field below must be filled in for this option to work. Default is DISPO_ENABLED. The DISPO_SELECT_DISABLED option will not disable the dispo screen completely, but will display the dispo screen without any dispositions, this option should only be used if you want to force your agents to use your CRM software which will send the status to the system through the API.
<BR>
<A NAME="vicidial_campaigns-disable_dispo_status">
<BR>
<B>Disable Dispo Status -</B> If the Disable Dispo Screen option is set to DISPO_DISABLED, then this field must be filled in. You can use any disposition you want for this field as long as it is 1 to 6 characters in length with only letters and numbers.
<BR>
<A NAME="vicidial_campaigns-screen_labels">
<BR>
<B>Agent Screen Labels -</B> You can select a set of agent screen labels to use with this option. Default is --SYSTEM-SETTINGS-- for the default labels.
<BR>
<A NAME="vicidial_campaigns-status_display_fields">
<BR>
<B>Status Display Fields -</B> You can select which variables for calls will be displayed in the status line of the agent screen. CALLID will display the 20 character unique call ID, LEADID will display the system lead ID, LISTID will display the list ID. Default is CALLID.
<BR>
<A NAME="vicidial_campaigns-use_internal_dnc">
<BR>
<B>Use Internal DNC List -</B> This defines whether this campaign is to filter leads against the Internal DNC list. If it is set to Y, the hopper will look for each phone number in the DNC list before placing it in the hopper. If it is in the DNC list then it will change that lead status to DNCL so it cannot be dialed. Default is N. The AREACODE option is just like the Y option, except it is used to also filter out an entire area code in North America from being dialed, in this case using the 201XXXXXXX entry in the DNC list would block all calls to the 201 areacode if enabled.
<BR>
<A NAME="vicidial_campaigns-use_campaign_dnc">
<BR>
<B>Use Campaign DNC List -</B> This defines whether this campaign is to filter leads against a DNC list that is specific to that campaign only. If it is set to Y, the hopper will look for each phone number in the campaign-specific DNC list before placing it in the hopper. If it is in the campaign-specific DNC list then it will change that lead status to DNCC so it cannot be dialed. Default is N. The AREACODE option is just like the Y option, except it is used to also filter out an entire area code in North America from being dialed, in this case using the 201XXXXXXX entry in the DNC list would block all calls to the 201 areacode if enabled.
<BR>
<A NAME="vicidial_campaigns-closer_campaigns">
<BR>
<B>Allowed Inbound Groups -</B> For CLOSER campaigns only. Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound-outbound campaigns only to select the inbound groups that are used for agents in this campaign. The calls coming into the inbound groups selected here will be counted as active calls for a blended campaign even if all agents in the campaign are not logged in to receive calls from all of those selected inbound groups.
<BR>
<A NAME="vicidial_campaigns-agent_pause_codes_active">
<BR>
<B>Agent Pause Codes Active -</B> Allows agents to select a pause code when they click on the PAUSE button in vicidial.php. Pause codes are definable per campaign at the bottom of the campaign view detail screen and they are stored in the vicidial_agent_log table. Default is N. FORCE will force the agents to choose a PAUSE code if they click on the PAUSE button.
<BR>
<A NAME="vicidial_campaigns-auto_pause_precall">
<BR>
<B>Auto Pause Pre-Call Work -</B> In auto-dial mode, this setting if enabled will set the agent to paused automatically when the agent clicks on any of the following functions that requires them to be paused- Manual Dial, Fast Dial, Lead Search, Call Log View, Callbacks Check, Enter Pause Code. Default is N for inactive.
<BR>
<A NAME="vicidial_campaigns-auto_resume_precall">
<BR>
<B>Auto Resume Pre-Call Work -</B> In auto-dial mode, this setting if enabled will set the agent to active automatically when the agent clicks out of, or cancels, on any of the following functions that requires them to be paused- Manual Dial, Fast Dial, Lead Search, Call Log View, Callbacks Check, Enter Pause Code. Default is N for inactive.
<BR>
<A NAME="vicidial_campaigns-auto_pause_precall_code">
<BR>
<B>Auto Pause Pre-Call Code -</B> If the Auto Pause Pre-Call Work function above is active, and Agent Pause Codes is active, this setting will be the pause code that is used when the agent is paused for these activities. Default is PRECAL.
<BR>
<A NAME="vicidial_campaigns-disable_alter_custdata">
<BR>
<B>Disable Alter Customer Data -</B> If set to Y, does not change any of the customer data record when an agent dispositions the call. Default is N.
<BR>
<A NAME="vicidial_campaigns-disable_alter_custphone">
<BR>
<B>Disable Alter Customer Phone -</B> If set to Y, does not change the customer phone number when an agent dispositions the call. Default is Y. Use the HIDE option to completely remove the customer phone number from the agent display.
<BR>
<A NAME="vicidial_campaigns-display_queue_count">
<BR>
<B>Agent Display Queue Count -</B> If set to Y, when a customer is waiting for an agent, the Queue Calls display at the top of the agent screen will turn red and show the number of waiting calls. Default is Y.
<BR>
<A NAME="vicidial_campaigns-manual_dial_override">
<BR>
<B>Manual Dial Override -</B> The setting can override the Users setting for manual dial ability for agents when they are logged into this campaign. NONE will follow the Users setting, ALLOW_ALL will allow any agent logged into this campaign to place manual dial calls, DISABLE_ALL will not allow anyone logged into this campaign to place manual dial calls. Default is NONE.
<BR>
<A NAME="vicidial_campaigns-manual_dial_list_id">
<BR>
<B>Manual Dial List ID -</B> The default list_id to be used when an agent placces a manual call and a new lead record is created in vicidial_list. Default is 999. This field can contain digits only.
<BR>
<A NAME="vicidial_campaigns-manual_dial_filter">
<BR>
<B>Manual Dial Filter -</B> This allows you to filter the calls that agents make in manual dial mode for this campaign by any combination of the following: DNC - to kick out, CAMPAIGNLISTS - the number must be within the lists for the campaign, NONE - no filter on manual dial or fast dial lists. CAMPLISTS_ALL - will include inactive lists in the search for the number.
<BR>
<A NAME="vicidial_campaigns-manual_preview_dial">
<BR>
<B>Manual Preview Dial -</B> This allows the agent in manual dial mode to see the lead information when they click Dial Next Number before they actively dial the phone call. There is an optional link to SKIP the lead and move on to the next one if selected. Default is PREVIEW_AND_SKIP.
<BR>
<A NAME="vicidial_campaigns-api_manual_dial">
<BR>
<B>Manual Dial API -</B> This option allows you to set the Agent API to make either one call at a time, STANDARD, or the ability to queue up manual dial calls and have them dial automatically once the agent goes on pause or is available to take their next call with the option to disable the automatic dialing of these calls, QUEUE, or QUEUE_AND_AUTOCALL which is the same as QUEUE but without the option to disable the automatic dialing of these calls. If an agent has more than one call queued up for them they will see the count of how many manual dial calls are in queue right below the Pause button, or Dial Next Number button. We suggest that if QUEUE is used that you send API actions using the preview=YES option so you are not repeatedly dialing calls for the agent without notice. Also, if using QUEUE and heavily using manual dial calls in a non MANUAL dial method, we would recommend setting the Agent Pause After Each Call option to Y. Default is STANDARD.
<BR>
<A NAME="vicidial_campaigns-manual_dial_call_time_check">
<BR>
<B>Manual Call Time Check -</B> If this option is enabled, it will check all manual dial calls to make sure they are within the call time settings set for the campaign. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-manual_dial_cid">
<BR>
<B>Manual Dial CID -</B> This defines whether an agent making manual dial calls will have the campaign callerID settings used, or their agent phone callerID settings used. Default is CAMPAIGN. If the Use Custom CID campaign option is enabled or the list Campaign CID Override setting is used, this setting will be ignored.
<BR>
<A NAME="vicidial_campaigns-post_phone_time_diff_alert">
<BR>
<B>Phone Post Time Difference Alert -</B> This manual-dial-only feature, if enabled, will display an alert if the time zone for the lead postal code, or zip code, is different from the time zone of the area code of the phone number for the lead. The OUTSIDE_CALLTIME_ONLY option will only show the alert if the two time zones are different and one of the time zones is outside of the call time selected for the campaign. OUTSIDE_CALLTIME_PHONE will only check the time zone of the phone number of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_POSTAL will only check the time zone of the postal code of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_BOTH will check the postal code and phone number for being within the local call time, even if they are in the same time zone. These alerts will show in the call log info, callbacks list info, search results info, when a lead is dialed and when a lead is previewed. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-agent_clipboard_copy">
<BR>
<B>Agent Screen Clipboard Copy -</B> THIS FEATURE IS CURRENTLY ONLY ENABLED FOR INTERNET EXPLORER. This feature allows you to select a field that will be copied to the computer clipboard of the agent computer upon a call being sent to an agent. Common uses for this are to allow for easy pasting of account numbers or phone numbers into legacy client applications on the agent computer.
<BR>
<A NAME="vicidial_campaigns-three_way_call_cid">
<BR>
<B>3-Way Call Outbound CallerID -</B> This defines what is sent out as the outbound callerID number from 3-way calls placed by the agent, CAMPAIGN uses the custom campaign callerID, CUSTOMER uses the number of the customer that is active on the agents screen and AGENT_PHONE uses the callerID for the phone that the agent is logged into. AGENT_CHOOSE allows the agent to choose which callerID to use for 3-way calls from a list of choices. CUSTOM_CID will use the Custom CID that is defined in the security_phrase field of the vicidial_list table for the lead.
<BR>
<A NAME="vicidial_campaigns-three_way_dial_prefix">
<BR>
<B>3-Way Call Dial Prefix -</B> This defines what is used as the dial prefix for 3-way calls, default is empty so the campaign dial prefix is used, passthru so you can hear ringing is 88.
<BR>
<A NAME="vicidial_campaigns-customer_3way_hangup_logging">
<BR>
<B>Customer 3-Way Hangup Logging -</B> If this option is ENABLED the user_call_log will log when a customer hangup up if they hang up during a 3-way call. Also, this can allow for the Customer 3-way hangup action if one is defineed below. Default is ENABLED.
<BR>
<A NAME="vicidial_campaigns-customer_3way_hangup_seconds">
<BR>
<B>Customer 3-Way Hangup Seconds -</B> If Customer 3-way logging is enabled, this option allows you to define the number of seconds after the customer hangup is detected before it is actually logged and the optional customer 3-way hangup action is executed. Default is 5 seconds.
<BR>
<A NAME="vicidial_campaigns-customer_3way_hangup_action">
<BR>
<B>Customer 3-Way Hangup Action -</B> If Customer 3-way logging is enabled, this option allows you to have the agent screen automatically hang up on the call and go to the DISPO screen if this option is set to DISPO. Default is NONE.
<?php
if ($SSqc_features_active > 0)
{
?>
<BR>
<A NAME="vicidial_campaigns-qc_enabled">
<BR>
<B>QC Enabled -</B> Setting this field to Y allows for the agent Quality Control features to work. Default is N.
<BR>
<A NAME="vicidial_campaigns-qc_statuses">
<BR>
<B>QC Statuses -</B> This area is where you select which statuses of leads should be gone over by the QC system. Place a check next to the status that you want QC to review.
<BR>
<A NAME="vicidial_campaigns-qc_shift_id">
<BR>
<B>QC Shift -</B> This is the shift timeframe used to pull QC records for a campaign. The days of the week are ignored for these functions.
<BR>
<A NAME="vicidial_campaigns-qc_get_record_launch">
<BR>
<B>QC Get Record Launch-</B> This allows one of the following actions to be triggered upon a QC agent receiving a new record.
<BR>
<A NAME="vicidial_campaigns-qc_show_recording">
<BR>
<B>QC Show Recording -</B> This allows for a recording that may be linked with the QC record to be display in the QC agent screen.
<BR>
<A NAME="vicidial_campaigns-qc_web_form_address">
<BR>
<B>QC WebForm Address -</B> This is the website address that a QC agent can go to when clicking on the WEBFORM link in the QC screen.
<BR>
<A NAME="vicidial_campaigns-qc_script">
<BR>
<B>QC Script -</B> This is the script that can be used by QC agents in the SCRIPT tab in the QC screen.
<?php
}
?>
<BR>
<A NAME="vicidial_campaigns-vtiger_search_category">
<BR>
<B>Vtiger Search Category -</B> If Vtiger integration is enabled in the system settings then this setting will define where the vtiger_search.php page will search for the phone number that was entered. There are 4 options that can be used in this field: LEAD- This option will search through the Vtiger leads only, ACCOUNT- This option will search through the Vtiger accounts and all contacts and sub-contacts for the phone number, VENDOR- This option will only search through the Vtiger vendors, ACCTID- This option works only for accounts and it will take the vicidial vendor_lead_code field and try to search for the Vtiger account ID. If unsuccessful it will try any other methods listed that you have selected. Multiple options can be used for each search, but on large databases this is not recommended. Default is LEAD. UNIFIED_CONTACT- This option will use the beta Vtiger 5.1.0 feature to search by phone number and bring up a search page in Vtiger.
<BR>
<A NAME="vicidial_campaigns-vtiger_search_dead">
<BR>
<B>Vtiger Search Dead Accounts -</B> If Vtiger integration is enabled in the system settings then this setting will define whether deleted accounts will be searched when the agent clicks WEB FORM to search in the Vtiger system. DISABLED- deleted leads will not be searched, ASK- deleted leads will be searched and the vtiger search web page will ask the agent if they want to make the Vtiger account active, RESURRECT- will automatically make the deleted account active again and will take the agent to the account screen without delay upon clicking on WEB FORM. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-vtiger_create_call_record">
<BR>
<B>Vtiger Create Call Record -</B> If Vtiger integration is enabled in the system settings then this setting will define whether a new Vtiger activity record is created for the call when the agent goes to the vtiger_search page. Default is Y. The DISPO option will create a call record for the Vtiger account without the agent needing to go to the vtiger search page through the WEB FORM.
<BR>
<A NAME="vicidial_campaigns-vtiger_create_lead_record">
<BR>
<B>Vtiger Create Lead Record -</B> If Vtiger integration is enabled in the system settings and Vtiger Search Category includes LEAD then this setting will define whether a new Vtiger lead record is created when the agent goes to the vtiger_search page and no record is found to have the call phone number. Default is Y.
<BR>
<A NAME="vicidial_campaigns-vtiger_screen_login">
<BR>
<B>Vtiger Screen Login -</B> If Vtiger integration is enabled in the system settings then this setting will define whether the user is logged into the Vtiger interface automatically when they login to VICIDIAL. Default is Y. The NEW_WINDOW option will open a new window upon login to the VICIDIAL agent screen.
<BR>
<A NAME="vicidial_campaigns-vtiger_status_call">
<BR>
<B>Vtiger Status Call -</B> If Vtiger integration is enabled in the system settings then this setting will define whether the status of the Vtiger Account will be updated with the status of the VICIDIAL call after it has been dispositioned. Default is N.
<BR>
<A NAME="vicidial_campaigns-queuemetrics_callstatus">
<BR>
<B>QM CallStatus Override -</B> If QueueMetrics integration is enabled in the system settings then this setting allow the overriding of the System Settings setting for CallStatus queue_log entries. Default is DISABLED which will use the system setting.
<BR>
<A NAME="vicidial_campaigns-queuemetrics_phone_environment">
<BR>
<B>QM Phone Environment -</B> If QueueMetrics integration is enabled in the system settings then this setting allow the insertion of this data value in the data4 field of the queue_log for agent activity records. Default is empty for disabled.
<BR>
<A NAME="vicidial_campaigns-extension_appended_cidname">
<BR>
<B>Extension Append CID -</B> If enabled, the calls placed from this campaign will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled.
<BR>
<A NAME="vicidial_campaigns-crm_popup_login">
<BR>
<B>CRM Popup Login -</B> If set to Y, the CRM Popup Address is used to open a new window on agent login to this campaign. Default is N.
<BR>
<A NAME="vicidial_campaigns-crm_login_address">
<BR>
<B>CRM Popup Address -</B> The web address of a CRM login page, it can have variables populated just like the web form address, with the VAR in the front and using --A--user_custom_one--B-- to define variables.
<BR>
<A NAME="vicidial_campaigns-start_call_url">
<BR>
<B>Start Call URL -</B> This web URL address is not seen by the agent, but it is called every time a call is sent to an agent if it is populated. Uses the same variables as the web form fields and scripts. This URL can NOT be a relative path. The Start URL does not work for Manual dial calls. Default is blank.
<BR>
<A NAME="vicidial_campaigns-dispo_call_url">
<BR>
<B>Dispo Call URL -</B> This web URL address is not seen by the agent, but it is called every time a call is dispositioned by an agent if it is populated. Uses the same variables as the web form fields and scripts. dispo and talk_time are the variables you can use to retrieve the agent-defined disposition for the call and the actual talk time in seconds of the call. This URL can NOT be a relative path. Default is blank.
<BR>
<A NAME="vicidial_campaigns-agent_allow_group_alias">
<BR>
<B>Group Alias Allowed -</B> If you want to allow your agents to use group aliases then you need to set this to Y. Group Aliases are explained more in the Admin section, they allow agents to select different callerIDs for outbound manual calls that they may place. Default is N.
<BR>
<A NAME="vicidial_campaigns-default_group_alias">
<BR>
<B>Default Group Alias -</B> If you have allowed Group Aliases then this is the group alias that is selected first by default when the agent chooses to use a Group Alias for an outbound manual call. Default is NONE or empty.
<BR>
<A NAME="vicidial_campaigns-view_calls_in_queue">
<BR>
<B>Agent View Calls in Queue -</B> If set to anything but NONE, agents will be able to see details about the calls that are waiting in queue in their agent screen. If set to a number value, the calls displayed will be limited to the number selected. Default is NONE.
<BR>
<A NAME="vicidial_campaigns-view_calls_in_queue_launch">
<BR>
<B>View Calls in Queue Launch -</B> This setting if set to AUTO will have the Calls in Queue frame show up upon login by the agent into the agent screen. Default is MANUAL.
<BR>
<A NAME="vicidial_campaigns-grab_calls_in_queue">
<BR>
<B>Agent Grab Calls in Queue -</B> This option if set to Y will allow the agent to select the call that they want to take from the Calls in Queue display by clicking on it while paused. Agents will only be able to grab inbound calls or transferred calls, not outbound calls. Default is N.
<BR>
<A NAME="vicidial_campaigns-call_requeue_button">
<BR>
<B>Agent Call Re-Queue Button -</B> This option if set to Y will add a Re-Queue Customer button to the agent screen, allowing the agent to send the call into an AGENTDIRECT queue that is reserved for the agent only. Default is N.
<BR>
<A NAME="vicidial_campaigns-pause_after_each_call">
<BR>
<B>Agent Pause After Each Call -</B> This option if set to Y will pause the agent after every call automatically. Default is N.
<BR>
<A NAME="vicidial_campaigns-blind_monitor_warning">
<BR>
<B>Blind Monitor Warning -</B> This option if enabled will let the agent know in various optional ways if they are being blind monitored by someone. DISABLED means this feature is not active, ALERT will only pop an alert up on the agent screen, NOTICE will post a note that stays up on the agent screen as long as theya re being monitored, AUDIO will play the filename defined below when an agent is starting to be monitored and the other options are combibnations of the above options. Default is DISABLED.
<BR>
<A NAME="vicidial_campaigns-blind_monitor_message">
<BR>
<B>Blind Monitor Notice -</B> This is the message that will show on the agent screen while they are being monitored if the NOTICE option is selected. Default is -Someone is blind monitoring your session-.
<BR>
<A NAME="vicidial_campaigns-blind_monitor_filename">
<BR>
<B>Blind Monitor Filename -</B> This is the audio file that will play in the agents session at the start of someone blind monitoring them. This prompt will be played for everyone in the session including the customer if any is present. Default is empty.
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_LISTS TABLE</FONT></B><BR><BR>
<A NAME="vicidial_lists-list_id">
<BR>
<B>List ID -</B> This is the numerical name of the list, it is not editable after initial submission, must contain only numbers and must be between 2 and 8 characters in length. Must be a number greater than 100.
<BR>
<A NAME="vicidial_lists-list_name">
<BR>
<B>List Name -</B> This is the description of the list, it must be between 2 and 20 characters in length.
<BR>
<A NAME="vicidial_lists-list_description">
<BR>
<B>List Description -</B> This is the memo field for the list, it is optional.
<BR>
<A NAME="vicidial_lists-list_changedate">
<BR>
<B>List Change Date -</B> This is the last time that the settings for this list were modified in any way.
<BR>
<A NAME="vicidial_lists-list_lastcalldate">
<BR>
<B>List Last Call Date -</B> This is the last time that lead was dialed from this list.
<BR>
<A NAME="vicidial_lists-campaign_id">
<BR>
<B>Campaign -</B> This is the campaign that this list belongs to. A list can only be dialed on a single campaign at one time.
<BR>
<A NAME="vicidial_lists-active">
<BR>
<B>Active -</B> This defines whether the list is to be dialed on or not.
<BR>
<A NAME="vicidial_lists-reset_list">
<BR>
<B>Reset Lead-Called-Status for this list -</B> This resets all leads in this list to N for "not called since last reset" and means that any lead can now be called if it is the right status as defined in the campaign screen.
<BR>
<A NAME="vicidial_lists-reset_time">
<BR>
<B>Reset Times -</B> This field allows you to put times in, separated by a dash-, that this list will be automatically reset by the system. The times must be in 24 hour format with no punctuation, for example 0800-1700 would reset the list at 8AM and 5PM every day. Default is empty.
<BR>
<A NAME="vicidial_lists-agent_script_override">
<BR>
<B>Agent Script Override -</B> If this field is set, this will be the script that the agent sees on their screen instead of the campaign script when the lead is from this list. Default is not set.
<BR>
<A NAME="vicidial_lists-campaign_cid_override">
<BR>
<B>Campaign CID Override -</B> If this field is set, this will override the campaign CallerID that is set for calls that are placed to leads in this list. Default is not set.
<BR>
<A NAME="vicidial_lists-am_message_exten_override">
<BR>
<B>Answering Machine Message Override -</B> If this field is set, this will override the Answering Machine Message set in the campaign for customers in this list. Default is not set.
<BR>
<A NAME="vicidial_lists-drop_inbound_group_override">
<BR>
<B>Drop Inbound Group Override -</B> If this field is set, this in-group will be used for outbound calls within this list that drop from the outbound campaign instead of the drop in-group set in the campaign detail screen. Default is not set.
<BR>
<A NAME="vicidial_lists-web_form_address">
<BR>
<B>Web Form Override -</B> This is the custom address that clicking on the WEB FORM button in VICIDIAL will take you to for calls that come in on this list. If you want to use custom fields in a web form address, you need to add &CF_uses_custom_fields=Y as part of your URL.
<BR>
<A NAME="vicidial_lists-xferconf_a_dtmf">
<BR>
<B>Xfer-Conf Number Override -</B> These five fields allow for you to override the Transfer Conference number presets when the lead is from this list. Default is blank.
<BR>
<A NAME="vicidial_lists-time_zone_setting">
<BR>
<B>Time Zone Setting -</B> This option allows you to set the method of maintaining the current time zone lookup for the leads within this list. This process is only done at night so any changes you make will not be immediate. COUNTRY_AND_AREA_CODE is the default, and will use the country code and area code of the phone number to determine the time zone of the lead. POSTAL_CODE will use the postal code if available to determine the time zone of the lead. NANPA_PREFIX works only in the USA and will use the area code and prefix of the phone number to determine the time zone of the lead, but this is not enabled by default in the system, so please be sure you have the NANPA prefix data loaded onto your system before selecting this option. OWNER_TIME_ZONE_CODE will use the standard time zone abbraviation loaded into the owner field of the lead to determine the time zone, in the USA examples are AST, EST, CST, MST, PST, AKST, HST. This feature must be enabled by your system administrator to go into effect.
<BR>
<A NAME="vicidial_list-dnc">
<BR>
<B>VICIDIAL DNC List -</B> This Do Not Call list contains every lead that has been set to a status of DNC in the system. Through the LISTS - ADD NUMBER TO DNC page you are able to manually add numbers to this list so that they will not be called by campaigns that use the internal DNC list. There is also the option to add leads to the campaign-specific DNC lists for those campaigns that have them. If you have the active DNC option set to AREACODE then you can also use area code wildcard entries like this 201XXXXXXX to block all calls to the 201 areacode when enabled.
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_INBOUND_GROUPS TABLE</FONT></B><BR><BR>
<A NAME="vicidial_inbound_groups-group_id">
<BR>
<B>Group ID -</B> This is the short name of the inbound group, it is not editable after initial submission, must not contain any spaces and must be between 2 and 20 characters in length.
<BR>
<A NAME="vicidial_inbound_groups-group_name">
<BR>
<B>Group Name -</B> This is the description of the group, it must be between 2 and 30 characters in length. Cannot include dashes, plusses or spaces .
<BR>
<A NAME="vicidial_inbound_groups-group_color">
<BR>
<B>Group Color -</B> This is the color that displays in the VICIDIAL client app when a call comes in on this group. It must be between 2 and 7 characters long. If this is a hex color definition you must remember to put a # at the beginning of the string or VICIDIAL will not work properly.
<BR>
<A NAME="vicidial_inbound_groups-active">
<BR>
<B>Active -</B> This determines whether this group show up in the selection box when a VICIDIAL agent logs in.
<BR>
<A NAME="vicidial_inbound_groups-web_form_address">
<BR>
<B>Web Form -</B> This is the custom address that clicking on the WEB FORM button in VICIDIAL will take you to for calls that come in on this group. If you want to use custom fields in a web form address, you need to add &CF_uses_custom_fields=Y as part of your URL.
<BR>
<A NAME="vicidial_inbound_groups-next_agent_call">
<BR>
<B>Next Agent Call -</B> This determines which agent receives the next call that is available:
<BR> &nbsp; - random: orders by the random update value in the vicidial_live_agents table
<BR> &nbsp; - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall.
<BR> &nbsp; - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call.
<BR> &nbsp; - oldest_inbound_call_start: orders by the last time an agent was sent an inbound call. Results in agents receiving about the same number of calls overall.
<BR> &nbsp; - oldest_inbound_call_finish: orders by the last time an agent finished an inbound call. AKA agent waiting longest receives first call.
<BR> &nbsp; - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls.
<BR> &nbsp; - inbound_group_rank: orders by the rank given to the agent for the specific inbound group. Highest to Lowest.
<BR> &nbsp; - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first.
<BR> &nbsp; - campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest.
<BR> &nbsp; - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first.
<BR> &nbsp; - longest_wait_time: orders by the amount of time agent has been actively waiting for a call.
<BR> &nbsp; - ring_all: rings all available agents until one picks up the phone.
<BR> NOTES: For ring_all, the agents that are using phones that have On Hook Agent enabled will have their phones ring and the first one to answer will receive the call and the information on the agent screen. Since ring_all ignores agent wait time and ranking and will call every agent that is available for the queue, we do not recommend using this method for large queues. When using ring_all, agents logged with phones that have the On Hook Agent disabled will have to use the Calls In Queue panel and click on the TAKE CALL link to take calls in queue. The amount of time the agents phone will ring for ring_all is set to the On-Hook Ring Time setting or the shortest ring time of the phones that will be called. We do not recommend using ring_all on high call volume queues, or queues with many agents. The ring_all method is intended to be used with only a few agents and on low call volume in-groups.
<BR>
<BR>
<A NAME="vicidial_inbound_groups-on_hook_ring_time">
<BR>
<B>On-Hook Ring Time -</B> This option is only used for agents that are logged in with phones that have the agent-on-hook feature enabled. This is the number of seconds that each call attempt to the agent will ring for until the system will wait one second and start ringing the available agent phones again. This field can be overridden if the agent phones are set to a lower ring time which may be necessary to prevent calls from being sent one phones voicemail. Default is 15.
<BR>
<A NAME="vicidial_inbound_groups-queue_priority">
<BR>
<B>Queue Priority -</B> This setting is used to define the order in which the calls from this inbound group should be answered in relation to calls from other inbound groups.
<A NAME="vicidial_inbound_groups-fronter_display">
<BR>
<B>Fronter Display -</B> This field determines whether the inbound VICIDIAL agent would have the fronter name - if there is one - displayed in the Status field when the call comes to the agent.
<BR>
<A NAME="vicidial_inbound_groups-ingroup_script">
<BR>
<B>Campaign Script -</B> This menu allows you to choose the script that will appear on the agents screen for this campaign. Select NONE to show no script for this campaign.
<BR>
<A NAME="vicidial_inbound_groups-ignore_list_script_override">
<BR>
<B>Ignore List Script Override-</B> This option allows you to ignore the list ID Script Override option for calls coming into this In-Group. Setting this to Y will ignore any List ID script settings. Default is N.
<BR>
<A NAME="vicidial_inbound_groups-get_call_launch">
<BR>
<B>Get Call Launch -</B> This menu allows you to choose whether you want to auto-launch the web-form page in a separate window, auto-switch to the SCRIPT tab or do nothing when a call is sent to the agent for this campaign. If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent.
<BR>
<A NAME="vicidial_inbound_groups-xferconf_a_dtmf">
<BR>
<B>Xfer-Conf DTMF -</B> These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. If you want to allow Consultative Transfers, a fronter to a closer, have the agent use the CONSULTATIVE checkbox, which does not work for third party non-ViciDial consultative calls. For those just have the agent click the Dial With Customer button. Then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER, for instance if you want to do a call to a special IVR you have set to extension 83900 you would put AXFER83900 in the number-to-dial field.
<BR>
<A NAME="vicidial_inbound_groups-timer_action">
<BR>
<B>Timer Action -</B> This feature allows you to trigger actions after a certain amount of time. the D1 and D2 DIAL options will launch a call to the Transfer Conference Number presets and send them to the agent session, this is usually used for simple IVR validation AGI applications or just to play a pre-recorded message. WEBFORM will open the web form address. MESSAGE_ONLY will simply display the message that is in the field below. NONE will disable this feature and is the default. This setting will override the Campaign settings. HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Call Menu specified in the Timer Action Destination field, EXTENSION will send the call to the Extension that is specified in the Timer Action Destination field, IN_GROUP will send the call to the In-Group specified in the Timer Action Destination field.
<BR>
<A NAME="vicidial_inbound_groups-timer_action_message">
<BR>
<B>Timer Action Message -</B> This is the message that appears on the agent screen at the time the Timer Action is triggered.
<BR>
<A NAME="vicidial_inbound_groups-timer_action_seconds">
<BR>
<B>Timer Action Seconds -</B> This is the amount of time after the call is connected to the customer that the Timer Action is triggered. Default is -1 which is also inactive.
<BR>
<A NAME="vicidial_inbound_groups-timer_action_destination">
<BR>
<B>Timer Action Destination -</B> This field is where you specify the Call Menu, Extension or In-Group that you want the call sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty.
<BR>
<A NAME="vicidial_inbound_groups-drop_call_seconds">
<BR>
<B>Drop Call Seconds -</B> The number of seconds a call will stay in queue before being considered a DROP.
<BR>
<A NAME="vicidial_inbound_groups-drop_action">
<BR>
<B>Drop Action -</B> This menu allows you to choose what happens to a call when it has been waiting for longer than what is set in the Drop Call Seconds field. HANGUP will simply hang up the call, MESSAGE will send the call the Drop Exten that you have defined below, VOICEMAIL will send the call to the voicemail box that you have defined below and IN_GROUP will send the call to the Inbound Group that is defined below.
<BR>
<A NAME="vicidial_inbound_groups-drop_exten">
<BR>
<B>Drop Exten -</B> If Drop Action is set to MESSAGE, this is the dial plan extension that the call will be sent to if it reaches Drop Call Seconds. For AGENTDIRECT in-groups, if the user is unavailable, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number.
<BR>
<A NAME="vicidial_inbound_groups-voicemail_ext">
<BR>
<B>Voicemail -</B> If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use.
<BR>
<A NAME="vicidial_inbound_groups-drop_inbound_group">
<BR>
<B>Drop Transfer Group -</B> If Drop Action is set to IN_GROUP, the call will be sent to this inbound group if it reaches Drop Call Seconds.
<BR>
<A NAME="vicidial_inbound_groups-call_time_id">
<BR>
<B>Call Time -</B> This is the call time scheme to use for this inbound group. Keep in mind that the time is based on the server time. Default is 24hours.
<BR>
<A NAME="vicidial_inbound_groups-after_hours_action">
<BR>
<B>After Hours Action -</B> The action to perform if it is after hours as defined in the call time for this inbound group. HANGUP will immediately hangup the call, MESSASGE will play the file in the After Hours Message Filenam field, EXTENSION will send the call to the After Hours Extension in the dialplan and VOICEMAIL will send the call to the voicemail box listed in the After Hours Voicemail field, IN_GROUP will send the call to the inbound group selected in the After Hours Transfer Group select list. Default is MESSAGE.
<BR>
<A NAME="vicidial_inbound_groups-after_hours_message_filename">
<BR>
<B>After Hours Message Filename -</B> The audio file located on the server to be played if the Action is set to MESSAGE. Default is vm-goodbye
<BR>
<A NAME="vicidial_inbound_groups-after_hours_exten">
<BR>
<B>After Hours Extension -</B> The dialplan extension to send the call to if the Action is set to EXTENSION. Default is 8300. For AGENTDIRECT in-groups, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number.
<BR>
<A NAME="vicidial_inbound_groups-after_hours_voicemail">
<BR>
<B>After Hours Voicemail -</B> The voicemail box to send the call to if the Action is set to VOICEMAIL. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use.
<BR>
<A NAME="vicidial_inbound_groups-afterhours_xfer_group">
<BR>
<B>After Hours Transfer Group -</B> If After Hours Action is set to IN_GROUP, the call will be sent to this inbound group if it enters the in-group outside of the call time scheme defined for the in-group.
<BR>
<A NAME="vicidial_inbound_groups-no_agent_no_queue">
<BR>
<B>No Agents No Queueing -</B> If this field is set to Y or NO_PAUSED then no calls will be put into the queue for this in-group if there are no agents logged in and the calls will go to the No Agent No Queue Action. The NO_PAUSED option will also not send the callers into the queue if there are only paused agents in the in-group. Default is N. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use. You can also put AGENTEXT in this field if it is set to EXTENSION and the system will look up the user custom five field and send the call to that dialplan number.
<BR>
<A NAME="vicidial_inbound_groups-no_agent_action">
<BR>
<B>No Agent No Queue Action -</B> If No Agent No Queue is enabled, then this field defines where the call will go if there are no agents in the In-Group. Default is MESSAGE, this plays the sound files in the Action Value field and then hangs up.
<BR>
<A NAME="vicidial_inbound_groups-no_agent_action_value">
<BR>
<B>No Agent No Queue Action Value -</B> This is the value for the Action above. Default is nbdy-avail-to-take-call|vm-goodbye.
<BR>
<A NAME="vicidial_inbound_groups-welcome_message_filename">
<BR>
<B>Welcome Message Filename -</B> The audio file located on the server to be played when the call comes in. If set to ---NONE--- then no message will be played. Default is ---NONE---. This field as with the other audio fields in In-Groups, with the exception of the Agent Alert Filename, can have multiple audio files played if you put a pipe-separated list of audio files into the field.
<BR>
<A NAME="vicidial_inbound_groups-play_welcome_message">
<BR>
<B>Play Welcome Message -</B> These settings select when to play the defined welcome message, ALWAYS will play it every time, NEVER will never play it, IF_WAIT_ONLY will only play the welcome message if the call does not immediately go to an agent, and YES_UNLESS_NODELAY will always play the welcome message unless the NO_DELAY setting is enabled. Default is ALWAYS.
<BR>
<A NAME="vicidial_inbound_groups-moh_context">
<BR>
<B>Music On Hold Context -</B> The music on hold context to use when the customer is placed on hold. Default is default.
<BR>
<A NAME="vicidial_inbound_groups-onhold_prompt_filename">
<BR>
<B>On Hold Prompt Filename -</B> The audio file located on the server to be played at a regular interval when the customer is on hold. Default is generic_hold. This audio file MUST be 9 seconds or less in length.
<BR>
<A NAME="vicidial_inbound_groups-prompt_interval">
<BR>
<B>On Hold Prompt Interval -</B> The length of time in seconds to wait before playing the on hold prompt. Default is 60. To disable the On Hold Prompt, set the interval to 0.
<BR>
<A NAME="vicidial_inbound_groups-onhold_prompt_no_block">
<BR>
<B>On Hold Prompt No Block -</B> Setting this option to Y will allow calls in line behind a call where the on hold prompt is playing to go to an agent if one becomes available while the message is playing. While the On Hold Prompt Filename message is playing to a customer they cannot be sent to an agent. Default is N.
<BR>
<A NAME="vicidial_inbound_groups-onhold_prompt_seconds">
<BR>
<B>On Hold Prompt Seconds -</B> This field needs to be set to the number of seconds that the On Hold Prompt Filename plays for. Default is 10.
<BR>
<A NAME="vicidial_inbound_groups-play_place_in_line">
<BR>
<B>Play Place in Line -</B> This defines whether the caller will hear their place in line when they enter the queue as well as when they hear the announcemend. Default is N.
<BR>
<A NAME="vicidial_inbound_groups-play_estimate_hold_time">
<BR>
<B>Play Estimated Hold Time -</B> This defines whether the caller will hear the estimated hold time before they are transferred to an agent. Default is N. If the customer is on hold and hears this estimated hold time message, the minimum time that will be played is 15 seconds.
<BR>
<A NAME="vicidial_inbound_groups-calculate_estimated_hold_seconds">
<BR>
<B>Calculate Estimated Hold Seconds -</B> This defines the number of seconds into the queue that the customer will wait before the Estimated Hold Time will be calculated and optionally played. Minimum is 3 seconds, even if set lower than 3. Default is 0.
<BR>
<A NAME="vicidial_inbound_groups-eht_minimum_prompt_filename">
<BR>
<B>Estimated Hold Time Minimum Filename -</B> If the Estimated Hold Time is active and it is calculated to be at or below the minimum of 15 seconds, then this prompt file will be played instead of the default announcement. Default is Empty for inactive.
<BR>
<A NAME="vicidial_inbound_groups-eht_minimum_prompt_no_block">
<BR>
<B>Estimated Hold Time Minimum Prompt No Block -</B> If Estimated Hold Time is active and the Estimated Hold Time Minimum Filename field above is filled-in, then this option to allow calls in line behind a call where the prompt is playing to go to an agent if one becomes available while the message is playing. While the prompt is playing to a customer they cannot be sent to an agent. Default is N.
<BR>
<A NAME="vicidial_inbound_groups-eht_minimum_prompt_seconds">
<BR>
<B>Estimated Hold Time Minimum Prompt Seconds -</B> This field needs to be set to the number of seconds that the Estimated Hold Time Minimum Filename prompt plays for. Default is 10.
<BR>
<A NAME="vicidial_inbound_groups-wait_time_option">
<BR>
<B>Wait Time Option -</B> This allows you to give customers options to leave the queue if their wait time is over the amount of seconds specified below. Default is NONE. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option. The PRESS_STAY option will send the customer back to the queue without loosing their place in line.
<BR>
<A NAME="vicidial_inbound_groups-wait_time_second_option">
<BR>
<B>Wait Time Second Option -</B> Same as the first Wait Time Option field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Wait Time Option is selected then this option will not be offered.
<BR>
<A NAME="vicidial_inbound_groups-wait_time_third_option">
<BR>
<B>Wait Time Third Option -</B> Same as the first Wait Time Option field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Wait Time Option is selected then this option will not be offered.
<BR>
<A NAME="vicidial_inbound_groups-wait_time_option_seconds">
<BR>
<B>Wait Time Option Seconds -</B> If Wait Time Option is set to anything but NONE, this is the number of seconds that the customer has been waiting in queue that will trigger the wait time options. Default is 120 seconds.
<BR>
<A NAME="vicidial_inbound_groups-wait_time_option_exten">
<BR>
<B>Wait Time Option Extension -</B> If Wait Time Option is set to PRESS_EXTEN, this is the dialplan extension that the call will be sent to if the customer presses the option key when presented with the option. For AGENTDIRECT in-groups, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number.
<BR>
<A NAME="vicidial_inbound_groups-wait_time_option_callmenu">
<BR>
<B>Wait Time Option Callmenu -</B> If Wait Time Option is set to PRESS_CALLMENU, this is the Call Menu that the call will be sent to if the customer presses the option key when presented with the option.
<BR>
<A NAME="vicidial_inbound_groups-wait_time_option_voicemail">
<BR>
<B>Wait Time Option Voicemail -</B> If Wait Time Option is set to PRESS_VMAIL, this is the voicemail box that the call will be sent to if the customer presses the option key when presented with the option. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use.
<BR>
<A NAME="vicidial_inbound_groups-wait_time_option_xfer_group">
<BR>
<B>Wait Time Option Transfer In-Group -</B> If Wait Time Option is set to PRESS_INGROUP, this is the inbound group that the call will be sent to if the customer presses the option key when presented with the option.
<BR>
<A NAME="vicidial_inbound_groups-wait_time_option_press_filename">
<BR>
<B>Wait Time Option Press Filename -</B> If Wait Time Option is set to one of the PRESS_ options, this is the filename prompt that is played if the customer wait time exceeds the Wait Time Option Seconds to give the customer the option to press 1, 2 or 3 on their phone to run the selected Wait Time Press options. It is very important that you include options in the audio file for all of your selected Wait Time Options, and that the audio file length in seconds is properly defined in the Filename Seconds field below or there will be problems. Default is to-be-called-back.
<BR>
<A NAME="vicidial_inbound_groups-wait_time_option_no_block">
<BR>
<B>Wait Time Option Press No Block -</B> Setting this option to Y will allow calls in line behind a call where the Wait Time Option Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Wait Time Option Press Filename message is playing to a customer they cannot be sent to an agent. Default is N.
<BR>
<A NAME="vicidial_inbound_groups-wait_time_option_prompt_seconds">
<BR>
<B>Wait Time Option Press Filename Seconds -</B> This field needs to be set to the number of seconds that the Wait Time Option Press Filename plays for. Default is 10.
<BR>
<A NAME="vicidial_inbound_groups-wait_time_option_callback_filename">
<BR>
<B>Wait Time Option After Press Filename -</B> If Wait Time Option is set to one of the PRESS_ options, this is the filename prompt that is played after the customer has pressed 1, 2 or 3.
<BR>
<A NAME="vicidial_inbound_groups-wait_time_option_callback_list_id">
<BR>
<B>Wait Time Option Callback List ID -</B> If Wait Time Option is set to PRESS_CID_CALLBACK, this is the List ID the call is added to as a new lead if the customer presses the option key when presented with the option.
<BR>
<A NAME="vicidial_inbound_groups-wait_hold_option_priority">
<BR>
<B>Wait Hold Option Priority -</B> If both Estimated Hold Time options and Wait Time options are active, this setting will define whether one, the other or both of these features are active. For example, if the Estimated Hold Time Option is set to 360, the Wait Time option is set to 120 and the customer has been waiting for 120 seconds and there are still 400 seconds estimated hold time, then they are both active at the same time and this setting will be checked to see what options will be offered. Default is WAIT only.
<BR>
<A NAME="vicidial_inbound_groups-hold_time_option">
<BR>
<B>Estimated Hold Time Option -</B> This allows you to specify the routing of the call if the estimated hold time is over the amount of seconds specified below. Default is NONE. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option.
<BR>
<A NAME="vicidial_inbound_groups-hold_time_second_option">
<BR>
<B>Hold Time Second Option -</B> Same as the first Hold Time Option field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Hold Time Option is selected then this option will not be offered.
<BR>
<A NAME="vicidial_inbound_groups-hold_time_third_option">
<BR>
<B>Hold Time Third Option -</B> Same as the first Hold Time Option field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Hold Time Option is selected then this option will not be offered.
<BR>
<A NAME="vicidial_inbound_groups-hold_time_option_seconds">
<BR>
<B>Hold Time Option Seconds -</B> If Hold Time Option is set to anything but NONE, this is the number of seconds of estimated hold time that will trigger the hold time option. Default is 360 seconds.
<BR>
<A NAME="vicidial_inbound_groups-hold_time_option_minimum">
<BR>
<B>Hold Time Option Minimum -</B> If Hold Time Option enabled, this is the minimum number of seconds the call must be waiting before it will be presented with the hold time option. The hold time option will immediately be presented at this time if the estimated hold time is greater than the Hold Time Option Seconds value. Default is 0 seconds.
<BR>
<A NAME="vicidial_inbound_groups-hold_time_option_exten">
<BR>
<B>Hold Time Option Extension -</B> If Hold Time Option is set to EXTENSION, this is the dialplan extension that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds. For AGENTDIRECT in-groups, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number.
<BR>
<A NAME="vicidial_inbound_groups-hold_time_option_callmenu">
<BR>
<B>Hold Time Option Callmenu -</B> If Hold Time Option is set to CALL_MENU, this is the Call Menu that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds.
<BR>
<A NAME="vicidial_inbound_groups-hold_time_option_voicemail">
<BR>
<B>Hold Time Option Voicemail -</B> If Hold Time Option is set to VOICEMAIL, this is the voicemail box that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use.
<BR>
<A NAME="vicidial_inbound_groups-hold_time_option_xfer_group">
<BR>
<B>Hold Time Option Transfer In-Group -</B> If Hold Time Option is set to IN_GROUP, this is the inbound group that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds.
<BR>
<A NAME="vicidial_inbound_groups-hold_time_option_press_filename">
<BR>
<B>Hold Time Option Press Filename -</B> If Hold Time Option is set to one of the PRESS_ options, this is the filename prompt that is played if the estimated hold time exceeds the Hold Time Option Seconds to give the customer the option to press 1 on their phone to run the selected Hold Time Press Option. It is very important that this audio file is 10 seconds or less or there will be problems. Default is to-be-called-back.
<BR>
<A NAME="vicidial_inbound_groups-hold_time_option_no_block">
<BR>
<B>Hold Time Option Press No Block -</B> Setting this option to Y will allow calls in line behind a call where the Hold Time Option Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Hold Time Option Press Filename message is playing to a customer they cannot be sent to an agent. Default is N.
<BR>
<A NAME="vicidial_inbound_groups-hold_time_option_prompt_seconds">
<BR>
<B>Hold Time Option Press Filename Seconds -</B> This field needs to be set to the number of seconds that the Hold Time Option Press Filename plays for. Default is 10.
<BR>
<A NAME="vicidial_inbound_groups-hold_time_option_callback_filename">
<BR>
<B>Hold Time Option After Press Filename -</B> If Hold Time Option is set to one of the PRESS_ options or CALLERID_CALLBACK, this is the filename prompt that is played after the customer has pressed 1 or the call has been added to the callback list.
<BR>
<A NAME="vicidial_inbound_groups-hold_time_option_callback_list_id">
<BR>
<B>Hold Time Option Callback List ID -</B> If Hold Time Option is set to CALLERID_CALLBACK, this is the List ID the call is added to as a new lead if the estimated hold time exceeds the Hold Time Option Seconds.
<BR>
<A NAME="vicidial_inbound_groups-agent_alert_exten">
<BR>
<B>Agent Alert Filename -</B> The audio file to play to an agent to announce that a call is coming to the agent. To not use this function set this to X. Default is ding.
<BR>
<A NAME="vicidial_inbound_groups-agent_alert_delay">
<BR>
<B>Agent Alert Delay -</B> The length of time in milliseconds to wait before sending the call to the agent after playing the on Agent Alert Extension. Default is 1000.
<BR>
<A NAME="vicidial_inbound_groups-default_xfer_group">
<BR>
<B>Default Transfer Group -</B> This field is the default In-Group that will be automatically selected when the agent goes to the transfer-conference frame in their agent interface.
<BR>
<A NAME="vicidial_inbound_groups-ingroup_recording_override">
<BR>
<B>In-Group Recording Override -</B> This field allows for the overriding of the campaign call recording setting. This setting can be overridden by the vicidial_user recording override setting. DISABLED will not override the campaign recording setting. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording.
<BR>
<A NAME="vicidial_inbound_groups-ingroup_rec_filename">
<BR>
<B>In-Group Recording Filename -</B> This field will override the Campaign Recording Filenaming Scheme unless it is set to NONE. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT VENDORLEADCODE LEADID. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max. Default is NONE.
<?php
if ($SSqc_features_active > 0)
{
?>
<BR>
<A NAME="vicidial_inbound_groups-qc_enabled">
<BR>
<B>QC Enabled -</B> Setting this field to Y allows for the agent Quality Control features to work. Default is N.
<BR>
<A NAME="vicidial_inbound_groups-qc_statuses">
<BR>
<B>QC Statuses -</B> This area is where you select which statuses of leads should be gone over by the QC system. Place a check next to the status that you want QC to review.
<BR>
<A NAME="vicidial_inbound_groups-qc_shift_id">
<BR>
<B>QC Shift -</B> This is the shift timeframe used to pull QC records for an inbound_group. The days of the week are ignored for these functions.
<BR>
<A NAME="vicidial_inbound_groups-qc_get_record_launch">
<BR>
<B>QC Get Record Launch-</B> This allows one of the following actions to be triggered upon a QC agent receiving a new record.
<BR>
<A NAME="vicidial_inbound_groups-qc_show_recording">
<BR>
<B>QC Show Recording -</B> This allows for a recording that may be linked with the QC record to be display in the QC agent screen.
<BR>
<A NAME="vicidial_inbound_groups-qc_web_form_address">
<BR>
<B>QC WebForm Address -</B> This is the website address that a QC agent can go to when clicking on the WEBFORM link in the QC screen.
<BR>
<A NAME="vicidial_inbound_groups-qc_script">
<BR>
<B>QC Script -</B> This is the script that can be used by QC agents in the SCRIPT tab in the QC screen.
<?php
}
?>
<BR>
<A NAME="vicidial_inbound_groups-hold_recall_xfer_group">
<BR>
<B>Hold Recall Transfer In-Group -</B> If a customer calls back to this in-group more than once and this is not set to NONE, then the call will automatically be sent on to the In-Group selected in this field. Default is NONE.
<BR>
<A NAME="vicidial_inbound_groups-no_delay_call_route">
<BR>
<B>No Delay Call Route -</B> Setting this to Y will remove all wait times and audio prompts and attempt to send the call right to an agent. Does not override welcome message or on hold prompt settings. Default is N.
<BR>
<A NAME="vicidial_inbound_groups-answer_sec_pct_rt_stat_one">
<BR>
<B>Stats Percent of Calls Answered Within X seconds -</B> This field allows you to set the number of hold seconds that the realtime stats display will use to calculate the percentage of answered calls that were answered within X number of seconds on hold.
<BR>
<A NAME="vicidial_inbound_groups-start_call_url">
<BR>
<B>Start Call URL -</B> This web URL address is not seen by the agent, but it is called every time a call is sent to an agent if it is populated. Uses the same variables as the web form fields and scripts. Default is blank.
<BR>
<A NAME="vicidial_inbound_groups-dispo_call_url">
<BR>
<B>Dispo Call URL -</B> This web URL address is not seen by the agent, but it is called every time a call is dispositioned by an agent if it is populated. Uses the same variables as the web form fields and scripts. dispo and talk_time are the variables you can use to retrieve the agent-defined disposition for the call and the actual talk time in seconds of the call. Default is blank.
<BR>
<A NAME="vicidial_inbound_groups-add_lead_url">
<BR>
<B>Add Lead URL -</B> This web URL address is not seen by the agent, but it is called every time a lead is added to the system through the inbound process. Default is blank. You must begin this URL with VAR if you want to use variables, and of course --A-- and --B-- around the actual variable in the URL where you want to use it. Here is the list of variables that are available for this function. lead_id, vendor_lead_code, list_id, phone_number, phone_code, did_id, did_extension, did_pattern, did_description, uniqueid
<BR>
<A NAME="vicidial_inbound_groups-default_group_alias">
<BR>
<B>Default Group Alias -</B> If you have allowed Group Aliases for the campaign that the agent is logged into then this is the group alias that is selected first by default on a call coming in from this inbound group when the agent chooses to use a Group Alias for an outbound manual call. Default is NONE or empty.
<BR>
<A NAME="vicidial_inbound_groups-extension_appended_cidname">
<BR>
<B>Extension Append CID -</B> If enabled, the calls coming in from this in-group will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled.
<BR>
<A NAME="vicidial_inbound_groups-uniqueid_status_display">
<BR>
<B>Uniqueid Status Display -</B> If enabled, when an agent receives a call through this in-group they will see the uniqueid of the call added to the status line in their agent interface. The PREFIX option will add the prefix defined blow to the beginning of the uniqueid in the display. Default is DISABLED. If there was already a Uniqueid defined on a call entering this in-group, then the original uniqueid will be displayed. If the PRESERVE option is used and the call is sent to a second agent, the uniqueid and prefix displayed to the first agent will also be displayed to the second agent.
<BR>
<A NAME="vicidial_inbound_groups-uniqueid_status_prefix">
<BR>
<B>Uniqueid Status Prefix -</B> If PREFIX option is selected above then this is the value of that prefix. Default is empty.
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_INBOUND_DIDS TABLE</FONT></B><BR><BR>
<BR>
<A NAME="vicidial_inbound_dids-did_pattern">
<BR>
<B>DID Extension -</B> This is the number, extension or DID that will trigger this entry and that you will route within the system using this function. There is a reserved default DID that you can use which is just the word -default- without the dashes, that will allos you to send any call that does not match any other existing patterns to the default DID.
<BR>
<A NAME="vicidial_inbound_dids-did_description">
<BR>
<B>DID Description -</B> This is the description of the DID routing entry.
<BR>
<A NAME="vicidial_inbound_dids-did_active">
<BR>
<B>DID Active -</B> This the field where you set the DID entry to active or not. Default is Y.
<BR>
<A NAME="vicidial_inbound_dids-did_route">
<BR>
<B>DID Route -</B> This the type of route that you set the DID to use. EXTEN will send calls to the extension entered below, VOICEMAIL will send calls directly to the voicemail box entered below, AGENT will send calls to a VICIDIAL agent if they are logged in, PHONE will send the call to a phones entry selected below, IN_GROUP will send calls directly to the specified inbound group. Default is EXTEN. CALLMENU will send the call to the defined Call Menu.
<BR>
<A NAME="vicidial_inbound_dids-record_call">
<BR>
<B>Record Call -</B> This option allows you to set the calls coming into this DID to be recorded. Y will record the entire call, Y_QUEUESTOP will record the call until the call is hungup or enters an in-group queue, N will not record the call. Default is N.
<BR>
<A NAME="vicidial_inbound_dids-extension">
<BR>
<B>Extension -</B> If EXTEN is selected as the DID Route, then this is the dialplan extension that calls will be sent to. Default is 9998811112, no-service.
<BR>
<A NAME="vicidial_inbound_dids-exten_context">
<BR>
<B>Extension Context -</B> If EXTEN is selected as the DID Route, then this is the dialplan context that calls will be sent to. Default is default.
<BR>
<A NAME="vicidial_inbound_dids-voicemail_ext">
<BR>
<B>Voicemail Box -</B> If VOICEMAIL is selected as the DID Route, then this is the voicemail box that calls will be sent to. Default is empty.
<BR>
<A NAME="vicidial_inbound_dids-phone">
<BR>
<B>Phone Extension -</B> If PHONE is selected as the DID Route, then this is the phone extension that calls will be sent to.
<BR>
<A NAME="vicidial_inbound_dids-server_ip">
<BR>
<B>Phone Server IP -</B> If PHONE is selected as the DID Route, then this is the server IP for the phone extension that calls will be sent to.
<BR>
<A NAME="vicidial_inbound_dids-menu_id">
<BR>
<B>Call Menu -</B> If CALLMENU is selected as the DID Route, then this is the Call Menu that calls will be sent to.
<BR>
<A NAME="vicidial_inbound_dids-user">
<BR>
<B>User Agent -</B> If AGENT is selected as the DID Route, then this is the VICIDIAL Agent that calls will be sent to.
<BR>
<A NAME="vicidial_inbound_dids-user_unavailable_action">
<BR>
<B>User Unavailable Action -</B> If AGENT is selected as the DID Route, and the user is not logged in or available, then this is the route that the calls will take.
<BR>
<A NAME="vicidial_inbound_dids-user_route_settings_ingroup">
<BR>
<B>User Route Settings In-Group -</B> If AGENT is selected as the DID Route, then this is the In-Group that will be used for the queue settings as the caller is waiting to be sent to the agent. Default is AGENTDIRECT.
<BR>
<A NAME="vicidial_inbound_dids-group_id">
<BR>
<B>In-Group ID -</B> If IN_GROUP is selected as the DID Route, then this is the In-Group that calls will be sent to.
<BR>
<A NAME="vicidial_inbound_dids-call_handle_method">
<BR>
<B>In-Group Call Handle Method -</B> If IN_GROUP is selected as the DID Route, then this is the call handling method used for these calls. CID will add a new lead record with every call using the CallerID as the phone number, CIDLOOKUP will attempt to lookup the phone number by the CallerID in the entire system, CIDLOOKUPRL will attempt to lookup the phone number by the CallerID in only one specified list, CIDLOOKUPRC will attempt to lookup the phone number by the CallerID in all of the lists that belong to the specified campaign, CLOSER is specified for VICIDIAL Closer calls, ANI will add a new lead record with every call using the ANI as the phone number, ANILOOKUP will attempt to lookup the phone number by the ANI in the entire system, ANILOOKUPRL will attempt to lookup the phone number by the ANI in only one specified list, XDIGITID will prompt the caller for an X digit code before the call will be put into the queue, VIDPROMPT will prompt the caller for their ID number and will create a new lead record with the CallerID as the phone number and the ID as the Vendor ID, VIDPROMPTLOOKUP will attempt to lookup the ID in the entire system, VIDPROMPTLOOKUPRL will attempt to lookup the vendor ID by the ID in only one specified list, VIDPROMPTLOOKUPRC will attempt to lookup the vendor ID by the ID in all of the lists that belong to the specified campaign. Default is CID.
<BR>
<A NAME="vicidial_inbound_dids-agent_search_method">
<BR>
<B>In-Group Agent Search Method -</B> If IN_GROUP is selected as the DID Route, then this is the agent search method to be used by the inbound group, LO is Load-Balanced-Overflow and will try to send the call to an agent on the local server before trying to send it to an agent on another server, LB is Load-Balanced and will try to send the call to the next agent no matter what server they are on, SO is Server-Only and will only try to send the calls to agents on the server that the call came in on. Default is LB.
<BR>
<A NAME="vicidial_inbound_dids-list_id">
<BR>
<B>In-Group List ID -</B> If IN_GROUP is selected as the DID Route, then this is the List ID that leads may be searched through and that leads will be inserted into if necessary.
<BR>
<A NAME="vicidial_inbound_dids-campaign_id">
<BR>
<B>In-Group Campaign ID -</B> If IN_GROUP is selected as the DID Route, then this is the Campaign ID that leads may be searched for in if the call handle method is CIDLOOKUPRC.
<BR>
<A NAME="vicidial_inbound_dids-phone_code">
<BR>
<B>In-Group Phone Code -</B> If IN_GROUP is selected as the DID Route, then this is the Phone Code used if a new lead is created.
<BR>
<A NAME="vicidial_inbound_dids-filter_clean_cid_number">
<BR>
<B>Clean CID Number -</B> This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. Default is empty. If more than one rule is specified make sure you separate them with a space and the R will run before the L.
<BR>
<A NAME="vicidial_inbound_dids-filter_inbound_number">
<BR>
<B>Filter Inbound Number -</B> This option if enabled allows you to filter calls coming into this DID and send them to an alternative action if they match a phone number that is in the filter phone group or a URL response if you have configured one. Default is DISABLED. GROUP will search in a Filter Phone Group. URL will send a URL and will match if a 1 is sent back.
<BR>
<A NAME="vicidial_inbound_dids-filter_phone_group_id">
<BR>
<B>Filter Phone Group ID -</B> If the Filter Inbound Number field is set to GROUP then this is the ID of the Filter Phone Group that will have its numbers searched looking for a match to the caller ID number of the incoming call.
<BR>
<A NAME="vicidial_inbound_dids-filter_url">
<BR>
<B>Filter URL -</B> If the Filter Inbound Number field is set to URL then this is the web address of a script that will search a remote system and return a 1 for a match and a 0 for no match. Only two variables are available in the address if you use the VAR prefix like with webform addresses in campaigns, --A--phone_number--B-- and --A--did_pattern--B-- can be used in the URL to indicate the caller ID of the caller and the DID that the customer called in on.
<BR>
<A NAME="vicidial_inbound_dids-filter_action">
<BR>
<B>Filter Action -</B> If Filter Inbound Number is activated and a match is found then this is the action that is to be taken. This is the same as the Route that you select for a DID, and the settings below function just like they do for a standard routing.
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_CALL MENU TABLE</FONT></B><BR><BR>
<A NAME="vicidial_call_menu-menu_id">
<BR>
<B>Menu ID -</B> This is the ID for this step of the call menu. This will also show up as the context that is used in the dialplan for this call menu. Here is a list of reserved phrases that cannot be used as menu IDs: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor.
<BR>
<A NAME="vicidial_call_menu-menu_name">
<BR>
<B>Menu Name -</B> This field is the descriptive name for the call menu.
<BR>
<A NAME="vicidial_call_menu-menu_prompt">
<BR>
<B>Menu Prompt -</B> This field contains the file name of the audio prompt to play at the beginning of this menu. You can enter multiple propmts in this field and the other prompt fields by separating them with a pipe character.
<BR>
<A NAME="vicidial_call_menu-menu_timeout">
<BR>
<B>Menu Timeout -</B> This field is where you set the timeout in seconds that the menu will wait for the caller to enter in a DTMF choice. Setting this field to zero 0 will mean that there will be no wait time after the prompt is played.
<BR>
<A NAME="vicidial_call_menu-menu_timeout_prompt">
<BR>
<B>Menu Timeout Prompt -</B> This field contains the file name of the audio prompt to play when the timeout has been reached. Default is NONE to play no audio at timeout.
<BR>
<A NAME="vicidial_call_menu-menu_invalid_prompt">
<BR>
<B>Menu Invalid Prompt -</B> This field contains the file name of the audio prompt to play when the caller has selected an invalid option. Default is NONE to play no audio at invalid.
<BR>
<A NAME="vicidial_call_menu-menu_repeat">
<BR>
<B>Menu Repeat -</B> This field is where you define the number of times that the menu will play after the first time if no valid choice is made by the caller. Default is 1 to repeat the menu once.
<BR>
<A NAME="vicidial_call_menu-menu_time_check">
<BR>
<B>Menu Time Check -</B> This field is where you can select whether to restrict the Call Menu access to the specific hours set up in the selected Call Time. If the Call Time is blank, this setting will be ignored. Default is 0 for disabled.
<BR>
<A NAME="vicidial_call_menu-call_time_id">
<BR>
<B>Call Time ID -</B> This is the Call Time ID that will be used to restrict calling times if the Menu Time Check option is enabled.
<BR>
<A NAME="vicidial_call_menu-track_in_vdac">
<BR>
<B>Track Calls in Real-Time Report -</B> This field is where you can select whether you want the call to be tracked in the Real-time screen as an incoming IVR type call. Default is 1 for active.
<BR>
<A NAME="vicidial_call_menu-tracking_group">
<BR>
<B>Tracking Group -</B> This is the ID that you can use to track calls to this Call Menu when looking at the IVR Report. The list includes CALLMENU as the default as well as all of the In-Groups.
<BR>
<A NAME="vicidial_call_menu-dtmf_log">
<BR>
<B>Log Key Press -</B> This option if enabled will log the DTMF key press by the caller in this Call Menu. Default is 0 for disabled.
<BR>
<A NAME="vicidial_call_menu-option_value">
<BR>
<B>Option Value -</B> This field is where you define the menu option, possible choices are: 0,1,2,3,4,5,6,7,8,9,*,#,A,B,C,D,TIMECHECK. The special option TIMECHECK can be used only if you have Menu Time Check enabled and there is a Call Time defined for the Menu. To delete an Option, just set the Route to REMOVE and the option will be deleted when you click the SUBMIT button.
<BR>
<A NAME="vicidial_call_menu-option_description">
<BR>
<B>Option Description -</B> This field is where you can describe the option, this description will be put into the dialplan as a comment above the option.
<BR>
<A NAME="vicidial_call_menu-option_route">
<BR>
<B>Option Route -</B> This menu contains the options for where to send the call if this option is selected: CALLMENU,INGROUP,DID,HANGUP,EXTENSION,PHONE. For CALLMENU, the Route Value should be the Menu ID of the Call Menu that you want the call sent to. For INGROUP, the In-Group that you want the call to be sent to needs to be selected as well as the other 5 options that need to be set to properly route a call to an Inbound Group. For DID, the Route Value needs to be the DID pattern that you want to send the call to. For HANGUP, the Route Value can be the name of an audio file to play before hanging up the call. For EXTENSION, the Route Value needs to be the dialplan extension you want to send the call to, and the Route Value Context is the context that extension is located in, if left blank the context will default to default. For PHONE, the Route Value needs to be the phone login value for the phones entry that you want to send the call to. For VOICEMAIL, the Route Value needs to be the voicemail box number, the unavailable mesage will be played. For AGI, the Route Value needs to be the agi script and any values taht need to be passed to it.
<BR>
<A NAME="vicidial_call_menu-option_route_value">
<BR>
<B>Option Route Value -</B> This field is where you enter the value that defines where in the selected Option Route that the call is to be directed to.
<BR>
<A NAME="vicidial_call_menu-option_route_value_context">
<BR>
<B>Option Route Value Context -</B> This field is optional and only used for EXTENSION Option Routes.
<BR>
<A NAME="vicidial_call_menu-ingroup_settings">
<BR>
<B>Call Menu In-Group Settings -</B> If the route is set to INGROUP then there are many options that you can set to define how the call is sent to into the queue. In-Group is the inbound group that you want the call to go to. Handle Method is the way you want the call to be handled, <a href="#vicidial_inbound_dids-call_handle_method">Click here to see a list of the available handle methods</a>. Search Method defines how the queue will find the next agent, recommend leave this on LB. List ID is the list that the new lead is inserted into, also if the Method is not a LOOKUP method and the lead is not found. Campaign ID is the campaign to search lists through if one of the RC methods is used. Phone Code is the phone_code field entry for the lead that is inserted with. VID Enter Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to ask the customer to enter their ID. VID ID Number Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played after customer enters their ID, something like YOU HAVE ENTERED. VID Confirm Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to confirm their ID, something like PRESS 1 TO CONFIRM AND 2 TO REENTER. VID Digits is used if the Method is set to one of the VIDPROMPT methods, if it is set to a number it is the number of digits that must be ebtered by the customer when prompted for their ID, if set to empty or X then the customer will have to press pound or hash to finish their entry of their ID.
<BR>
<A NAME="vicidial_call_menu-custom_dialplan_entry">
<BR>
<B>Custom Dialplan Entry -</B> This field allows you to enter in any dialplan elements that you want for the Call Menu.
<BR><BR><BR><BR>
<BR>
<A NAME="vicidial_filter_phone_groups-filter_phone_group_id">
<BR>
<B>Filter Phone Group ID -</B> This is the ID of the Filter Phone Group that is the container for a group of phone numbers that you can have automatically searched through when a call comes into a DID and send to an alternate route if there is a match. This field should be between 2 and 20 characters and have no punctuation except for underscore.
<BR>
<A NAME="vicidial_filter_phone_groups-filter_phone_group_name">
<BR>
<B>Filter Phone Group Name -</B> This is the name of the Filter Phone Group and is displayed with the ID in select lists where this feature is used. This field should be between 2 and 40 characters.
<BR>
<A NAME="vicidial_filter_phone_groups-filter_phone_group_description">
<BR>
<B>Filter Phone Group Description -</B> This is the description of the Filter Phone Group, it is purely for notation purposes only and is not a required field.
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_REMOTE_AGENTS TABLE</FONT></B><BR><BR>
<A NAME="vicidial_remote_agents-user_start">
<BR>
<B>User ID Start -</B> This is the starting User ID that is used when the remote agent entries are inserted into the system. If the Number of Lines is set higher than 1, this number is incremented by one until each line has an entry. Make sure you create a new VICIDIAL user account with a user level of 4 or great if you want them to be able to use the vdremote.php page for remote web access of this account.
<BR>
<A NAME="vicidial_remote_agents-number_of_lines">
<BR>
<B>Number of Lines -</B> This defines how many remote agent entries the system creates, and determines how many lines it thinks it can safely send to the number below.
<BR>
<A NAME="vicidial_remote_agents-server_ip">
<BR>
<B>Server IP -</B> A remote agent entry is only good for one specific server, here is where you select which server you want.
<BR>
<A NAME="vicidial_remote_agents-conf_exten">
<BR>
<B>External Extension -</B> This is the number that you want the calls forwarded to. Make sure that it is a full dial plan number and that if you need a 9 at the beginning you put it in here. Test by dialing this number from a phone on the system.
<BR>
<A NAME="vicidial_remote_agents-extension_group">
<BR>
<B>Extension Group -</B> If set to something other than NONE or empty this will override the External Extension field and use the Extension Group entries that have the same extension group ID. Default is NONE for deactivated.
<BR>
<A NAME="vicidial_remote_agents-status">
<BR>
<B>Status -</B> Here is where you turn the remote agent on and off. As soon as the agent is Active the system assumes that it can send calls to it. It may take up to 30 seconds once you change the status to Inactive to stop receiving calls.
<BR>
<A NAME="vicidial_remote_agents-campaign_id">
<BR>
<B>Campaign -</B> Here is where you select the campaign that these remote agents will be logged into. Inbound needs to use the CLOSER campaign and select the inbound campaigns below that you want to receive calls from.
<BR>
<A NAME="vicidial_remote_agents-on_hook_agent">
<BR>
<B>On-Hook Agent -</B> This option is only used for inbound calls going to this remote agent. This feature will call the remote agent and will not send the customer to the remote agent until the line is answered. Default is N for disabled.
<BR>
<A NAME="vicidial_remote_agents-on_hook_ring_time">
<BR>
<B>On-Hook Ring Time -</B> This option is only used when the On-Hook Agent field above is set to Y and then only for inbound calls coming to this remote agent. This is the number of seconds that each call attempt will ring to try to get an answer. It is recommended that you set this to a few seconds less than it takes for a call to be sent to voicemail. Default is 15.
<BR>
<A NAME="vicidial_remote_agents-closer_campaigns">
<BR>
<B>Inbound Groups -</B> Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign.
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_EXTENSION_GROUPS TABLE</FONT></B><BR><BR>
<A NAME="vicidial_extension_groups-extension_group_id">
<BR>
<B>Extension Group -</B> This required field is where you enter the group ID that you want this extension to be put into. No spaces or special characters except for underscore letters and numbers.
<BR>
<A NAME="vicidial_extension_groups-extension">
<BR>
<B>Extension -</B> This required field is where you put the dialplan extension that you want the remote agent calls to be sent to for this extension group entry.
<BR>
<A NAME="vicidial_extension_groups-rank">
<BR>
<B>Rank -</B> This field allows you to rank the extension group entries that share the same extension group. Default is 0.
<BR>
<A NAME="vicidial_extension_groups-campaign_groups">
<BR>
<B>Campaigns Groups -</B> In this field you can put a list of campaign IDs and or inbound group IDs that you want to restrict the use of the extension group for. List must be separate by pipes and have a pipe at the beginning and end of the string.
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_CAMPAIGN_LISTS</FONT></B><BR><BR>
<A NAME="vicidial_campaign_lists">
<BR>
<B>The lists within this campaign are listed here, whether they are active is denoted by the Y or N and you can go to the list screen by clicking on the list ID in the first column.</B>
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_CAMPAIGN_STATUSES TABLE</FONT></B><BR><BR>
<A NAME="vicidial_campaign_statuses">
<BR>
<B>Through the use of custom campaign statuses, you can have statuses that only exist for a specific campaign. The Status must be 1-8 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as a disposition. The human_answered field is used when calculating the drop percentage, or abandon rate. Setting human_answered to Y will use this status when counting the human-answered calls. The Category option allows you to group several statuses into a catogy that can be used for statistical analysis.</B>
<?php
if ($SSoutbound_autodial_active > 0)
{
?>
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_CAMPAIGN_HOTKEYS TABLE</FONT></B><BR><BR>
<A NAME="vicidial_campaign_hotkeys">
<BR>
<B>Through the use of custom campaign hot keys, agents that use the vicidial web-client can hang up and disposition calls just by pressing a single key on their keyboard.</B> There are two special HotKey options that you can use in conjunction with Alternate Phone number dialing, ALTPH2 - Alternate Phone Hot Dial and ADDR3-----Address3 Hot Dial allow an agent to use a hotkey to hang up their call, stay on the same lead, and dial another contact number from that lead.
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_LEAD_RECYCLE TABLE</FONT></B><BR><BR>
<A NAME="vicidial_lead_recycle">
<BR>
<B>Through the use of lead recycling, you can call specific statuses of leads again at a specified interval without resetting the entire list. Lead recycling is campaign-specific and does not have to be a selected dialable status in your campaign. The attempt delay field is the number of seconds until the lead can be placed back in the hopper, this number must be at least 120 seconds. The attempt maximum field is the maximum number of times that a lead of this status can be attempted before the list needs to be reset, this number can be from 1 to 10. You can activate and deactivate a lead recycle entry with the provided links.</B>
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL AUTO ALT DIAL STATUSES</FONT></B><BR><BR>
<A NAME="vicidial_auto_alt_dial_statuses">
<BR>
<B>If the Auto Alt-Number Dialing field is set, then the leads that are dispositioned under these auto alt dial statuses will have their alt_phone and-or address3 fields dialed after any of these no-answer statuses are set.</B>
<?php
}
?>
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL AGENT PAUSE CODES</FONT></B><BR><BR>
<A NAME="vicidial_pause_codes">
<BR>
<B>If the Agent Pause Codes Active field is set to active then the agents will be able to select from these pause codes when they click on the PAUSE button on their screens. This data is then stored in the vicidial agent log. The Pause code must contain only letters and numbers and be less than 7 characters long. The pause code name can be no longer than 30 characters.</B>
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL CAMPAIGN PRESETS</FONT></B><BR><BR>
<A NAME="vicidial_xfer_presets">
<BR>
<B>If the Campaign setting for presets is set to ENABLED then you have the ability to define Transfer-Conference presets that will be available to the agent allowing them to 3-way call these presets or blind transfer calls to these preset numbers. These presets also have an option to hide the number associated with each preset from the agent.</B>
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_USER_GROUPS TABLE</FONT></B><BR><BR>
<A NAME="vicidial_user_groups-user_group">
<BR>
<B>User Group -</B> This is the short name of a Vicidial User group, try not to use any spaces or punctuation for this field. max 20 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_user_groups-group_name">
<BR>
<B>Group Name -</B> This is the description of the vicidial user group max of 40 characters.
<BR>
<A NAME="vicidial_user_groups-forced_timeclock_login">
<BR>
<B>Force Timeclock Login -</B> This option allows you to not let an agent log in to the VICIDIAL agent interface if they have not logged into the timeclock. Default is N. There is an option to exempt admin users, levels 8 and 9.
<BR>
<A NAME="vicidial_user_groups-shift_enforcement">
<BR>
<B>Shift Enforcement -</B> This setting allows you to restrict agent logins based upon the shifts that are selected below. OFF will not enforce shifts at all. START will only enforce the login time but will not affect an agent that is running over their shift time if they are already logged in. ALL will enforce shift start time and will log an agent out after they run over the end of their shift time. Default is OFF.
<BR>
<A NAME="vicidial_user_groups-group_shifts">
<BR>
<B>Group Shifts -</B> This is a selectable list of shifts that can restrict the agents login time on the system.
<BR>
<A NAME="vicidial_user_groups-allowed_campaigns">
<BR>
<B>Allowed Campaigns -</B> This is a selectable list of Campaigns to which members of this user group can log in to. The ALL-CAMPAIGNS option allows the users in this group to see and log in to any campaign on the system.
<BR>
<A NAME="vicidial_user_groups-agent_status_viewable_groups">
<BR>
<B>Agent Status Viewable Groups -</B> This is a selectable list of User Groups and user functions to which members of this user group can view the status of as well as transfer calls to inside of the agent screen. The ALL-GROUPS option allows the users in this group to see and transfer calls to any user on the system. The CAMPAIGN-AGENTS option allows users in this group to see and transfer calls to any user in the campaign that they are logged into. The NOT-LOGGED-IN-AGENTS option allows all users in the system to be displayed, even if they are not logged-in curently.
<BR>
<A NAME="vicidial_user_groups-agent_status_view_time">
<BR>
<B>Agent Status View Time -</B> This option defines whether the agent will see the amount of time that users in their agent sidebar have been in their current status. Default is N for no or disabled.
<BR>
<A NAME="vicidial_user_groups-agent_call_log_view">
<BR>
<B>Agent Call Log View -</B> This option defines whether the agent will be able to see their call log for calls handled through the ViciDial agent screen. Default is N for no or disabled.
<BR>
<A NAME="vicidial_user_groups-agent_xfer_options">
<BR>
<B>Agent Transfer Options -</B> These options allow for the disabling of specific buttons in the Transfer Conference section of the Agent interface. Default is Y for yes or enabled.
<BR>
<A NAME="vicidial_user_groups-agent_fullscreen">
<BR>
<B>Agent Fullscreen -</B> This option if set to Y will set the height and width of the ViciDial agent screen to the size of the web browser window without any allowance for the Agents View, Calls in Queue View or Calls in Session view. Default is N for no or disabled.
<BR>
<A NAME="vicidial_user_groups-allowed_reports">
<BR>
<B>Allowed Reports -</B> If a user in this group is set to user level 7 or higher, then this feature can be used to restrict the reports that the users can view. Default is ALL. If you want to select more than one report then press the Ctrl key on your keyboard as you select the reports.
<?php
if (strlen($SSwebphone_url) > 5)
{
?>
<BR>
<A NAME="vicidial_user_groups-webphone_url_override">
<BR>
<B>Webphone URL Override -</B> This setting allows you to set an alternate webphone URL just for the members of one user group. Default is empty.
<BR>
<A NAME="vicidial_user_groups-webphone_systemkey_override">
<BR>
<B>Webphone System Key Override -</B> This setting allows you to set an alternate webphone System Key just for the members of one user group. Default is empty.
<BR>
<A NAME="vicidial_user_groups-webphone_dialpad_override">
<BR>
<B>Webphone Dialpad Override -</B> This setting allows you to activate or deactivate the dialpad on the webphone just for the members of one user group. Default is DISABLED. TOGGLE will allow the user to view and hide the dialpad by clicking a link. TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link.
<?php
}
if ($SSqc_features_active > 0)
{
?>
<BR>
<A NAME="vicidial_user_groups-qc_allowed_campaigns">
<BR>
<B>QC Allowed Campaigns -</B> This is a selectable list of Campaigns which members of this user group will be able to QC. The ALL-CAMPAIGNS option allows the users in this group to QC any campaign on the system.
<BR>
<A NAME="vicidial_user_groups-qc_allowed_inbound_groups">
<BR>
<B>QC Allowed Inbound Groups -</B> This is a selectable list of Inbound Groups which members of this user group will be able to QC. The ALL-GROUPS option allows the users in this user group to QC any inbound group on the system.
<?php
}
?>
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_SCRIPTS TABLE</FONT></B><BR><BR>
<A NAME="vicidial_scripts-script_id">
<BR>
<B>Script ID -</B> This is the short name of a Vicidial Script. This needs to be a unique identifier. Try not to use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_scripts-script_name">
<B>Script Name -</B> This is the title of a Vicidial Script. This is a short summary of the script. max 50 characters, minimum of 2 characters. There should be no spaces or punctuation of any kind in theis field.
<BR>
<A NAME="vicidial_scripts-script_comments">
<B>Script Comments -</B> This is where you can place comments for a Vicidial Script such as -changed to free upgrade on Sept 23-. max 255 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_scripts-script_text">
<B>Script Text -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: 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, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables:
<DIV style="height:200px;width:400px;background:white;overflow:scroll;font-size:12px;font-family:sans-serif;" id=iframe_example>
&#60;iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&#38;vendor_id=--A--vendor_lead_code--B--&#38;list_id=--A--list_id--B--&#38;gmt_offset_now=--A--gmt_offset_now--B--&#38;phone_code=--A--phone_code--B--&#38;phone_number=--A--phone_number--B--&#38;title=--A--title--B--&#38;first_name=--A--first_name--B--&#38;middle_initial=--A--middle_initial--B--&#38;last_name=--A--last_name--B--&#38;address1=--A--address1--B--&#38;address2=--A--address2--B--&#38;address3=--A--address3--B--&#38;city=--A--city--B--&#38;state=--A--state--B--&#38;province=--A--province--B--&#38;postal_code=--A--postal_code--B--&#38;country_code=--A--country_code--B--&#38;gender=--A--gender--B--&#38;date_of_birth=--A--date_of_birth--B--&#38;alt_phone=--A--alt_phone--B--&#38;email=--A--email--B--&#38;security_phrase=--A--security_phrase--B--&#38;comments=--A--comments--B--&#38;user=--A--user--B--&#38;campaign=--A--campaign--B--&#38;phone_login=--A--phone_login--B--&#38;fronter=--A--fronter--B--&#38;closer=--A--user--B--&#38;group=--A--group--B--&#38;channel_group=--A--group--B--&#38;SQLdate=--A--SQLdate--B--&#38;epoch=--A--epoch--B--&#38;uniqueid=--A--uniqueid--B--&#38;customer_zap_channel=--A--customer_zap_channel--B--&#38;server_ip=--A--server_ip--B--&#38;SIPexten=--A--SIPexten--B--&#38;session_id=--A--session_id--B--&#38;dialed_number=--A--dialed_number--B--&#38;dialed_label=--A--dialed_label--B--&#38;rank=--A--rank--B--&#38;owner=--A--owner--B--&#38;phone=--A--phone--B--&#38;camp_script=--A--camp_script--B--&#38;in_script=--A--in_script--B--&#38;script_width=--A--script_width--B--&#38;script_height=--A--script_height--B--&#38;recording_filename=--A--recording_filename--B--&#38;recording_id=--A--recording_id--B--&#38;user_custom_one=--A--user_custom_one--B--&#38;user_custom_two=--A--user_custom_two--B--&#38;user_custom_three=--A--user_custom_three--B--&#38;user_custom_four=--A--user_custom_four--B--&#38;user_custom_five=--A--user_custom_five--B--&#38;preset_number_a=--A--preset_number_a--B--&#38;preset_number_b=--A--preset_number_b--B--&#38;preset_number_c=--A--preset_number_c--B--&#38;preset_number_d=--A--preset_number_d--B--&#38;preset_number_e=--A--preset_number_e--B--&#38;preset_number_f=--A--preset_number_f--B--&#38;preset_dtmf_a=--A--preset_dtmf_a--B--&#38;preset_dtmf_b=--A--preset_dtmf_b--B--&#38;did_id=--A--did_id--B--&#38;did_extension=--A--did_extension--B--&#38;did_pattern=--A--did_pattern--B--&#38;did_description=--A--did_description--B--&#38;closecallid=--A--closecallid--B--&#38;xfercallid=--A--xfercallid--B--&#38;agent_log_id=--A--agent_log_id--B--&#38;entry_list_id=--A--entry_list_id--B--&#38;" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"&#62;
&#60;/iframe&#62;
</DIV>
<BR>
<A NAME="vicidial_scripts-active">
<BR>
<B>Active -</B> This determines whether this script can be selected to be used by a campaign.
<?php
if ($SSoutbound_autodial_active > 0)
{
?>
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_LEAD_FILTERS TABLE</FONT></B><BR><BR>
<A NAME="vicidial_lead_filters-lead_filter_id">
<BR>
<B>Filter ID -</B> This is the short name of a Vicidial Lead Filter. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_lead_filters-lead_filter_name">
<B>Filter Name -</B> This is a more descriptive name of the Filter. This is a short summary of the filter. max 30 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_lead_filters-lead_filter_comments">
<B>Filter Comments -</B> This is where you can place comments for a Vicidial Filter such as -calls all California leads-. max 255 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_lead_filters-lead_filter_sql">
<B>Filter SQL -</B> This is where you place the SQL query fragment that you want to filter by. do not begin or end with an AND, that will be added by the hopper cron script automatically. an example SQL query that would work here is- called_count > 4 and called_count < 8 -.
<?php
}
?>
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_CALL TIMES TABLE</FONT></B><BR><BR>
<A NAME="vicidial_call_times-call_time_id">
<BR>
<B>Call Time ID -</B> This is the short name of a Vicidial Call Time Definition. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_call_times-call_time_name">
<B>Call Time Name -</B> This is a more descriptive name of the Call Time Definition. This is a short summary of the Call Time definition. max 30 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_call_times-call_time_comments">
<B>Call Time Comments -</B> This is where you can place comments for a Vicidial Call Time Definition such as -10am to 4pm with extra call state restrictions-. max 255 characters.
<BR>
<A NAME="vicidial_call_times-ct_default_start">
<B>Default Start and Stop Times -</B> This is the default time that calling will be allowed to be started or stopped within this call time definition if the day-of-the-week start time is not defined. 0 is midnight. To prevent calling completely set this field to 2400 and set the Default Stop time to 2400. To allow calling 24 hours a day set the start time to 0 and the stop time to 2400. For inbound only, you can also set the stop call time higher than 2400 if you want the call time to go beyond midnight. So if you want your call time to run from 6 am until 2 am the next day, you would put 0600 as the start time and 2600 as the stop time.
<BR>
<A NAME="vicidial_call_times-ct_sunday_start">
<B>Weekday Start and Stop Times -</B> These are the custom times per day that can be set for the call time definition. same rules apply as with the Default start and stop times.
<BR>
<A NAME="vicidial_call_times-default_afterhours_filename_override">
<B>After Hours Filename Override -</B> These fields allow you to override the After Hours message for inbound groups if it is set to something. Default is empty.
<BR>
<A NAME="vicidial_call_times-ct_state_call_times">
<B>State Call Time Definitions -</B> This is the list of State specific call time definitions that are followed in this Call Time Definition.
<BR>
<A NAME="vicidial_call_times-state_call_time_state">
<B>State Call Time State -</B> This is the two letter code for the state that this calling time definition is for. For this to be in effect the local call time that is set in the campaign must have this state call time record in it as well as all of the leads having two letter state codes in them.
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_SHIFTS TABLE</FONT></B><BR><BR>
<A NAME="vicidial_shifts-shift_id">
<BR>
<B>Shift ID -</B> This is the short name of a Vicidial Shift Definition. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 20 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_shifts-shift_name">
<B>Shift Name -</B> This is a more descriptive name of the Shift Definition. This is a short summary of the Shift definition. max 50 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_shifts-shift_start_time">
<B>Shift Start Time -</B> This is the time that the campaign shift begins. Must only be numbers, 9:30 AM would be 0930 and 5:00 PM would be 1700.
<BR>
<A NAME="vicidial_shifts-shift_length">
<B>Shift Length -</B> This is the time in Hours and Minutes that the campaign shift lasts. 8 hours would be 08:00 and 7 hours and 30 minutes would be 07:30.
<BR>
<A NAME="vicidial_shifts-shift_weekdays">
<B>Shift Weekdays -</B> In this section you should choose the days of the week that this shift is active.
<BR><BR><BR><BR>
<A NAME="audio_store">
<B>Audio Store -</B> This utility allows you to upload audio files to the web server so that they can be distributed to all of the ViciDial servers in a multi-server cluster. An important note, only two audio file types will work, .wav files that are PCM Mono 16bit 8k and .gsm files that are 8bit 8k. Please verify that your files are properly formatted before uploading them here.
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_MUSIC_ON_HOLD TABLE</FONT></B><BR><BR>
<A NAME="vicidial_music_on_hold-moh_id">
<BR>
<B>Music On Hold ID -</B> This is the short name of a Music On Hold entry. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 100 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_music_on_hold-moh_name">
<B>Music On Hold Name -</B> This is a more descriptive name of the Music On Hold entry. This is a short summary of the Music On Hold context and will show as a comment in the musiconhold-vicidial.conf file. max 255 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_music_on_hold-active">
<B>Active -</B> This option allows you to set the Music On Hold entry to active or inactive. Inactive will remove the entry from the conf files.
<BR>
<A NAME="vicidial_music_on_hold-random">
<B>Random Order -</B> This option allows you to define the playback of the audio files in a random order. If set to N then the defined order will be used.
<BR>
<A NAME="vicidial_music_on_hold-filename">
<B>Filename -</B> To add a new audio file to a Music On Hold entry the file must first be in the audio store, then you can select the file and click submit to add it to the file list. Music on hold is updated once per minute if there have been changes made. Any files not listed in a music on hold entry that are present in the music on hold folder will be deleted.
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_TTS_PROMPTS TABLE</FONT></B><BR><BR>
<A NAME="vicidial_tts_prompts-tts_id">
<BR>
<B>TTS ID -</B> This is the short name of a TTS entry. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 50 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_tts_prompts-tts_name">
<B>TTS Name -</B> This is a more descriptive name of the TTS entry. This is a short summary of the TTS definition. max 100 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_tts_prompts-active">
<B>Active -</B> This option allows you to set the TTS entry to active or inactive.
<BR>
<A NAME="vicidial_tts_prompts-tts_voice">
<B>TTS Voice -</B> This is where you define the voice to be used in the TTS generation. Default is Allison-8kHz.
<BR>
<A NAME="vicidial_tts_prompts-tts_text">
<B>TTS Text -</B> This is the actual Text To Speech data field that is sent to Cepstral for creation of the audio file to be played to the customer. you can use Speech Synthesis Markup Language -SSML- in this field, for example, &lt;break time='1000ms'/&gt; for a 1 second break. You can also use several variables such as first name, last name and title as ViciDial variables just like you do in a Script: --A--first_name--B--. Here is a list of the available variables: lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, 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
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_VOICEMAIL TABLE</FONT></B><BR><BR>
<A NAME="vicidial_voicemail-voicemail_id">
<BR>
<B>Voicemail ID -</B> This is the all numbers identifier of this mailbox. This must not be a duplicate of an existing voicemail ID or the voicemail ID of a phone on the system, minimum of 2 characters.
<BR>
<A NAME="vicidial_voicemail-fullname">
<B>Name -</B> This is name associated with this voicemail box. max 100 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_voicemail-pass">
<B>Password -</B> This is the password that is used to gain access to the voicemail box when dialing in to check messages max 10 characters, minimum of 2 characters.
<BR>
<A NAME="vicidial_voicemail-active">
<B>Active -</B> This option allows you to set the voicemail box to active or inactive. If the box is inactive you cannot leave messages on it and you cannot check messages in it.
<BR>
<A NAME="vicidial_voicemail-email">
<B>Email -</B> This optional setting allows you to have the voicemail messages sent to an email account, if your system is set up to send out email. If this field is empty then no emails will be sent out.
<BR>
<A NAME="vicidial_voicemail-delete_vm_after_email">
<B>Delete Voicemail After Email -</B> This optional setting allows you to have the voicemail messages deleted from the system after they have been emailed out. Default is N.
<BR>
<A NAME="vicidial_voicemail-voicemail_timezone">
<B>Voicemail Zone -</B> This setting allows you to set the zone that this voicemail box will be set to when the time is logged for a message. Default is set in the System Settings.
<BR>
<A NAME="vicidial_voicemail-voicemail_options">
<B>Voicemail Options -</B> This optional setting allows you to define additional voicemail settings. It is recommended that you leave this blank unless you know what you are doing.
<?php
if ($SSoutbound_autodial_active > 0)
{
?>
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL LIST LOADER FUNCTIONALITY</FONT></B><BR><BR>
<A NAME="vicidial_list_loader">
<BR>
The VICIDIAL basic web-based lead loader is designed simply to take a lead file - up to 8MB in size - that is either tab or pipe delimited and load it into the vicidial_list table. The lead loader allows for field choosing and TXT- Plain Text, CSV- Comma Separated Values and XLS- Excel file formats. The lead loader does not do data validation, but it does allow you to check for duplicates in itself, within the campaign or within the entire system. Also, make sure that you have created the list that these leads are to be under so that you can use them. Here is a list of the fields in their proper order for the lead files:
<OL>
<LI>Vendor Lead Code - shows up in the Vendor ID field of the GUI
<LI>Source Code - internal use only for admins and DBAs
<LI>List ID - the list number that these leads will show up under
<LI>Phone Code - the prefix for the phone number - 1 for US, 01144 for UK, 01161 for AUS, etc
<LI>Phone Number - must be at least 8 digits long
<LI>Title - title of the customer - Mr. Ms. Mrs, etc...
<LI>First Name
<LI>Middle Initial
<LI>Last Name
<LI>Address Line 1
<LI>Address Line 2
<LI>Address Line 3
<LI>City
<LI>State - limited to 2 characters
<LI>Province
<LI>Postal Code
<LI>Country
<LI>Gender
<LI>Date of Birth
<LI>Alternate Phone Number
<LI>Email Address
<LI>Security Phrase
<LI>Comments
</OL>
<BR>NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /etc/astguiclient.conf file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file. Also, for duplication checks against gampaign lists, the list that has new leads going into it does need to be created in the system before you start to load the leads.
<BR><BR><BR><BR>
<?php
}
?>
<B><FONT SIZE=3>PHONES TABLE</FONT></B><BR><BR>
<A NAME="phones-extension">
<BR>
<B>Phone Extension -</B> This field is where you put the phones name as it appears to Asterisk not including the protocol or slash at the beginning. For Example: for the SIP phone SIP/test101 the Phone extension would be test101. Also, for IAX2 phones: IAX2/IAXphone1@IAXphone1 would be IAXphone1. For Zap and Dahdi attached channelbank or FXS phones make sure you put the full channel number without the prefix: Zap/25-1 would be 25-1. Another note, make sure you set the Protocol field below correctly for your type of phone.
<BR>
<A NAME="phones-dialplan_number">
<BR>
<B>Dial Plan Number -</B> This field is for the number you dial to have the phone ring. This number is defined in the extensions.conf file of your Asterisk server
<BR>
<A NAME="phones-voicemail_id">
<BR>
<B>Voicemail Box -</B> This field is for the voicemail box that the messages go to for the user of this phone. We use this to check for voicemail messages and for the user to be able to use the VOICEMAIL button on astGUIclient app.
<BR>
<A NAME="phones-voicemail_timezone">
<B>Voicemail Zone -</B> This setting allows you to set the zone that this voicemail box will be set to when the time is logged for a message. Default is set in the System Settings.
<BR>
<A NAME="phones-voicemail_options">
<B>Voicemail Options -</B> This optional setting allows you to define additional voicemail settings. It is recommended that you leave this blank unless you know what you are doing.
<BR>
<A NAME="phones-outbound_cid">
<BR>
<B>Outbound CallerID -</B> This field is where you would enter the callerID number that you would like to appear on outbound calls placed form the astguiclient web-client. This does not work on RBS, non-PRI, T1/E1s.
<BR>
<A NAME="phones-phone_ip">
<BR>
<B>Phone IP address -</B> This field is for the phone's IP address if it is a VOIP phone. This is an optional field
<BR>
<A NAME="phones-computer_ip">
<BR>
<B>Computer IP address -</B> This field is for the user's computer IP address. This is an optional field
<BR>
<A NAME="phones-server_ip">
<BR>
<B>Server IP -</B> This menu is where you select which server the phone is active on.
<BR>
<A NAME="phones-login">
<BR>
<B>Agent Screen Login -</B> The login used for the phone user to login to the client applications, like the ViciDial agent screen.
<BR>
<A NAME="phones-pass">
<BR>
<B>Login Password -</B> The password used for the phone user to login to the web-based client applications. IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Registration Password in the next field.
<BR>
<A NAME="phones-conf_secret">
<BR>
<B>Registration Password -</B> This is the secret, or password, for the phone in the iax or sip auto-generated conf file for this phone. Limit is 20 characters alphanumeric dash and underscore accepted. Default is test. Formerly called Conf File Secret. A strong registration password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number.
<BR>
<A NAME="phones-is_webphone">
<BR>
<B>Set As Webphone -</B> Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N.
<BR>
<A NAME="phones-webphone_dialpad">
<BR>
<B>Webphone Dialpad -</B> This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions. TOGGLE_OFF will default to not show the dialpad on first load, but will allow the user to show the dialpad by clicking on the dialpad link.
<BR>
<A NAME="phones-webphone_auto_answer">
<BR>
<B>Webphone Auto-Answer -</B> This setting allows the web phone to be set to automatically answer calls that come in by setting it to Y, or to have calls ring by setting it to N. Default is Y.
<BR>
<A NAME="phones-use_external_server_ip">
<BR>
<B>Use External Server IP -</B> If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the Server IP. Default is empty.
<BR>
<A NAME="phones-status">
<BR>
<B>Status -</B> The status of the phone in the system, ACTIVE and ADMIN allow for GUI clients to work. ADMIN allows access to this administrative web site. All other statuses do not allow GUI or Admin web access.
<BR>
<A NAME="phones-active">
<BR>
<B>Active Account -</B> Whether the phone is active to put it in the list in the GUI client.
<BR>
<A NAME="phones-phone_type">
<BR>
<B>Phone Type -</B> Purely for administrative notes.
<BR>
<A NAME="phones-fullname">
<BR>
<B>Full Name -</B> Used by the GUIclient in the list of active phones.
<BR>
<A NAME="phones-company">
<BR>
<B>Company -</B> Purely for administrative notes.
<BR>
<A NAME="phones-email">
<BR>
<B>Phones Email -</B> The email address associated with this phone entry. This is used for voicemail settings.
<BR>
<A NAME="phones-delete_vm_after_email">
<B>Delete Voicemail After Email -</B> This optional setting allows you to have the voicemail messages deleted from the system after they have been emailed out. Default is N.
<BR>
<A NAME="phones-picture">
<BR>
<B>Picture -</B> Not yet Implemented.
<BR>
<A NAME="phones-messages">
<BR>
<B>New Messages -</B> Number of new voicemail messages for this phone on the Asterisk server.
<BR>
<A NAME="phones-old_messages">
<BR>
<B>Old Messages -</B> Number of old voicemail messages for this phone on the Asterisk server.
<BR>
<A NAME="phones-protocol">
<BR>
<B>Client Protocol -</B> The protocol that the phone uses to connect to the Asterisk server: SIP, IAX2, Zap . Also, there is EXTERNAL for remote dial numbers or speed dial numbers that you want to list as phones.
<BR>
<A NAME="phones-local_gmt">
<BR>
<B>Local GMT -</B> The difference from Greenwich Mean time, or ZULU time where the phone is located. DO NOT ADJUST FOR DAYLIGHT SAVINGS TIME. This is used by the VICIDIAL campaign to accurately display the time and customer time.
<BR>
<A NAME="phones-phone_ring_timeout">
<BR>
<B>Phone Ring Timeout -</B> This is the amount of time, in seconds, that the phone will ring in the dialplan before sending the call to voicemail. Default is 60 seconds.
<BR>
<A NAME="phones-on_hook_agent">
<BR>
<B>On-Hook Agent Login -</B> This option is only used for inbound calls going to an agent logged in with this phone. This feature will call the agent and will not send the customer to the agents session until the line is answered. Default is N for disabled.
<BR>
<A NAME="phones-ASTmgrUSERNAME">
<BR>
<B>Manager Login -</B> This is the login that the GUI clients for this phone will use to access the Database where the server data resides.
<BR>
<A NAME="phones-ASTmgrSECRET">
<BR>
<B>Manager Secret -</B> This is the password that the GUI clients for this phone will use to access the Database where the server data resides.
<BR>
<A NAME="phones-login_user">
<BR>
<B>VICIDIAL Default User -</B> This is to place a default value in the VICIDIAL user field whenever this phone user opens the astVICIDIAL client app. Leave blank for no user.
<BR>
<A NAME="phones-login_pass">
<BR>
<B>VICIDIAL Default Pass -</B> This is to place a default value in the VICIDIAL password field whenever this phone user opens the astVICIDIAL client app. Leave blank for no pass.
<BR>
<A NAME="phones-login_campaign">
<BR>
<B>VICIDIAL Default Campaign -</B> This is to place a default value in the VICIDIAL campaign field whenever this phone user opens the astVICIDIAL client app. Leave blank for no campaign.
<BR>
<A NAME="phones-park_on_extension">
<BR>
<B>Park Exten -</B> This is the default Parking extension for the client apps. Verify that a different one works before you change this.
<BR>
<A NAME="phones-conf_on_extension">
<BR>
<B>Conf Exten -</B> This is the default Conference park extension for the client apps. Verify that a different one works before you change this.
<BR>
<A NAME="phones-VICIDIAL_park_on_extension">
<BR>
<B>VICIDIAL Park Exten -</B> This is the default Parking extension for VICIDIAL client app. Verify that a different one works before you change this.
<BR>
<A NAME="phones-VICIDIAL_park_on_filename">
<BR>
<B>VICIDIAL Park File -</B> This is the default VICIDIAL park extension file name for the client apps. Verify that a different one works before you change this. limited to 10 characters.
<BR>
<A NAME="phones-monitor_prefix">
<BR>
<B>Monitor Prefix -</B> This is the dial plan prefix for monitoring of Zap channels automatically within the astGUIclient app. Only change according to the extensions.conf ZapBarge extensions records.
<BR>
<A NAME="phones-recording_exten">
<BR>
<B>Recording Exten -</B> This is the dial plan extension for the recording extension that is used to drop into meetme conferences to record them. It usually lasts upto one hour if not stopped. verify with extensions.conf file before changing.
<BR>
<A NAME="phones-voicemail_exten">
<BR>
<B>VMAIL Main Exten -</B> This is the dial plan extension going to check your voicemail. verify with extensions.conf file before changing.
<BR>
<A NAME="phones-voicemail_dump_exten">
<BR>
<B>VMAIL Dump Exten -</B> This is the dial plan prefix used to send calls directly to a user's voicemail from a live call in the astGUIclient app. verify with extensions.conf file before changing.
<BR>
<A NAME="phones-ext_context">
<BR>
<B>Exten Context -</B> This is the dial plan context that the agent applications, like ViciDial, primarily use. It is assumed that all numbers dialed by the client apps are using this context so it is a good idea to make sure this is the most wide context possible. verify with extensions.conf file before changing. default is default.
<BR>
<A NAME="phones-phone_context">
<BR>
<B>Phone Context -</B> This is the dial plan context that this phone will use to dial out. If you are running a call center and you do not want your agents to be able to dial out outside of the ViciDial applicaiton for example, then you would set this field to a dialplan context that does not exist, something like agent-nodial. default is default.
<BR>
<A NAME="phones-codecs_list">
<BR>
<B>Allowed Codecs -</B> You can define a comma delimited list of codecs to be set as the default codecs for this phone. Options for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Some of these codecs might not be available on your system, like g729 or g726. If the field is empty, then the system default codecs or the phone entry above this one will be used for the allowable codecs. Default is empty.
<BR>
<A NAME="phones-codecs_with_template">
<BR>
<B>Allowed Codecs With Template-</B> Setting this option to 1 will include the codecs defined above even if a conf file template is used. Default is 0.
<BR>
<A NAME="phones-dtmf_send_extension">
<BR>
<B>DTMF send Channel -</B> This is the channel string used to send DTMF sounds into meetme conferences from the client apps. Verify the exten and context with the extensions.conf file.
<BR>
<A NAME="phones-call_out_number_group">
<BR>
<B>Outbound Call Group -</B> This is the channel group that outbound calls from this phone are placed out of. There are a couple routines in the client apps that use this. For Zap channels you want to use something like Zap/g2 , for IAX2 trunks you would want to use the full IAX prefix like IAX2/VICItest1:secret@10.10.10.15:4569. Verify the trunks with the extensions.conf file, it is usually what you have defined as the TRUNK global variable at the top of the file.
<BR>
<A NAME="phones-client_browser">
<BR>
<B>Browser Location -</B> This is applicable to only UNIX/LINUX clients, the absolute path to Mozilla or Firefox browser on the machine. verify this by launching it manually.
<BR>
<A NAME="phones-install_directory">
<BR>
<B>Install Directory -</B> This is the place where the astGUIclient and astVICIDIAL scripts are located on your machine. For Win32 it should be something like C:\AST_VICI and for UNIX it should be something like /usr/local/perl_TK. verify this manually.
<BR>
<A NAME="phones-local_web_callerID_URL">
<BR>
<B>CallerID URL -</B> This is the web address of the page used to do custom callerID lookups. default testing address is: http://astguiclient.sf.net/test_callerid_output.php
<BR>
<A NAME="phones-VICIDIAL_web_URL">
<BR>
<B>VICIDIAL Default URL -</B> This is the web address of the page used to do custom VICIDIAL Web Form queries. default testing address is: http://astguiclient.sf.net/test_VICIDIAL_output.php
<BR>
<A NAME="phones-AGI_call_logging_enabled">
<BR>
<B>Call Logging -</B> This is set to true if the call_log.agi file is in place in the extensions.conf file for all outbound and hang up 'h' extensions to log all calls. This should always be 1 because it is manditory for many astGUIclient and VICIDIAL features to work properly.
<BR>
<A NAME="phones-user_switching_enabled">
<BR>
<B>User Switching -</B> Set to true to allow user to switch to another user account. NOTE: If user switches they can initiate recording on the new user's phone conversation
<BR>
<A NAME="phones-conferencing_enabled">
<BR>
<B>Conferencing -</B> Set to true to allow user to start conference calls with upto six external lines.
<BR>
<A NAME="phones-admin_hangup_enabled">
<BR>
<B>Admin Hang Up -</B> Set to true to allow user to be able to hang up any line at will through astGUIclient. Good idea only to enable this for Admin users.
<BR>
<A NAME="phones-admin_hijack_enabled">
<BR>
<B>Admin Hijack -</B> Set to true to allow user to be able to grab and redirect to their extension any line at will through astGUIclient. Good idea only to enable this for Admin users. But is very useful for Managers.
<BR>
<A NAME="phones-admin_monitor_enabled">
<BR>
<B>Admin Monitor -</B> Set to true to allow user to be able to grab and redirect to their extension any line at will through astGUIclient. Good idea only to enable this for Admin users. But is very useful for Managers and as a training tool.
<BR>
<A NAME="phones-call_parking_enabled">
<BR>
<B>Call Park -</B> Set to true to allow user to be able to park calls on astGUIclient hold to be picked up by any other astGUIclient user on the system. Calls stay on hold for upto a half hour then hang up. Usually enabled for all.
<BR>
<A NAME="phones-updater_check_enabled">
<BR>
<B>Updater Check -</B> Set to true to display a popup warning that the updater time has not changed in 20 seconds. Useful for Admin users.
<BR>
<A NAME="phones-AFLogging_enabled">
<BR>
<B>AF Logging -</B> Set to true to log many actions of astGUIclient usage to a text file on the user's computer.
<BR>
<A NAME="phones-QUEUE_ACTION_enabled">
<BR>
<B>Queue Enabled -</B> Set to true to have client apps use the Asterisk Central Queue system. Required for VICIDIAL and recommended for all users.
<BR>
<A NAME="phones-CallerID_popup_enabled">
<BR>
<B>CallerID Popup -</B> Set to true to allow for numbers defined in the extensions.conf file to send CallerID popup screens to astGUIclient users.
<BR>
<A NAME="phones-voicemail_button_enabled">
<BR>
<B>VMail Button -</B> Set to true to display the VOICEMAIL button and the messages count display on astGUIclient.
<BR>
<A NAME="phones-enable_fast_refresh">
<BR>
<B>Fast Refresh -</B> Set to true to enable a new rate of refresh of call information for the astGUIclient. Default disabled rate is 1000 ms ,1 second. Can increase system load if you lower this number.
<BR>
<A NAME="phones-fast_refresh_rate">
<BR>
<B>Fast Refresh Rate -</B> in milliseconds. Only used if Fast Refresh is enabled. Default disabled rate is 1000 ms ,1 second. Can increase system load if you lower this number.
<BR>
<A NAME="phones-enable_persistant_mysql">
<BR>
<B>Persistant MySQL -</B> If enabled the astGUIclient connection will remain connected instead of connecting every second. Useful if you have a fast refresh rate set. It will increase the number of connections on your MySQL machine.
<BR>
<A NAME="phones-auto_dial_next_number">
<BR>
<B>Auto Dial Next Number -</B> If enabled the VICIDIAL client will dial the next number on the list automatically upon disposition of a call unless they selected to "Stop Dialing" on the disposition screen.
<BR>
<A NAME="phones-VDstop_rec_after_each_call">
<BR>
<B>Stop Rec after each call -</B> If enabled the VICIDIAL client will stop whatever recording is going on after each call has been dispositioned. Useful if you are doing a lot of recording or you are using a web form to trigger recording.
<BR>
<A NAME="phones-enable_sipsak_messages">
<BR>
<B>Enable SIPSAK Messages -</B> If enabled the server will send messages to the SIP phone to display on the phone LCD display when logged into VICIDIAL. Feature only works with SIP phones and requires sipsak application to be installed on the web server. Default is 0.
<BR>
<A NAME="phones-DBX_server">
<BR>
<B>DBX Server -</B> The MySQL database server that this user should be connecting to.
<BR>
<A NAME="phones-DBX_database">
<BR>
<B>DBX Database -</B> The MySQL database that this user should be connecting to. Default is asterisk.
<BR>
<A NAME="phones-DBX_user">
<BR>
<B>DBX User -</B> The MySQL user login that this user should be using when connecting. Default is cron.
<BR>
<A NAME="phones-DBX_pass">
<BR>
<B>DBX Pass -</B> The MySQL user password that this user should be using when connecting. Default is 1234.
<BR>
<A NAME="phones-DBX_port">
<BR>
<B>DBX Port -</B> The MySQL TCP port that this user should be using when connecting. Default is 3306.
<BR>
<A NAME="phones-DBY_server">
<BR>
<B>DBY Server -</B> The MySQL database server that this user should be connecting to. Secondary server, not used currently.
<BR>
<A NAME="phones-DBY_database">
<BR>
<B>DBY Database -</B> The MySQL database that this user should be connecting to. Default is asterisk. Secondary server, not used currently.
<BR>
<A NAME="phones-DBY_user">
<BR>
<B>DBY User -</B> The MySQL user login that this user should be using when connecting. Default is cron. Secondary server, not used currently.
<BR>
<A NAME="phones-DBY_pass">
<BR>
<B>DBY Pass -</B> The MySQL user password that this user should be using when connecting. Default is 1234. Secondary server, not used currently.
<BR>
<A NAME="phones-DBY_port">
<BR>
<B>DBY Port -</B> The MySQL TCP port that this user should be using when connecting. Default is 3306. Secondary server, not used currently.
<BR>
<A NAME="phones-alias_id">
<BR>
<B>Alias ID -</B> The ID of the alias used to allow for phone load balanced logins. no spaces or other special characters allowed. Must be between 2 and 20 characters in length.
<BR>
<A NAME="phones-alias_name">
<BR>
<B>Alias Name -</B> The name used to describe a phones alias, Must be between 2 and 50 characters in length.
<BR>
<A NAME="phones-logins_list">
<BR>
<B>Phones Logins List -</B> The comma separated list of phone logins used when an agent logs in using phone load balanced logins. The Agent application will find the active server with the fewest agents logged into it and place a call from that server to the agent upon login.
<BR>
<A NAME="phones-template_id">
<BR>
<B>Template ID -</B> This is the conf file template ID that this phone entry will use for its Asterisk settings. Default is --NONE--.
<BR>
<A NAME="phones-conf_override">
<BR>
<B>Conf Override Settings -</B> If populated, and the Template ID is set to --NONE-- then the contents of this field are used as the conf file entries for this phone. generate_vicidial_conf for this phones server must be set to Y for this to work. This field should NOT contain the [extension] line, that will be automatically generated.
<BR>
<A NAME="phones-group_alias_id">
<BR>
<B>Group Alias ID -</B> The ID of the group alias used by agents to dial out calls from the VICIDIAL agent interface with different Caller IDs. no spaces or other special characters allowed. Must be between 2 and 20 characters in length.
<BR>
<A NAME="phones-group_alias_name">
<BR>
<B>Group Alias Name -</B> The name used to describe a group alias, Must be between 2 and 50 characters in length.
<BR>
<A NAME="phones-caller_id_number">
<BR>
<B>Caller ID Number -</B> The Caller ID number used in this Group Alias. Must be digits only.
<BR>
<A NAME="phones-caller_id_name">
<BR>
<B>Caller ID Name -</B> The Caller ID name that can be sent out with this Group Alias. As far as we know this will only work in Canada on PRI circuits and using an IAX loop trunk through Asterisk.
<BR><BR><BR><BR>
<B><FONT SIZE=3>SERVERS TABLE</FONT></B><BR><BR>
<A NAME="servers-server_id">
<BR>
<B>Server ID -</B> This field is where you put the Asterisk servers name, doesnt have to be an official domain sub, just a nickname to identify the server to Admin users.
<BR>
<A NAME="servers-server_description">
<BR>
<B>Server Description -</B> The field where you use a small phrase to describe the Asterisk server.
<BR>
<A NAME="servers-server_ip">
<BR>
<B>Server IP Address -</B> The field where you put the Network IP address of the Asterisk server.
<BR>
<A NAME="servers-active">
<BR>
<B>Active -</B> Set whether the Asterisk server is active or inactive.
<BR>
<A NAME="servers-sysload">
<BR>
<B>System Load -</B> These two statistics show the loadavg of a system times 100 and the CPU usage percentage of the server and is updated every minute. The loadavg should on average be below 100 multiplied by the number of CPU cores your system has, for optimal performance. The CPU usage percentage should stay below 50 for optimal performance.
<BR>
<A NAME="servers-channels_total">
<BR>
<B>Live Channels -</B> This field shows the current number of Asterisk channels that are live on the system right now. It is important to note that the number of Asterisk channels is usually much higher than the number of actual calls on a system. This field is updated once every minute.
<BR>
<A NAME="servers-disk_usage">
<BR>
<B>Disk Usage -</B> This field will show the disk usage for every partition on this server. This field is updated once every minute.
<BR>
<A NAME="servers-asterisk_version">
<BR>
<B>Asterisk Version -</B> Set the version of Asterisk that you have installed on this server. Examples: '1.2', '1.0.8', '1.0.7', 'CVS_HEAD', 'REALLY OLD', etc... This is used because versions 1.0.8 and 1.0.9 have a different method of dealing with Local/ channels, a bug that has been fixed in CVS v1.0, and need to be treated differently when handling their Local/ channels. Also, current CVS_HEAD and the 1.2 release tree uses different manager and command output so it must be treated differently as well.
<BR>
<A NAME="servers-max_vicidial_trunks">
<BR>
<B>Max VICIDIAL Trunks -</B> This field will determine the maximum number of lines that the VICIDIAL auto-dialer will attempt to call on this server. If you want to dedicate two full PRI T1s to VICIDIALing on a server then you would set this to 46. Default is 96.
<BR>
<A NAME="servers-outbound_calls_per_second">
<BR>
<B>Max Calls per Second -</B> This setting determines the maximum number of calls that can be placed by the outbound auto-dialing script on this server per second. Must be from 1 to 100. Default is 20.
<BR>
<A NAME="servers-telnet_host">
<BR>
<B>Telnet Host -</B> This is the address or name of the Asterisk server and is how the manager applications connect to it from where they are running. If they are running on the Asterisk server, then the default of 'localhost' is fine.
<BR>
<A NAME="servers-telnet_port">
<BR>
<B>Telnet Port -</B> This is the port of the Asterisk server Manager connection and is how the manager applications connect to it from where they are running. The default of '5038' is fine for a standard install.
<BR>
<A NAME="servers-ASTmgrUSERNAME">
<BR>
<B>Manager User -</B> The username or login used to connect genericly to the Asterisk server manager. Default is 'cron'
<BR>
<A NAME="servers-ASTmgrSECRET">
<BR>
<B>Manager Secret -</B> The secret or password used to connect genericly to the Asterisk server manager. Default is '1234'
<BR>
<A NAME="servers-ASTmgrUSERNAMEupdate">
<BR>
<B>Manager Update User -</B> The username or login used to connect to the Asterisk server manager optimized for the Update scripts. Default is 'updatecron' and assumes the same secret as the generic user.
<BR>
<A NAME="servers-ASTmgrUSERNAMElisten">
<BR>
<B>Manager Listen User -</B> The username or login used to connect to the Asterisk server manager optimized for scripts that only listen for output. Default is 'listencron' and assumes the same secret as the generic user.
<BR>
<A NAME="servers-ASTmgrUSERNAMEsend">
<BR>
<B>Manager Send User -</B> The username or login used to connect to the Asterisk server manager optimized for scripts that only send Actions to the manager. Default is 'sendcron' and assumes the same secret as the generic user.
<BR>
<A NAME="servers-conf_secret">
<BR>
<B>Conf File Secret -</B> This is the secret, or password, for the server in the iax auto-generated conf file for this server on other servers. Limit is 20 characters alphanumeric dash and underscore accepted. Default is test. A strong conf file secret should be at least 8 characters in length and have lower case and upper case letters as well as at least one number.
<BR>
<A NAME="servers-local_gmt">
<BR>
<B>Server GMT offset -</B> The difference in hours from GMT time not adjusted for Daylight-Savings-Time of the server. Default is '-5'
<BR>
<A NAME="servers-voicemail_dump_exten">
<BR>
<B>VMail Dump Exten -</B> The extension prefix used on this server to send calls directly through agc to a specific voicemail box. Default is '85026666666666'
<BR>
<A NAME="servers-answer_transfer_agent">
<BR>
<B>VICIDIAL AD extension -</B> The default extension if none is present in the campaign to send calls to for VICIDIAL auto dialing. Default is '8365'
<BR>
<A NAME="servers-ext_context">
<BR>
<B>Default Context -</B> The default dial plan context used for scripts that operate for this server. Default is 'default'
<BR>
<A NAME="servers-sys_perf_log">
<BR>
<B>System Performance -</B> Setting this option to Y will enable logging of system performance stats for the server machine including system load, system processes and Asterisk channels in use. Default is N.
<BR>
<A NAME="servers-vd_server_logs">
<BR>
<B>Server Logs -</B> Setting this option to Y will enable logging of all VICIDIAL related scripts to their text log files. Setting this to N will stop writing logs to files for these processes, also the screen logging of asterisk will be disabled if this is set to N when Asterisk is started. Default is Y.
<BR>
<A NAME="servers-agi_output">
<BR>
<B>AGI Output -</B> Setting this option to NONE will disable output from all VICIDIAL related AGI scripts. Setting this to STDERR will send the AGI output to the Asterisk CLI. Setting this to FILE will send the output to a file in the logs directory. Setting this to BOTH will send output to both the Asterisk CLI and a log file. Default is FILE.
<BR>
<A NAME="servers-vicidial_balance_active">
<BR>
<B>VICIDIAL Balance Dialing -</B> Setting this field to Y will allow the server to place balance calls for campaigns in VICIDIAL so that the defined dial level can be met even if there are no agents logged into that campaign on this server. Default is N.
<BR>
<A NAME="servers-vicidial_balance_rank">
<BR>
<B>VICIDIAL Balance Rank -</B> This field allows you to set the order in which this server is to be used for balance dialing, if balance dialing is enabled. The server with the highest rank will be used first in placing Balance fill calls. Default is 0.
<BR>
<A NAME="servers-balance_trunks_offlimits">
<BR>
<B>VICIDIAL Balance Offlimits -</B> This setting defines the number of trunks to not allow VICIDIAL balance dialing to use. For example if you have 40 max vicidial trunks and balance offlimits is set to 10 you will only be able to use 30 trunk lines for VICIDIAL balance dialing. Default is 0.
<BR>
<A NAME="servers-recording_web_link">
<BR>
<B>Recording Web Link -</B> This setting allows you to override the default of the display of the recording link in the admin web pages. Default is SERVER_IP.
<BR>
<A NAME="servers-alt_server_ip">
<BR>
<B>Alternate Recording Server IP -</B> This setting is where you can put a server IP or other machine name that can be used in place of the server_ip in the links to recordings within the admin web pages. Default is empty.
<BR>
<A NAME="servers-external_server_ip">
<BR>
<B>External Server IP -</B> This setting is where you can put a server IP or other machine name that can be used in place of the server_ip when using a webphone in the agent interface. For this to work you also must have the phones entry set to use the External Server IP. Default is empty.
<BR>
<A NAME="servers-active_twin_server_ip">
<BR>
<B>Active Twin Server IP -</B> Some vicidial systems require setting up vicidial servers in pairs. This setting is where you can put the server IP of another vicidial server that this server is twinned with. Default is empty for disabled.
<BR>
<A NAME="servers-active_asterisk_server">
<BR>
<B>Active Asterisk Server -</B> If Asterisk is not running on this server, or if VICIDIAL should not be using this server, or if are only using this server for other scripts like the hopper loading script you would want to set this to N. Default is Y.
<BR>
<A NAME="servers-active_agent_login_server">
<BR>
<B>Active Agent Server -</B> Setting this option to N will prevent agents from being able to login to this server through the vicidial agent screen. This is very useful when using a phone login load balanced setup. Default is Y.
<BR>
<A NAME="servers-generate_vicidial_conf">
<BR>
<B>Generate conf files -</B> If you would like the system to auto-generate asterisk conf files based upon the phones entries, carrier entries and load balancing setup within VICIDIAL then set this to Y. Default is Y.
<BR>
<A NAME="servers-rebuild_conf_files">
<BR>
<B>Rebuild conf files -</B> If you want to force a rebuilding of the Asterisk conf files or if any of the phones or carrier entries have changed then this should be set to Y. After the conf files have been generated and Asterisk has been reloaded then this will be changed to N. Default is Y.
<BR>
<A NAME="servers-rebuild_music_on_hold">
<BR>
<B>Rebuild Music On Hold -</B> If you want to force a rebuilding of the music on hold files or if the music on hold entries or server entries have changed then this should be set to Y. After the music on hold files have been synchronized and reloaded then this will be changed to N. Default is Y.
<BR>
<A NAME="servers-sounds_update">
<BR>
<B>Sounds Update -</B> If you want to force a check of the sound files on this server, and the central audio store is enabled as a system setting, then this field will allow the sounds updater to run at the next top of the minute. Any time an audio file is uploaded from the web interface this is automatically set to Y for all servers that have Asterisk active. Default is N.
<BR>
<A NAME="servers-vicidial_recording_limit">
<BR>
<B>ViciDial Recording Limit -</B> This field is where you set the maximum number of minutes that a call recording initiated by ViciDial can be. Default is 60 minutes.
<BR>
<A NAME="servers-carrier_logging_active">
<BR>
<B>Carrier Logging Active -</B> This setting allows you to log all hangup return codes for any outbound list dialing calls that you are placing. Default is N.
<BR>
<A NAME="servers-custom_dialplan_entry">
<BR>
<B>Custom Dialplan Entry -</B> This field allows you to enter in any dialplan elements that you want for the server, the lines will be added to the default context.
<BR><BR><BR><BR>
<B><FONT SIZE=3>vicidial_conf_templates TABLE</FONT></B><BR><BR>
<A NAME="vicidial_conf_templates-template_id">
<BR>
<B>Template ID -</B> This field needs to be at least 2 characters in length and no more than 15 characters in length, no spaces. This is the ID that will be used to identify the conf template throughout the system.
<BR>
<A NAME="vicidial_conf_templates-template_name">
<BR>
<B>Template Name -</B> This is the descriptive name of the conf file template entry.
<BR>
<A NAME="vicidial_conf_templates-template_contents">
<BR>
<B>Template Contents -</B> This field is where you can enter in the specific settings to be used by all phones and-or carriers that are set to use this conf template. Fields that should NOT be included in this box are: secret, accountcode, account, username and mailbox.
<BR><BR><BR><BR>
<B><FONT SIZE=3>vicidial_server_carriers TABLE</FONT></B><BR><BR>
<A NAME="vicidial_server_carriers-carrier_id">
<BR>
<B>Carrier ID -</B> This field needs to be at least 2 characters in length and no more than 15 characters in length, no spaces. This is the ID that will be used to identify the carrier for this specific entry throughout the system.
<BR>
<A NAME="vicidial_server_carriers-carrier_name">
<BR>
<B>Carrier Name -</B> This is the descriptive name of the carrier entry.
<BR>
<A NAME="vicidial_server_carriers-carrier_description">
<BR>
<B>Carrier Description -</B> This is put in the comments of the asterisk conf files above the dialplan and account entries. Maximum 255 characters.
<BR>
<A NAME="vicidial_server_carriers-registration_string">
<BR>
<B>Registration String -</B> This field is where you can enter in the exact string needed in the IAX or SIP configuration file to register to the provider. Optional but highly recommended if your carrier allows registration.
<BR>
<A NAME="vicidial_server_carriers-template_id">
<BR>
<B>Template ID -</B> This optional field allows you to choose a conf file template for this carrier entry.
<BR>
<A NAME="vicidial_server_carriers-account_entry">
<BR>
<B>Account Entry -</B> This field is used if you have not selected a template to use, and it is where you can enter in the specific account settings to be used for this carrier. If you will be taking in inbound calls from this carrier trunk you might want to set the context=trunkinbound within this field so that you can use the DID handling process within VICIDIAL.
<BR>
<A NAME="vicidial_server_carriers-protocol">
<BR>
<B>Protocol -</B> This field allows you to define the protocol to use for the carrier entry. Currently only IAX and SIP are supported.
<BR>
<A NAME="vicidial_server_carriers-globals_string">
<BR>
<B>Globals String -</B> This optional field allows you to define a global variable to use for the carrier in the dialplan.
<BR>
<A NAME="vicidial_server_carriers-dialplan_entry">
<BR>
<B>Dialplan Entry -</B> This optional field allows you to define a set of dialplan entries to use for this carrier.
<BR>
<A NAME="vicidial_server_carriers-server_ip">
<BR>
<B>Server IP -</B> This is the server that this specific carrier record is associated with.
<BR>
<A NAME="vicidial_server_carriers-active">
<BR>
<B>Active -</B> This defines whether the carrier will be included in the auto-generated conf files or not.
<BR><BR><BR><BR>
<B><FONT SIZE=3>CONFERENCES TABLE</FONT></B><BR><BR>
<A NAME="conferences-conf_exten">
<BR>
<B>Conference Number -</B> This field is where you put the meetme conference dialpna number. It is also recommended that the meetme number in meetme.conf matches this number for each entry. This is for the conferences in astGUIclient and is used for leave-3way-call functionality in VICIDIAL.
<BR>
<A NAME="conferences-server_ip">
<BR>
<B>Server IP -</B> The menu where you select the Asterisk server that this conference will be on.
<?php
if ($SSoutbound_autodial_active > 0)
{
?>
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_SERVER_TRUNKS TABLE</FONT></B><BR><BR>
<A NAME="vicidial_server_trunks">
<BR>
<B>VICIDIAL Server Trunks allows you to restrict the outgoing lines that are used on this server for campaign dialing on a per-campaign basis. You have the option to reserve a specific number of lines to be used by only one campaign as well as allowing that campaign to run over its reserved lines into whatever lines remain open, as long at the total lines used by vicidial on this server is less than the Max VICIDIAL Trunks setting. Not having any of these records will allow the campaign that dials the line first to have as many lines as it can get under the Max VICIDIAL Trunks setting.</B>
<?php
}
?>
<BR><BR><BR><BR>
<B><FONT SIZE=3>SYSTEM_SETTINGS TABLE</FONT></B><BR><BR>
<A NAME="settings-use_non_latin">
<BR>
<B>Use Non-Latin -</B> This option allows you to default the web display script to use UTF8 characters and not do any latin-character-family regular expression filtering or display formatting. Default is 0.
<BR>
<A NAME="settings-webroot_writable">
<BR>
<B>Webroot Writable -</B> This setting allows you to define whether temp files and authentication files should be placed in the webroot on your web server. Default is 1.
<BR>
<A NAME="settings-vicidial_agent_disable">
<BR>
<B>VICIDIAL Agent Disable Display -</B> This field is used to select when to show an agent when their session has been disabled by the system, a manager action or by an external measure. The NOT_ACTIVE setting will disable the message on the agents screen. The LIVE_AGENT setting will only display the disabled message when the agents vicidial_auto_calls record has been removed, such as during a force logout or emergency logout.
<BR>
<A NAME="settings-allow_sipsak_messages">
<BR>
<B>Allow SIPSAK Messages -</B> If set to 1, this will allow the phones table setting to work properly, the server will send messages to the SIP phone to display on the phone LCD display when logged into VICIDIAL. This feature only works with SIP phones and requires sipsak application to be installed on the web server. Default is 0.
<BR>
<A NAME="settings-vdc_agent_api_active">
<BR>
<B>Agent API Active -</B> If set to 1, this will allow the Agent API interface to function. Default is 0.
<BR>
<A NAME="settings-admin_home_url">
<BR>
<B>Admin Home URL -</B> This is the URL or web site address that you will go to if you click on the HOME link at the top of the admin.php page.
<BR>
<A NAME="settings-admin_modify_refresh">
<BR>
<B>Admin Modify Auto-Refresh -</B> This is the refresh interval in seconds of the modify screens in this admin interface. Setting this to 0 will disable it, setting it below 5 will mostly make the modify screens unusable because they will refresh too quickly to change fields. This option is useful in situations where more than one manager is controlling settings on an active campaign or in-group so that the settings are refreshed frequently. Default is 0.
<BR>
<A NAME="settings-nocache_admin">
<BR>
<B>Admin No-Cache -</B> Setting this to 1 will set all admin pages to web browser no-cache, so every screen has to be reloaded every time it is viewed, even if clicking back on the browser. Default is 0 for disabled.
<BR>
<A NAME="settings-enable_agc_xfer_log">
<BR>
<B>Enable Agent Transfer Logfile -</B> This option will log to a text logfile on the webserver every time a call is transferred to an agent. Default is 0, disabled.
<BR>
<A NAME="settings-enable_agc_dispo_log">
<BR>
<B>Enable Agent Disposition Logfile -</B> This option will log to a text logfile on the webserver every time a call is dispositioned by an agent. Default is 0, disabled.
<BR>
<A NAME="settings-timeclock_end_of_day">
<BR>
<B>Timeclock End Of Day -</B> This setting defines when all users are to be auto logged out of the timeclock system. Only runs once a day. must be only 4 digits 2 digit hour and 2 digit minutes in 24 hour time. Default is 0000.
<BR>
<A NAME="settings-default_local_gmt">
<BR>
<B>Default Local GMT -</B> This setting defines what will be used by default when new phones and servers are added using this admin web interface. Default is -5.
<BR>
<A NAME="settings-default_voicemail_timezone">
<BR>
<B>Default Voicemail Zone -</B> This setting defines what zone will be used by default when new phones and voicemail boxes are created. The list of available zones is directly taken from the voicemail.conf file. Default is eastern.
<BR>
<A NAME="settings-agents_calls_reset">
<BR>
<B>Agents Calls Reset -</B> This setting defines whether the logged-in agents and active phone calls records are to be reset at the timeclock end of day. Default is 1 for enabled.
<BR>
<A NAME="settings-timeclock_last_reset_date">
<BR>
<B>Timeclock Last Auto Logout -</B> This field displays the date of the last auto-logout.
<BR>
<A NAME="settings-vdc_header_date_format">
<BR>
<B>Agent Screen Header Date Format -</B> This menu allows you to choose the format of the date that shows up at the top of the VICIDIAL agent screen. The options for this setting are: default is MS_DASH_24HR<BR>
MS_DASH_24HR 2008-06-24 23:59:59 - Default date format with year month day followed by 24 hour time<BR>
US_SLASH_24HR 06/24/2008 23:59:59 - USA date format with month day year followed by 24 hour time<BR>
EU_SLASH_24HR 24/06/2008 23:59:59 - European date format with day month year followed by 24 hour time<BR>
AL_TEXT_24HR JUN 24 23:59:59 - Text date format with abbreviated month day followed by 24 hour time<BR>
MS_DASH_AMPM 2008-06-24 11:59:59 PM - Default date format with year month day followed by 12 hour time<BR>
US_SLASH_AMPM 06/24/2008 11:59:59 PM - USA date format with month day year followed by 12 hour time<BR>
EU_SLASH_AMPM 24/06/2008 11:59:59 PM - European date format with day month year followed by 12 hour time<BR>
AL_TEXT_AMPM JUN 24 11:59:59 PM - Text date format with abbreviated month day followed by 12 hour time<BR>
<BR>
<A NAME="settings-vdc_customer_date_format">
<BR>
<B>Agent Screen Customer Date Format -</B> This menu allows you to choose the format of the customer time zone date that shows up at the top of the Customer Information section of the VICIDIAL agent screen. The options for this setting are: default is AL_TEXT_AMPM<BR>
MS_DASH_24HR 2008-06-24 23:59:59 - Default date format with year month day followed by 24 hour time<BR>
US_SLASH_24HR 06/24/2008 23:59:59 - USA date format with month day year followed by 24 hour time<BR>
EU_SLASH_24HR 24/06/2008 23:59:59 - European date format with day month year followed by 24 hour time<BR>
AL_TEXT_24HR JUN 24 23:59:59 - Text date format with abbreviated month day followed by 24 hour time<BR>
MS_DASH_AMPM 2008-06-24 11:59:59 PM - Default date format with year month day followed by 12 hour time<BR>
US_SLASH_AMPM 06/24/2008 11:59:59 PM - USA date format with month day year followed by 12 hour time<BR>
EU_SLASH_AMPM 24/06/2008 11:59:59 PM - European date format with day month year followed by 12 hour time<BR>
AL_TEXT_AMPM JUN 24 11:59:59 PM - Text date format with abbreviated month day followed by 12 hour time<BR>
<BR>
<A NAME="settings-vdc_header_phone_format">
<BR>
<B>Agent Screen Customer Phone Format -</B> This menu allows you to choose the format of the customer phone number that shows up in the status section of the VICIDIAL agent screen. The options for this setting are: default is US_PARN<BR>
US_DASH 000-000-0000 - USA dash separated phone number<BR>
US_PARN (000)000-0000 - USA dash separated number with area code in parenthesis<BR>
MS_NODS 0000000000 - No formatting<BR>
UK_DASH 00 0000-0000 - UK dash separated phone number with space after city code<BR>
AU_SPAC 000 000 000 - Australia space separated phone number<BR>
IT_DASH 0000-000-000 - Italy dash separated phone number<BR>
FR_SPAC 00 00 00 00 00 - France space separated phone number<BR>
<BR>
<A NAME="settings-vdc_agent_api_active">
<BR>
<B>Agent interface API Access Active -</B> This option allows you to enable or disable the agent interface API. Default is 0.
<BR>
<A NAME="settings-agentonly_callback_campaign_lock">
<BR>
<B>Agent Only Callback Campaign Lock -</B> This option defines whether AGENTONLY callbacks are locked to the campaign that the agent originally created them under. Setting this to 1 means that the agent can only dial them from the campaign they were set under, 0 means that the agent can access them no matter what campaign they are logged into. Default is 1.
<BR>
<A NAME="settings-sounds_central_control_active">
<BR>
<B>Central Sound Control Active -</B> This option defines whether the sound synchronization system is active across all servers. Default is 0 for inactive.
<BR>
<A NAME="settings-sounds_web_server">
<BR>
<B>Sounds Web Server -</B> This is the server name or IP address of the web server that will be handling the sound files on this system, this must match the server name or IP of the machine you are trying to access the audio_store.php webpage on or it will not work. Default is 127.0.0.1.
<BR>
<A NAME="settings-sounds_web_directory">
<BR>
<B>Sounds Web Directory -</B> This auto-generated directory name is created at random by the system as the place that the audio store will be kept. All audio files will reside in this directory.
<BR>
<A NAME="settings-admin_web_directory">
<BR>
<B>Admin Web Directory -</B> This is the directory that your administation web content, like admin.php, are in. Default is vicidial. To figure out your Admin web directory, it is everything that is between the domain name and the admin.php in the URL on this page, without the beginning and ending slashes.
<BR>
<A NAME="settings-active_voicemail_server">
<BR>
<B>Active Voicemail Server -</B> In multi-server systems, this is the server that will handle all voicemail boxes. This server is also where the dial-in generated prompts will be uploaded from, the 8168 recordings.
<BR>
<A NAME="settings-outbound_autodial_active">
<BR>
<B>Outbound Auto-Dial Active -</B> This option allows you to enable or disable outbound auto-dialing within VICIDIAL, setting this field to 0 will remove the LISTS and FILTERS sections and many fields from the Campaign Modification screens. Manual entry dialing will still be allowable from within the agent screen, but no list dialing will be possible. Default is 1 for active.
<BR>
<A NAME="settings-auto_dial_limit">
<BR>
<B>Ratio Dial Limit -</B> This is the maximum limit of the auto dial level in the campaign screen.
<BR>
<A NAME="settings-outbound_calls_per_second">
<BR>
<B>Max FILL Calls per Second -</B> This setting determines the maximum number of calls that can be placed by the auto-FILL outbound auto-dialing script on for all servers, per second. Must be from 1 to 200. Default is 40.
<BR>
<A NAME="settings-allow_custom_dialplan">
<BR>
<B>Allow Custom Dialplan Entries -</B> This option allows you to enter custom dialplan lines into Call Menus, Servers and System Settings. Default is 0 for inactive.
<BR>
<A NAME="settings-generate_cross_server_exten">
<BR>
<B>Generate Cross-Server Phone Extensions -</B> This option if set to 1 will generate dialplan entries for every phone on a multi-server system. Default is 0 for inactive.
<BR>
<A NAME="settings-user_territories_active">
<BR>
<B>User Territories Active -</B> This setting allows you to enable the User Territories setttings from the user modification screen. This feature was added to allow for more integration with a customized Vtiger installation but can have applications in a pure ViciDial system as well. Default is 0 for disabled.
<BR>
<A NAME="settings-enable_second_webform">
<BR>
<B>Enable Second Webform -</B> This setting allows you to have a second web form for campaigns and in-groups in the agent interface. Default is 0 for disabled.
<BR>
<A NAME="settings-enable_tts_integration">
<BR>
<B>Enable TTS Integration -</B> This setting allows you to enable Text To Speech integration with Cepstral. This is currently only available for outbound Survey type campaigns. Default is 0 for disabled.
<BR>
<A NAME="settings-callcard_enabled">
<BR>
<B>Enable CallCard -</B> This setting enables the CallCard features with ViciDial to allow for callers to use pin numbers and card_ids that have a balance of minutes and those balances can have agent talk time on customer calls to in-groups deducted. Default is 0 for disabled.
<BR>
<A NAME="settings-custom_fields_enabled">
<BR>
<B>Enable Custom List Fields -</B> This setting enables the custom list fields feature that allows for custom data fields to be defined in the administration web interface on a per-list basis and then have those fields available in a FORM tab to the agent in the agent web interface. Default is 0 for disabled.
<BR>
<A NAME="settings-test_campaign_calls">
<BR>
<B>Enable Campaign Test Calls -</B> This setting enables the ability to enter a phone code and phone number into fields at the bottom of the Campaign Detail screen and place a phone call to that number as if it were a lead being auto-dialed in the system. The phone number will be stored as a new lead in the manual dial list ID list. The campaign must be active for this feature to be enabled, and it is recommended that the lists assigned to the campaign all be set to inactive. The dial prefix, dial timeout and all other dialing related features, except for DNC and call time options, will affect the dialing of the test number. The phone call will be placed on the server selected as the voicemail server in the system settings. Default is 0 for disabled.
<BR>
<A NAME="settings-first_login_trigger">
<BR>
<B>First Login Trigger -</B> This setting allows for the initial configuration of the server screen to be shown to the administrator when they first log into the system.
<BR>
<A NAME="settings-default_phone_registration_password">
<BR>
<B>Default Phone Registration Password -</B> This is the default registration password used when new phones are added to the system. Default is test.
<BR>
<A NAME="settings-default_phone_login_password">
<BR>
<B>Default Phone Login Password -</B> This is the default phone web login password used when new phones are added to the system. Default is test.
<BR>
<A NAME="settings-default_server_password">
<BR>
<B>Default Server Password -</B> This is the default server password used when new servers are added to the system. Default is test.
<BR>
<A NAME="settings-slave_db_server">
<BR>
<B>Slave Database Server -</B> If you have a MySQL slave database server then enter the local IP address for that server here. This option is currently only used by the selected reports in the next option and has nothing to do with automatically configuring MySQL master-slave replication. Default is empty for disabled.
<BR>
<A NAME="settings-reports_use_slave_db">
<BR>
<B>Reports to use Slave DB -</B> This option allows you to select the reports that you want to have use the MySQL slave database as defined in the option above instead of the master database that your live ViciDial system is running on. You must set up the MySQL slave replication before you can enable this option. Default is empty for disabled.
<BR>
<A NAME="settings-default_field_labels">
<BR>
<B>Default Field Labels -</B> These 19 fields allow you to set the name as it will appear in the ViciDial agent interface as well as the administrative modify lead page. Default is empty which will use the hard-coded defaults in the agent interface. You can also set a label to ---HIDE--- to hide both the label and the field.
<BR>
<A NAME="settings-label_hide_field_logs">
<BR>
<B>Hide Label in Call Logs -</B> If a label is set to ---HIDE--- then the agent call logs, if enabled on the campaign, will still show the field and data unless this option is set to Y. Default is N.
<BR>
<A NAME="settings-qc_features_active">
<BR>
<B>QC Features Active -</B> This option allows you to enable or disable the QC or Quality Control features. Default is 0 for inactive.
<BR>
<A NAME="settings-default_webphone">
<BR>
<B>Default Webphone -</B> If set to 1, this option will make all new phones created have Set As Webphone set to Y. Default is 0.
<BR>
<A NAME="settings-webphone_systemkey">
<BR>
<B>Webphone System Key -</B> If your system or provider requires it, this is where the System Key for the webphone should be entered in. Default is empty.
<BR>
<A NAME="settings-default_codecs">
<BR>
<B>Default Codecs -</B> You can define a comma delimited list of codecs to be set as the default codecs for all systems. Options for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Default is empty.
<BR>
<A NAME="settings-custom_dialplan_entry">
<BR>
<B>Custom Dialplan Entry -</B> This field allows you to enter in any dialplan elements that you want for all of the asterisk servers, the lines will be added to the default context.
<BR>
<A NAME="settings-reload_dialplan_on_servers">
<BR>
<B>Reload Dialplan On Servers -</B> This option allows you to force a reload of the dialplan on all Asterisk servers in the cluster. If you made changes in the Custom Dialplan Entry above you should set this to 1 and submit to have those changes go into effect on the servers.
<BR>
<A NAME="settings-qc_features_active">
<BR>
<B>Default External Server IP -</B> If set to 1, this option will make all new phones created have Use External Server IP set to Y. Default is 0.
<BR>
<A NAME="settings-qc_features_active">
<BR>
<B>Webphone URL -</B> This is the URL of the webphone that will be used with this system if it is enabled in the phones record that an agent is using. Default is empty.
<BR>
<A NAME="settings-enable_queuemetrics_logging">
<BR>
<B>Enable QueueMetrics Logging -</B> This setting allows you to define whether VICIDIAL will insert log entries into the queue_log database table as Asterisk Queues activity does. QueueMetrics is a standalone, closed-source statistical analysis program. You must have QueueMetrics already installed and configured before enabling this feature. Default is 0.
<BR>
<A NAME="settings-queuemetrics_server_ip">
<BR>
<B>QueueMetrics Server IP -</B> This is the IP address of the database for your QueueMetrics installation.
<BR>
<A NAME="settings-queuemetrics_dbname">
<BR>
<B>QueueMetrics Database Name -</B> This is the database name for your QueueMetrics database.
<BR>
<A NAME="settings-queuemetrics_login">
<BR>
<B>QueueMetrics Database Login -</B> This is the user name used to log in to your QueueMetrics database.
<BR>
<A NAME="settings-queuemetrics_pass">
<BR>
<B>QueueMetrics Database Password -</B> This is the password used to log in to your QueueMetrics database.
<BR>
<A NAME="settings-queuemetrics_url">
<BR>
<B>QueueMetrics URL -</B> This is the URL or web site address used to get to your QueueMetrics installation.
<BR>
<A NAME="settings-queuemetrics_log_id">
<BR>
<B>QueueMetrics Log ID -</B> This is the server ID that all VICIDIAL logs going into the QueueMetrics database will use as an identifier for each record.
<BR>
<A NAME="settings-queuemetrics_eq_prepend">
<BR>
<B>QueueMetrics EnterQueue Prepend -</B> This field is used to allow for prepending of one of the vicidial_list data fields in front of the phone number of the customer for customized QueueMetrics reports. Default is NONE to not populate anything.
<BR>
<A NAME="settings-queuemetrics_loginout">
<BR>
<B>QueueMetrics Login-Out -</B> This option affects how vicidial will log the logins and logouts of an agent in the queue_log. Default is STANDARD to use standard AGENTLOGIN AGENTLOGOFF, CALLBACK will use AGENTCALLBACKLOGIN and AGENTCALLBACKLOGOFF that QM will parse differently, NONE will not log any logins and logouts within queue_log.
<BR>
<A NAME="settings-queuemetrics_callstatus">
<BR>
<B>QueueMetrics CallStatus -</B> This option if set to 0 will not put in the CALLSTATUS entry into queue_log when an agent dispositions a call. Default is 1 for enabled.
<BR>
<A NAME="settings-queuemetrics_addmember_enabled">
<BR>
<B>QueueMetrics Addmember Enabled -</B> This option if set to 1 will generate ADDMEMBER2 and REMOVEMEMBER entries in queue_log. Default is 0 for disabled.
<BR>
<A NAME="settings-queuemetrics_dispo_pause">
<BR>
<B>QueueMetrics Dispo Pause Code -</B> This option, if populated, allows you to define whether a dispo pause code is entered into queue_log when an agent is in dispo status. Default is empty for disabled.
<BR>
<A NAME="settings-queuemetrics_pe_phone_append">
<BR>
<B>QueueMetrics Phone Environment Phone Append -</B> This option, if enabled, will append the agent phone login to the data4 record in the queue log table if the Campaign Phone Environment field is populated. Default is 0 for disabled.
<BR>
<A NAME="settings-enable_vtiger_integration">
<BR>
<B>Enable Vtiger Integration -</B> This setting allows you to enable Vtiger integration with VICIDIAL. Currently links to Vtiger admin and search as well as user replication are the only integration features available. Default is 0.
<BR>
<A NAME="settings-vtiger_server_ip">
<BR>
<B>Vtiger DB Server IP -</B> This is the IP address of the database for your Vtiger installation.
<BR>
<A NAME="settings-vtiger_dbname">
<BR>
<B>Vtiger Database Name -</B> This is the database name for your Vtiger database.
<BR>
<A NAME="settings-vtiger_login">
<BR>
<B>Vtiger Database Login -</B> This is the user name used to log in to your Vtiger database.
<BR>
<A NAME="settings-vtiger_pass">
<BR>
<B>Vtiger Database Password -</B> This is the password used to log in to your Vtiger database.
<BR>
<A NAME="settings-vtiger_url">
<BR>
<B>Vtiger URL -</B> This is the URL or web site address used to get to your Vtiger installation.
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_STATUSES TABLE</FONT></B><BR><BR>
<A NAME="vicidial_statuses">
<BR>
<B>Through the use of system statuses, you can have statuses that exist for campaign and in-group. The Status must be 1-6 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as an agent disposition. The human_answered field is used when calculating the drop percentage, or abandon rate. Setting human_answered to Y will use this status when counting the human-answered calls. The Category option allows you to group several statuses into a catogy that can be used for statistical analysis. There are also 5 additional settings that will define the kind of status: sale, dnc, customer contact, not interested, unworkable, scheduled callback.</B>
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_SCREEN_LABELS TABLE</FONT></B><BR><BR>
<A NAME="vicidial_screen_labels">
<BR>
<B>Screen labels give you the option of setting different labels for the default agent screen fields on a per campaign basis.</B>
<A NAME="vicidial_screen_labels-label_id">
<BR>
<B>Screen Label ID -</B> This field needs to be at least 2 characters in length and no more than 20 characters in length, no spaces or special characters. This is the ID that will be used to identify the screen label throughout the system.
<BR>
<A NAME="vicidial_screen_labels-label_name">
<BR>
<B>Screen Label Name -</B> This is the descriptive name of the screen label entry.
<BR>
<A NAME="vicidial_screen_labels-label_hide_field_logs">
<BR>
<B>Hide Label in Call Logs -</B> If a label is set to ---HIDE--- then the agent call logs, if enabled on the campaign, will still show the field and data unless this option is set to Y. Default is N.
<BR>
<A NAME="vicidial_screen_labels-default_field_labels">
<BR>
<B>Default Field Labels -</B> These 19 fields allow you to set the name as it will appear in the ViciDial agent interface as well as the administrative modify lead page. Default is empty which will use the hard-coded defaults in the agent interface. You can also set a label to ---HIDE--- to hide both the label and the field.
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_STATUS_CATEGORIES TABLE</FONT></B><BR><BR>
<A NAME="vicidial_status_categories">
<BR>
<B>Through the use of system status categories, you can group together statuses to allow for statistical analysis on a group of statuses. The Category ID must be 2-20 characters in length with no spaces, the name must be 2-50 characters in length, the description is optional and TimeonVDAD Display defines whether that status will be one of the upto 4 statuses that can be calculated and displayed on the Time On VDAD Real-Time report.</B> The Sale Category and Dead Lead Category are both used by the List Suggestion system when analyzing list statistics.
<?php
if ($SSqc_features_active > 0)
{
?>
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL QC STATUS CODES</FONT></B><BR><BR>
<A NAME="vicidial_qc_status_codes">
<BR>
<B>The Quality Control-QC system within VICIDIAL has its own set of status codes separate from those within the call handling functions of VICIDIAL. QC statuse codes must be between 2 and 8 characters in length and contain no special characters like a space or colon. The QC status code description must be between 2 and 30 characters in length.</B>
<?php
}
?>
<BR><BR><BR><BR><BR><BR><BR><BR>
<BR><BR><BR><BR><BR><BR><BR><BR>
THE END
</TD></TR></TABLE></BODY></HTML>
<?php
exit;
#### END HELP SCREENS
}
######################################################################################################
######################################################################################################
####### 7 series, filter count preview and script preview
######################################################################################################
######################################################################################################
######################
# ADD=73 view dialable leads from a filter and a campaign
######################
if ($ADD==73)
{
if ($LOGmodify_campaigns==1)
{
echo "</title>\n";
echo "</head>\n";
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT dial_statuses,local_call_time,lead_filter_id,drop_lockout_time from vicidial_campaigns where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$dial_statuses = $row[0];
$local_call_time = $row[1];
$drop_lockout_time = $row[3];
if ($lead_filter_id=='')
{
$lead_filter_id = $row[2];
if ($lead_filter_id=='')
{
$lead_filter_id='NONE';
}
}
$stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'";
$rslt=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rslt);
$camp_lists='';
$o=0;
while ($lists_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$o++;
if (ereg("Y", $rowx[1])) {$camp_lists .= "'$rowx[0]',";}
}
$camp_lists = eregi_replace(".$","",$camp_lists);
$filterSQL = $filtersql_list[$lead_filter_id];
$filterSQL = preg_replace("/\\\\/","",$filterSQL);
$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL);
if (strlen($filterSQL)>4)
{$fSQL = "and $filterSQL";}
else
{$fSQL = '';}
echo "<BR><BR>\n";
echo "<B>Show Dialable Leads Count</B> -<BR><BR>\n";
echo "<B>CAMPAIGN:</B> $campaign_id<BR>\n";
echo "<B>LISTS:</B> $camp_lists<BR>\n";
echo "<B>STATUSES:</B> $dial_statuses<BR>\n";
echo "<B>FILTER:</B> $lead_filter_id<BR>\n";
echo "<B>CALL TIME:</B> $local_call_time<BR><BR>\n";
### call function to calculate and print dialable leads
dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL);
echo "<BR><BR>\n";
echo "</BODY></HTML>\n";
exit;
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=7111111 view sample script with test variables
######################
if ($ADD==7111111)
{
##### TEST VARIABLES #####
$vendor_lead_code = 'VENDOR:LEAD;CODE';
$list_id = 'LISTID';
$list_name = 'LISTNAME';
$list_description = 'LISTDESCRIPTION';
$gmt_offset_now = 'GMTOFFSET';
$phone_code = '1';
$phone_number = '7275551212';
$title = 'Mr.';
$first_name = 'JOHN';
$middle_initial = 'Q';
$last_name = 'PUBLIC';
$address1 = '1234 Main St.';
$address2 = 'Apt. 3';
$address3 = 'ADDRESS3';
$city = 'CHICAGO';
$state = 'IL';
$province = 'PROVINCE';
$postal_code = '33760';
$country_code = 'USA';
$gender = 'M';
$date_of_birth = '1970-01-01';
$alt_phone = '3125551111';
$email = 'test@test.com';
$security_phrase = 'SECUTIRY';
$comments = 'COMMENTS FIELD';
$RGfullname = 'JOE AGENT';
$RGuser = '6666';
$RGlead_id = '1234';
$RGcampaign = 'TESTCAMP';
$RGphone_login = 'gs102';
$RGgroup = 'TESTCAMP';
$RGchannel_group = 'TESTCAMP';
$RGSQLdate = date("Y-m-d H:i:s");
$RGepoch = date("U");
$RGuniqueid = '1163095830.4136';
$RGcustomer_zap_channel = 'Zap/1-1';
$RGserver_ip = '10.10.10.15';
$RGSIPexten = 'SIP/gs102';
$RGsession_id = '8600051';
$RGdialed_number = '3125551111';
$RGdialed_label = 'ALT';
$RGrank = '99';
$RGowner = '6666';
$RGcamp_script = 'TESTSCRIPT';
$RGin_script = '';
$script_width = '600';
$script_height = '400';
$recording_filename = '20091204-1639_6666_7275551212';
$recording_id = '1235';
$user_custom_one = 'custom one';
$user_custom_two = 'custom two';
$user_custom_three = 'custom three';
$user_custom_four = 'custom four';
$user_custom_five = 'custom five';
$preset_number_a = 'preset_a';
$preset_number_b = 'preset_b';
$preset_number_c = 'preset_c';
$preset_number_d = 'preset_d';
$preset_number_e = 'preset_e';
$preset_number_f = 'preset_f';
$preset_dtmf_a = 'preset_dtmf_a';
$preset_dtmf_b = 'preset_dtmf_b';
$did_id = 'did_id';
$did_extension = 'did_extension';
$did_pattern = 'did_pattern';
$did_description = 'did_description';
$closecallid = 'closecallid';
$xfercallid = 'xfercallid';
$agent_log_id = 'agent_log_id';
$entry_list_id = 'entry_list_id';
echo "</title>\n";
echo "</head>\n";
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$script_name = $row[1];
$script_text = stripslashes($row[3]);
if (eregi("iframe src",$script_text))
{
$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);
$title = eregi_replace(' ','+',$title);
$first_name = eregi_replace(' ','+',$first_name);
$middle_initial = eregi_replace(' ','+',$middle_initial);
$last_name = eregi_replace(' ','+',$last_name);
$address1 = eregi_replace(' ','+',$address1);
$address2 = eregi_replace(' ','+',$address2);
$address3 = eregi_replace(' ','+',$address2);
$city = eregi_replace(' ','+',$city);
$state = eregi_replace(' ','+',$state);
$province = eregi_replace(' ','+',$province);
$postal_code = eregi_replace(' ','+',$postal_code);
$country_code = eregi_replace(' ','+',$country_code);
$gender = eregi_replace(' ','+',$gender);
$date_of_birth = eregi_replace(' ','+',$date_of_birth);
$alt_phone = eregi_replace(' ','+',$alt_phone);
$email = eregi_replace(' ','+',$email);
$security_phrase = eregi_replace(' ','+',$security_phrase);
$comments = eregi_replace(' ','+',$comments);
$RGfullname = eregi_replace(' ','+',$RGfullname);
$RGuser = eregi_replace(' ','+',$RGuser);
$RGlead_id = eregi_replace(' ','+',$RGlead_id);
$RGcampaign = eregi_replace(' ','+',$RGcampaign);
$RGphone_login = eregi_replace(' ','+',$RGphone_login);
$RGgroup = eregi_replace(' ','+',$RGgroup);
$RGchannel_group = eregi_replace(' ','+',$RGchannel_group);
$RGSQLdate = eregi_replace(' ','+',$RGSQLdate);
$RGepoch = eregi_replace(' ','+',$RGepoch);
$RGuniqueid = eregi_replace(' ','+',$RGuniqueid);
$RGcustomer_zap_channel = eregi_replace(' ','+',$RGcustomer_zap_channel);
$RGserver_ip = eregi_replace(' ','+',$RGserver_ip);
$RGSIPexten = eregi_replace(' ','+',$RGSIPexten);
$RGsession_id = eregi_replace(' ','+',$RGsession_id);
$RGdialed_number = eregi_replace(' ','+',$RGdialed_number);
$RGdialed_label = eregi_replace(' ','+',$RGdialed_label);
$RGrank = eregi_replace(' ','+',$RGrank);
$RGowner = eregi_replace(' ','+',$RGowner);
$RGcamp_script = eregi_replace(' ','+',$RGcamp_script);
$RGin_script = eregi_replace(' ','+',$RGin_script);
$script_width = eregi_replace(' ','+',$script_width);
$script_height = eregi_replace(' ','+',$script_height);
$recording_filename = eregi_replace(' ','+',$recording_filename);
$recording_id = eregi_replace(' ','+',$recording_id);
$user_custom_one = eregi_replace(' ','+',$user_custom_one);
$user_custom_two = eregi_replace(' ','+',$user_custom_two);
$user_custom_three = eregi_replace(' ','+',$user_custom_three);
$user_custom_four = eregi_replace(' ','+',$user_custom_four);
$user_custom_five = eregi_replace(' ','+',$user_custom_five);
$preset_number_a = eregi_replace(' ','+',$preset_number_a);
$preset_number_b = eregi_replace(' ','+',$preset_number_b);
$preset_number_c = eregi_replace(' ','+',$preset_number_c);
$preset_number_d = eregi_replace(' ','+',$preset_number_d);
$preset_number_e = eregi_replace(' ','+',$preset_number_e);
$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_description = eregi_replace(' ','+',$did_description);
}
$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);
$script_text = eregi_replace('--A--title--B--',"$title",$script_text);
$script_text = eregi_replace('--A--first_name--B--',"$first_name",$script_text);
$script_text = eregi_replace('--A--middle_initial--B--',"$middle_initial",$script_text);
$script_text = eregi_replace('--A--last_name--B--',"$last_name",$script_text);
$script_text = eregi_replace('--A--address1--B--',"$address1",$script_text);
$script_text = eregi_replace('--A--address2--B--',"$address2",$script_text);
$script_text = eregi_replace('--A--address3--B--',"$address3",$script_text);
$script_text = eregi_replace('--A--city--B--',"$city",$script_text);
$script_text = eregi_replace('--A--state--B--',"$state",$script_text);
$script_text = eregi_replace('--A--province--B--',"$province",$script_text);
$script_text = eregi_replace('--A--postal_code--B--',"$postal_code",$script_text);
$script_text = eregi_replace('--A--country_code--B--',"$country_code",$script_text);
$script_text = eregi_replace('--A--gender--B--',"$gender",$script_text);
$script_text = eregi_replace('--A--date_of_birth--B--',"$date_of_birth",$script_text);
$script_text = eregi_replace('--A--alt_phone--B--',"$alt_phone",$script_text);
$script_text = eregi_replace('--A--email--B--',"$email",$script_text);
$script_text = eregi_replace('--A--security_phrase--B--',"$security_phrase",$script_text);
$script_text = eregi_replace('--A--comments--B--',"$comments",$script_text);
$script_text = eregi_replace('--A--fullname--B--',"$RGfullname",$script_text);
$script_text = eregi_replace('--A--fronter--B--',"$RGuser",$script_text);
$script_text = eregi_replace('--A--user--B--',"$RGuser",$script_text);
$script_text = eregi_replace('--A--lead_id--B--',"$RGlead_id",$script_text);
$script_text = eregi_replace('--A--campaign--B--',"$RGcampaign",$script_text);
$script_text = eregi_replace('--A--phone_login--B--',"$RGphone_login",$script_text);
$script_text = eregi_replace('--A--group--B--',"$RGgroup",$script_text);
$script_text = eregi_replace('--A--channel_group--B--',"$RGchannel_group",$script_text);
$script_text = eregi_replace('--A--SQLdate--B--',"$RGSQLdate",$script_text);
$script_text = eregi_replace('--A--epoch--B--',"$RGepoch",$script_text);
$script_text = eregi_replace('--A--uniqueid--B--',"$RGuniqueid",$script_text);
$script_text = eregi_replace('--A--customer_zap_channel--B--',"$RGcustomer_zap_channel",$script_text);
$script_text = eregi_replace('--A--server_ip--B--',"$RGserver_ip",$script_text);
$script_text = eregi_replace('--A--SIPexten--B--',"$RGSIPexten",$script_text);
$script_text = eregi_replace('--A--session_id--B--',"$RGsession_id",$script_text);
$script_text = eregi_replace('--A--dialed_number--B--',"$RGdialed_number",$script_text);
$script_text = eregi_replace('--A--dialed_label--B--',"$RGdialed_label",$script_text);
$script_text = eregi_replace('--A--rank--B--',"$RGrank",$script_text);
$script_text = eregi_replace('--A--owner--B--',"$RGowner",$script_text);
$script_text = eregi_replace('--A--camp_script--B--',"$RGcamp_script",$script_text);
$script_text = eregi_replace('--A--in_script--B--',"$RGin_script",$script_text);
$script_text = eregi_replace('--A--script_width--B--',"$script_width",$script_text);
$script_text = eregi_replace('--A--script_height--B--',"$script_height",$script_text);
$script_text = eregi_replace('--A--recording_filename--B--',"$recording_filename",$script_text);
$script_text = eregi_replace('--A--recording_id--B--',"$recording_id",$script_text);
$script_text = eregi_replace('--A--user_custom_one--B--',"$user_custom_one",$script_text);
$script_text = eregi_replace('--A--user_custom_two--B--',"$user_custom_two",$script_text);
$script_text = eregi_replace('--A--user_custom_three--B--',"$user_custom_three",$script_text);
$script_text = eregi_replace('--A--user_custom_four--B--',"$user_custom_four",$script_text);
$script_text = eregi_replace('--A--user_custom_five--B--',"$user_custom_five",$script_text);
$script_text = eregi_replace('--A--preset_number_a--B--',"$preset_number_a",$script_text);
$script_text = eregi_replace('--A--preset_number_b--B--',"$preset_number_b",$script_text);
$script_text = eregi_replace('--A--preset_number_c--B--',"$preset_number_c",$script_text);
$script_text = eregi_replace('--A--preset_number_d--B--',"$preset_number_d",$script_text);
$script_text = eregi_replace('--A--preset_number_e--B--',"$preset_number_e",$script_text);
$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);
$script_text = eregi_replace("\n","<BR>",$script_text);
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "Preview Script: $script_id<BR>\n";
echo "<TABLE WIDTH=600><TR><TD>\n";
echo "<center><B>$script_name</B><BR></center>\n";
echo "$script_text\n";
echo "</TD></TR></TABLE></center>\n";
echo "</BODY></HTML>\n";
exit;
}
$ADMIN=$PHP_SELF;
require("admin_header.php");
if ( ($SSadmin_modify_refresh > 1) and (preg_match("/^3|^4/",$ADD)) )
{
echo "<span id=refresh_countdown></span><BR>";
}
######################################################################################################
######################################################################################################
####### 1 series, ADD NEW forms for inserting new records into the database
######################################################################################################
######################################################################################################
######################
# ADD=1 display the ADD NEW USER FORM SCREEN
######################
if ($ADD=="1")
{
if ($LOGmodify_users==1)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_users' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$voi_count = "$row[0]";
}
##### END ID override optional section #####
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD A NEW USER<form action=$PHP_SELF method=POST name=userform id=userform>\n";
echo "<input type=hidden name=ADD value=2>\n";
echo "<input type=hidden name=user_toggle id=user_toggle value=0>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
if ($voi_count > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>User Number: </td><td align=left>Auto-Generated <input type=hidden name=user id=user value=\"99999\">$NWB#vicidial_users-user$NWE</td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>User Number: </td><td align=left><input type=text name=user id=user size=20 maxlength=20> <input type=button name=auto_user value=\"AUTO-GENERATE\" onClick=\"user_auto()\"> $NWB#vicidial_users-user$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Password: </td><td align=left style=\"display:table-cell; vertical-align:middle;\"><input type=text id=reg_pass name=pass size=20 maxlength=20 onkeyup=\"return pwdChanged('reg_pass','reg_pass_img');\">$NWB#vicidial_users-pass$NWE &nbsp; &nbsp; Strength: <IMG id=reg_pass_img src='images/pixel.gif' style=\"vertical-align:middle;\" onLoad=\"return pwdChanged('reg_pass','reg_pass_img');\"></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Full Name: </td><td align=left><input type=text name=full_name size=20 maxlength=100>$NWB#vicidial_users-full_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>User Level: </td><td align=left><select size=1 name=user_level>";
$h=1;
while ($h<=$LOGuser_level)
{
echo "<option>$h</option>";
$h++;
}
echo "</select>$NWB#vicidial_users-user_level$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>User Group: </td><td align=left><select size=1 name=user_group>\n";
$stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group";
$rslt=mysql_query($stmt, $link);
$Ugroups_to_print = mysql_num_rows($rslt);
$Ugroups_list='';
$o=0;
while ($Ugroups_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$Ugroups_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "$Ugroups_list";
echo "<option SELECTED>$user_group</option>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Login: </td><td align=left><input type=text name=phone_login size=20 maxlength=20>$NWB#vicidial_users-phone_login$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Pass: </td><td align=left><input type=text name=phone_pass size=20 maxlength=20>$NWB#vicidial_users-phone_pass$NWE</td></tr>\n";
echo "</select>$NWB#vicidial_users-user_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=button name=SUBMIT value=SUBMIT onClick=\"user_submit()\"></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=1A display the COPY USER FORM SCREEN
######################
if ($ADD=="1A")
{
if ($LOGmodify_users==1)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_users' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$voi_count = "$row[0]";
}
##### END ID override optional section #####
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>COPY USER<form action=$PHP_SELF method=POST name=userform id=userform>\n";
echo "<input type=hidden name=ADD value=2A>\n";
echo "<input type=hidden name=user_toggle id=user_toggle value=0>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
if ($voi_count > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>User Number: </td><td align=left>Auto-Generated <input type=hidden name=user id=user value=\"99999\">$NWB#vicidial_users-user$NWE</td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>User Number: </td><td align=left><input type=text name=user id=user size=20 maxlength=20> <input type=button name=auto_user value=\"AUTO-GENERATE\" onClick=\"user_auto()\"> $NWB#vicidial_users-user$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Password: </td><td align=left style=\"display:table-cell; vertical-align:middle;\"><input type=text id=reg_pass name=pass size=20 maxlength=20 onkeyup=\"return pwdChanged('reg_pass','reg_pass_img');\">$NWB#vicidial_users-pass$NWE &nbsp; &nbsp; Strength: <IMG id=reg_pass_img src='images/pixel.gif' style=\"vertical-align:middle;\" onLoad=\"return pwdChanged('reg_pass','reg_pass_img');\"></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Full Name: </td><td align=left><input type=text name=full_name size=20 maxlength=100>$NWB#vicidial_users-full_name$NWE</td></tr>\n";
if ($LOGuser_level==9) {$levelMAX=10;}
else {$levelMAX=$LOGuser_level;}
echo "<tr bgcolor=#B6D3FC><td align=right>Source User: </td><td align=left><select size=1 name=source_user_id>\n";
$stmt="SELECT user,full_name from vicidial_users where user_level < $levelMAX order by full_name;";
$rslt=mysql_query($stmt, $link);
$Uusers_to_print = mysql_num_rows($rslt);
$Uusers_list='';
$o=0;
while ($Uusers_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$Uusers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "$Uusers_list";
echo "</select>$NWB#vicidial_users-user$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=button name=SUBMIT value=SUBMIT onClick=\"user_submit()\"></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=11 display the ADD NEW CAMPAIGN FORM SCREEN
######################
if ($ADD==11)
{
if ($LOGmodify_campaigns==1)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_campaigns' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$voi_count = "$row[0]";
}
##### END ID override optional section #####
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD A NEW CAMPAIGN<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=21>\n";
echo "<input type=hidden name=park_ext value=''>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
if ($voi_count > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign ID: </td><td align=left>Auto-Generated $NWB#vicidial_campaigns-campaign_id$NWE</td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign ID: </td><td align=left><input type=text name=campaign_id size=10 maxlength=8>$NWB#vicidial_campaigns-campaign_id$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Name: </td><td align=left><input type=text name=campaign_name size=30 maxlength=30>$NWB#vicidial_campaigns-campaign_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Description: </td><td align=left><input type=text name=campaign_description size=30 maxlength=255>$NWB#vicidial_campaigns-campaign_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option></select>$NWB#vicidial_campaigns-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Park Music-on-Hold: </td><td align=left><input type=text name=park_file_name id=park_file_name size=20 maxlength=100> <a href=\"javascript:launch_moh_chooser('park_file_name','moh',200);\">moh chooser</a> $NWB#vicidial_campaigns-park_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Web Form: </td><td align=left><input type=text name=web_form_address size=70 maxlength=1055>$NWB#vicidial_campaigns-web_form_address$NWE</td></tr>\n";
if ($SSoutbound_autodial_active > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Allow Closers: </td><td align=left><select size=1 name=allow_closers><option>Y</option><option>N</option></select>$NWB#vicidial_campaigns-allow_closers$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Minimum Hopper Level: </td><td align=left><select size=1 name=hopper_level><option>1</option><option>5</option><option>10</option><option>20</option><option>50</option><option>100</option><option>200</option><option>500</option><option>1000</option><option>2000</option></select>$NWB#vicidial_campaigns-hopper_level$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Auto Dial Level: </td><td align=left><select size=1 name=auto_dial_level><option selected>1</option>\n";
$adl=0;
while($adl <= $SSauto_dial_limit)
{
echo "<option>$adl</option>\n";
if ($adl < 1)
{$adl = ($adl + 1);}
else
{
if ($adl < 3)
{$adl = ($adl + 0.1);}
else
{
if ($adl < 4)
{$adl = ($adl + 0.25);}
else
{
if ($adl < 5)
{$adl = ($adl + 0.5);}
else
{
if ($adl < 10)
{$adl = ($adl + 1);}
else
{
if ($adl < 20)
{$adl = ($adl + 2);}
else
{
if ($adl < 40)
{$adl = ($adl + 5);}
else
{
if ($adl < 200)
{$adl = ($adl + 10);}
else
{
if ($adl < 400)
{$adl = ($adl + 50);}
else
{
if ($adl < 1000)
{$adl = ($adl + 100);}
else
{$adl = ($adl + 1);}
}
}
}
}
}
}
}
}
}
}
echo "<option>$adl</option></select>(0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>overall_user_level</option><option>campaign_rank</option><option>fewest_calls</option><option>longest_wait_time</option></select>$NWB#vicidial_campaigns-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Local Call Time: </td><td align=left><select size=1 name=local_call_time>";
echo "$call_times_list";
echo "</select>$NWB#vicidial_campaigns-local_call_time$NWE</td></tr>\n";
if ($SSoutbound_autodial_active > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Voicemail: </td><td align=left><input type=text name=voicemail_ext size=10 maxlength=10 value=\"$voicemail_ext\">$NWB#vicidial_campaigns-voicemail_ext$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Script: </td><td align=left><select size=1 name=script_id>\n";
echo "$scripts_list";
echo "</select>$NWB#vicidial_campaigns-campaign_script$NWE</td></tr>\n";
$eswHTML=''; $cfwHTML='';
if ($SSenable_second_webform > 0)
{$eswHTML = '<option>WEBFORMTWO</option>';}
if ($SScustom_fields_enabled > 0)
{$cfwHTML = '<option>FORM</option>';}
echo "<tr bgcolor=#B6D3FC><td align=right>Get Call Launch: </td><td align=left><select size=1 name=get_call_launch><option selected>NONE</option><option>SCRIPT</option><option>WEBFORM</option>$eswHTML$cfwHTML</select>$NWB#vicidial_campaigns-get_call_launch$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=12 display the COPY CAMPAIGN FORM SCREEN
######################
if ($ADD==12)
{
if ($LOGmodify_campaigns==1)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_campaigns' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$voi_count = "$row[0]";
}
##### END ID override optional section #####
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>COPY A CAMPAIGN<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=20>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
if ($voi_count > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign ID: </td><td align=left>Auto-Generated $NWB#vicidial_campaigns-campaign_id$NWE</td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign ID: </td><td align=left><input type=text name=campaign_id size=10 maxlength=8>$NWB#vicidial_campaigns-campaign_id$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Name: </td><td align=left><input type=text name=campaign_name size=30 maxlength=30>$NWB#vicidial_campaigns-campaign_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Source Campaign: </td><td align=left><select size=1 name=source_campaign_id>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$campaigns_list='';
$o=0;
while ($campaigns_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "$campaigns_list";
echo "</select>$NWB#vicidial_campaigns-campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>NOTE: Copying a campaign will copy all settings from the master campaign you select, but it will not copy a campaign-specific DNC list if there was one on the selected master campaign.</td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=111 display the ADD NEW LIST FORM SCREEN
######################
if ($ADD==111)
{
if ($LOGmodify_lists==1)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_lists' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$voi_count = "$row[0]";
}
##### END ID override optional section #####
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD A NEW LIST<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=211>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
if ($voi_count > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>List ID: </td><td align=left>Auto-Generated $NWB#vicidial_lists-list_id$NWE</td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>List ID: </td><td align=left><input type=text name=list_id size=8 maxlength=8> (digits only)$NWB#vicidial_lists-list_id$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>List Name: </td><td align=left><input type=text name=list_name size=20 maxlength=20>$NWB#vicidial_lists-list_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List Description: </td><td align=left><input type=text name=list_description size=30 maxlength=255>$NWB#vicidial_lists-list_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign: </td><td align=left><select size=1 name=campaign_id>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$campaigns_list='';
$o=0;
while ($campaigns_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "$campaigns_list";
echo "<option SELECTED>$campaign_id</option>\n";
echo "</select>$NWB#vicidial_lists-campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option SELECTED>N</option></select>$NWB#vicidial_lists-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=121 display the ADD NUMBER TO DNC FORM SCREEN and add a new number
######################
if ($ADD==121)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$campaigns_list = "<option SELECTED value=\"SYSTEM_INTERNAL\">SYSTEM_INTERNAL - INTERNAL VICIDIAL DNC LIST</option>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where use_campaign_dnc IN('Y','AREACODE') $LOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$o=0;
while ($campaigns_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
if (strlen($phone_numbers) > 2)
{
$PN = explode("\n",$phone_numbers);
$PNct = count($PN);
$p=0;
while ($p < $PNct)
{
if ( (ereg('delete',$stage)) and ($LOGdelete_from_dnc > 0) )
{
##### BEGIN DELETE FROM DNC #####
if (ereg('SYSTEM_INTERNAL',$campaign_id))
{
$stmt="SELECT count(*) from vicidial_dnc where phone_number='$PN[$p]';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] < 1)
{echo "<br>DNC NOT DELETED - This phone number is not in the Do Not Call List: $PN[$p]\n";}
else
{
$stmt="DELETE FROM vicidial_dnc where phone_number='$PN[$p]';";
$rslt=mysql_query($stmt, $link);
echo "<br><B>DNC DELETED: $PN[$p]</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='DELETE', record_id='$PN[$p]', event_code='ADMIN DELETE NUMBER FROM DNC LIST', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
$stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$PN[$p]' and campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] < 1)
{echo "<br>DNC NOT DELETED - This phone number is not in the Do Not Call List: $PN[$p] $campaign_id\n";}
else
{
$stmt="DELETE FROM vicidial_campaign_dnc where phone_number='$PN[$p]' and campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
echo "<br><B>DNC DELETED: $PN[$p] $campaign_id</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='DELETE', record_id='$PN[$p]', event_code='ADMIN DELETE NUMBER FROM CAMPAIGN DNC LIST $campaign_id', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
##### END DELETE FROM DNC #####
}
else
{
##### BEGIN ADD TO DNC #####
if (ereg('SYSTEM_INTERNAL',$campaign_id))
{
$stmt="SELECT count(*) from vicidial_dnc where phone_number='$PN[$p]';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>DNC NOT ADDED - This phone number is already in the Do Not Call List: $PN[$p]\n";}
else
{
$stmt="INSERT INTO vicidial_dnc (phone_number) values('$PN[$p]');";
$rslt=mysql_query($stmt, $link);
echo "<br><B>DNC ADDED: $PN[$p]</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD NUMBER TO DNC LIST', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
$stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$PN[$p]' and campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>DNC NOT ADDED - This phone number is already in the Do Not Call List: $PN[$p] $campaign_id\n";}
else
{
$stmt="INSERT INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$PN[$p]','$campaign_id');";
$rslt=mysql_query($stmt, $link);
echo "<br><B>DNC ADDED: $PN[$p] $campaign_id</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD NUMBER TO CAMPAIGN DNC LIST $campaign_id', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
##### END ADD TO DNC #####
}
$p++;
}
}
if ($LOGdelete_from_dnc > 0)
{echo "<br>ADD OR DELETE NUMBERS FROM THE DNC LIST<form action=$PHP_SELF method=POST>\n";}
else
{echo "<br>ADD NUMBERS TO THE DNC LIST<form action=$PHP_SELF method=POST>\n";}
echo "<input type=hidden name=ADD value=121>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List: </td><td align=left><select size=1 name=campaign_id>\n";
echo "$campaigns_list";
echo "</select></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Numbers: <BR><BR> (one phone number per line only)<BR>$NWB#vicidial_list-dnc$NWE</td><td align=left><TEXTAREA name=phone_numbers ROWS=20 COLS=20></TEXTAREA></td></tr>\n";
if ($LOGdelete_from_dnc > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Add or Delete: </td><td align=left><select size=1 name=stage><option SELECTED>add</option><option>delete</option></select></td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</FORM></TABLE></center>\n";
if ($LOGuser_level >= 9)
{
echo "<br>Download numbers in this list to a file: <form action=\"list_download.php\" method=POST>\n";
echo "<input type=hidden name=download_type value=dnc>\n";
echo "<select size=1 name=group_id>\n";
echo "$campaigns_list";
echo "</select><input type=submit name=SUBMIT value=SUBMIT></FORM>\n";
}
}
######################
# ADD=171 display the ADD NUMBER TO Filter Phone Group FORM SCREEN and add a new number
######################
if ($ADD==171)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT filter_phone_group_id,filter_phone_group_name from vicidial_filter_phone_groups order by filter_phone_group_id";
$rslt=mysql_query($stmt, $link);
$vfpg_to_print = mysql_num_rows($rslt);
$o=0;
while ($vfpg_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$vfpg_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
if (strlen($phone_numbers) > 2)
{
$PN = explode("\n",$phone_numbers);
$PNct = count($PN);
$p=0;
while ($p < $PNct)
{
if ( (ereg('delete',$stage)) and ($LOGdelete_from_dnc > 0) )
{
$stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] < 1)
{echo "<br>FILTER PHONE GROUP NUMBER NOT DELETED - This phone number is not in the Filter Phone Group List: $PN[$p] $filter_phone_group_id\n";}
else
{
$stmt="DELETE FROM vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';";
$rslt=mysql_query($stmt, $link);
echo "<br><B>FILTER PHONE GROUP NUMBER DELETED: $PN[$p] $filter_phone_group_id</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='DELETE', record_id='$PN[$p]', event_code='ADMIN DELETE NUMBER FROM FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
$stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>FILTER PHONE GROUP NUMBER NOT ADDED - This phone number is already in the Filter Phone Group List: $PN[$p] $filter_phone_group_id\n";}
else
{
$stmt="INSERT INTO vicidial_filter_phone_numbers (phone_number,filter_phone_group_id) values('$PN[$p]','$filter_phone_group_id');";
$rslt=mysql_query($stmt, $link);
echo "<br><B>FILTER PHONE GROUP NUMBER ADDED: $PN[$p] $filter_phone_group_id</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD NUMBER TO FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$p++;
}
}
if ($LOGdelete_from_dnc > 0)
{echo "<br>ADD OR DELETE NUMBERS FROM THE FILTER PHONE GROUP LIST<form action=$PHP_SELF method=POST>\n";}
else
{echo "<br>ADD NUMBERS TO THE FILTER PHONE GROUP LIST<form action=$PHP_SELF method=POST>\n";}
echo "<input type=hidden name=ADD value=171>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Filter Phone Group: </td><td align=left><select size=1 name=filter_phone_group_id>\n";
echo "$vfpg_list";
echo "</select></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Numbers: <BR><BR> (one phone number per line only)<BR>$NWB#vicidial_list-dnc$NWE</td><td align=left><TEXTAREA name=phone_numbers ROWS=20 COLS=20></TEXTAREA></td></tr>\n";
if ($LOGdelete_from_dnc > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Add or Delete: </td><td align=left><select size=1 name=stage><option SELECTED>add</option><option>delete</option></select></td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</FORM></TABLE></center>\n";
if ($LOGuser_level >= 9)
{
echo "<br>Download numbers in this list to a file: <form action=\"list_download.php\" method=POST>\n";
echo "<input type=hidden name=download_type value=fpgn>\n";
echo "<select size=1 name=group_id>\n";
echo "$vfpg_list";
echo "</select><input type=submit name=SUBMIT value=SUBMIT></FORM>\n";
}
}
######################
# ADD=1111 display the ADD NEW INBOUND GROUP SCREEN
######################
if ($ADD==1111)
{
if ($LOGmodify_ingroups==1)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_inbound_groups' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$voi_count = "$row[0]";
}
##### END ID override optional section #####
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD A NEW INBOUND GROUP<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=2111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
if ($voi_count > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Group ID: </td><td align=left>Auto-Generated $NWB#vicidial_inbound_groups-group_id$NWE</td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>Group ID: </td><td align=left><input type=text name=group_id size=20 maxlength=20> (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Group Name: </td><td align=left><input type=text name=group_name size=30 maxlength=30>$NWB#vicidial_inbound_groups-group_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Group Color: </td><td align=left id=\"group_color_td\"><input type=text name=group_color size=7 maxlength=7>$NWB#vicidial_inbound_groups-group_color$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option SELECTED>Y</option><option>N</option></select>$NWB#vicidial_inbound_groups-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Web Form: </td><td align=left><input type=text name=web_form_address size=70 maxlength=1055 value=\"$web_form_address\">$NWB#vicidial_inbound_groups-web_form_address$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Voicemail: </td><td align=left><input type=text name=voicemail_ext size=10 maxlength=10 value=\"$voicemail_ext\">$NWB#vicidial_inbound_groups-voicemail_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>oldest_inbound_call_start</option><option>oldest_inbound_call_finish</option><option>overall_user_level</option><option>inbound_group_rank</option><option>campaign_rank</option><option>fewest_calls</option><option>fewest_calls_campaign</option><option>longest_wait_time</option><option>ring_all</option></select>$NWB#vicidial_inbound_groups-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Fronter Display: </td><td align=left><select size=1 name=fronter_display><option SELECTED>Y</option><option>N</option></select>$NWB#vicidial_inbound_groups-fronter_display$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Script: </td><td align=left><select size=1 name=script_id>\n";
echo "$scripts_list";
echo "</select>$NWB#vicidial_inbound_groups-ingroup_script$NWE</td></tr>\n";
$eswHTML=''; $cfwHTML='';
if ($SSenable_second_webform > 0)
{$eswHTML = '<option>WEBFORMTWO</option>';}
if ($SScustom_fields_enabled > 0)
{$cfwHTML = '<option>FORM</option>';}
echo "<tr bgcolor=#B6D3FC><td align=right>Get Call Launch: </td><td align=left><select size=1 name=get_call_launch><option selected>NONE</option><option>SCRIPT</option><option>WEBFORM</option>$eswHTML$cfwHTML</select>$NWB#vicidial_inbound_groups-get_call_launch$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=1211 display the COPY INBOUND GROUP SCREEN
######################
if ($ADD==1211)
{
if ($LOGmodify_ingroups==1)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_inbound_groups' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$voi_count = "$row[0]";
}
##### END ID override optional section #####
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>COPY INBOUND GROUP<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=2011>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
if ($voi_count > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Group ID: </td><td align=left>Auto-Generated $NWB#vicidial_inbound_groups-group_id$NWE</td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>Group ID: </td><td align=left><input type=text name=group_id size=20 maxlength=20> (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Group Name: </td><td align=left><input type=text name=group_name size=30 maxlength=30>$NWB#vicidial_inbound_groups-group_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Source Group ID: </td><td align=left><select size=1 name=source_group_id>\n";
$stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id";
$rslt=mysql_query($stmt, $link);
$groups_to_print = mysql_num_rows($rslt);
$groups_list='';
$o=0;
while ($groups_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$groups_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "$groups_list";
echo "</select>$NWB#vicidial_inbound_groups-group_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=1311 display the ADD NEW DID SCREEN
######################
if ($ADD==1311)
{
if ($LOGmodify_dids==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD A NEW DID<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=2311>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DID Extension: </td><td align=left><input type=text name=did_pattern size=20 maxlength=50> (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DID Description: </td><td align=left><input type=text name=did_description size=40 maxlength=50>$NWB#vicidial_inbound_dids-did_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=1411 display the COPY DID SCREEN
######################
if ($ADD==1411)
{
if ($LOGmodify_dids==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>COPY DID<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=2411>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DID Extension: </td><td align=left><input type=text name=did_pattern size=20 maxlength=50> (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DID Description: </td><td align=left><input type=text name=did_description size=40 maxlength=50>$NWB#vicidial_inbound_dids-did_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Source DID: </td><td align=left><select size=1 name=source_did>\n";
$stmt="SELECT did_id,did_pattern,did_description from vicidial_inbound_dids order by did_pattern";
$rslt=mysql_query($stmt, $link);
$dids_to_print = mysql_num_rows($rslt);
$dids_list='';
$o=0;
while ($dids_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$dids_list .= "<option value=\"$rowx[0]\">$rowx[1] - $rowx[2]</option>\n";
$o++;
}
echo "$dids_list";
echo "</select>$NWB#vicidial_inbound_dids-did_pattern$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=1511 display the ADD NEW CALL MENU SCREEN
######################
if ($ADD==1511)
{
if ($LOGmodify_dids==1)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_call_menu' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$voi_count = "$row[0]";
}
##### END ID override optional section #####
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD A NEW CALL MENU<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=2511>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
if ($voi_count > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Menu ID: </td><td align=left>Auto-Generated $NWB#vicidial_call_menu-menu_id$NWE</td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>Menu ID: </td><td align=left><input type=text name=menu_id size=40 maxlength=50> (no spaces or special characters)$NWB#vicidial_call_menu-menu_id$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Menu Name: </td><td align=left><input type=text name=menu_name size=50 maxlength=100>$NWB#vicidial_call_menu-menu_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=1611 display the COPY CALL MENU SCREEN
######################
if ($ADD==1611)
{
if ($LOGmodify_dids==1)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_call_menu' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$voi_count = "$row[0]";
}
##### END ID override optional section #####
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>COPY CALL MENU<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=2611>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
if ($voi_count > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Menu ID: </td><td align=left>Auto-Generated $NWB#vicidial_call_menu-menu_id$NWE</td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>Menu ID: </td><td align=left><input type=text name=menu_id size=40 maxlength=50> (no spaces or special characters)$NWB#vicidial_call_menu-menu_id$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Menu Name: </td><td align=left><input type=text name=menu_name size=50 maxlength=100>$NWB#vicidial_call_menu-menu_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Source Menu: </td><td align=left><select size=1 name=source_menu>\n";
$stmt="SELECT menu_id,menu_name from vicidial_call_menu order by menu_id";
$rslt=mysql_query($stmt, $link);
$menus_to_print = mysql_num_rows($rslt);
$menus_list='';
$o=0;
while ($menus_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$menus_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "$menus_list";
echo "</select>$NWB#vicidial_call_menu-menu_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=1711 display the ADD NEW FILTER PHONE GROUP SCREEN
######################
if ($ADD==1711)
{
if ($LOGmodify_dids==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>Add Filter Phone Group<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=2711>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Filter Phone Group ID: </td><td align=left><input type=text name=filter_phone_group_id size=20 maxlength=20> (no spaces or special characters)$NWB#vicidial_filter_phone_groups-filter_phone_group_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Filter Phone Group Name: </td><td align=left><input type=text name=filter_phone_group_name size=40 maxlength=40>$NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Filter Phone Group Description: </td><td align=left><input type=text name=filter_phone_group_description size=60 maxlength=100>$NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN
######################
if ($ADD==11111)
{
if ($LOGmodify_remoteagents==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD NEW REMOTE AGENTS<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=21111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>User ID Start: </td><td align=left><input type=text name=user_start size=9 maxlength=9> (numbers only, incremented, must be an existing vicidial user)$NWB#vicidial_remote_agents-user_start$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Number of Lines: </td><td align=left><input type=text name=number_of_lines size=3 maxlength=3> (numbers only)$NWB#vicidial_remote_agents-number_of_lines$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server IP: </td><td align=left><select size=1 name=server_ip>\n";
echo "$servers_list";
echo "</select>$NWB#vicidial_remote_agents-server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>External Extension: </td><td align=left><input type=text name=conf_exten size=20 maxlength=20> (dial plan number dialed to reach agents)$NWB#vicidial_remote_agents-conf_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Status: </td><td align=left><select size=1 name=status><option>ACTIVE</option><option SELECTED>INACTIVE</option></select>$NWB#vicidial_remote_agents-status$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign: </td><td align=left><select size=1 name=campaign_id>\n";
echo "$campaigns_list";
echo "</select>$NWB#vicidial_remote_agents-campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Inbound Groups: </td><td align=left>\n";
echo "$groups_list";
echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=12111 display the ADD NEW EXTENSION GROUP SCREEN
######################
if ($ADD==12111)
{
if ($LOGmodify_remoteagents==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>Add Extension Group Entry<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=22111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Extension Group: </td><td align=left><input type=text name=extension_group_id size=20 maxlength=20> (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Extension: </td><td align=left><input type=text name=extension size=18 maxlength=18> (numbers only)$NWB#vicidial_extension_groups-extension$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Rank: </td><td align=left><select size=1 name=rank>\n";
$n=99; $rank=0;
while ($n>=-99)
{
if ($n == $rank)
{echo "<option SELECTED value=\"$n\">$n</option>\n";}
else
{echo "<option value=\"$n\">$n</option>\n";}
$n--;
}
echo "</select> $NWB#vicidial_extension_groups-rank$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaigns Groups: </td><td align=left><input type=text name=campaign_groups size=50 maxlength=255> (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=111111 display the ADD NEW USERS GROUP SCREEN
######################
if ($ADD==111111)
{
if ($LOGmodify_usergroups==1)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_user_groups' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$voi_count = "$row[0]";
}
##### END ID override optional section #####
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD NEW USERS GROUP<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=211111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
if ($voi_count > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Group: </td><td align=left>Auto-Generated $NWB#vicidial_user_groups-user_group$NWE</td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>Group: </td><td align=left><input type=text name=user_group size=15 maxlength=20> (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Description: </td><td align=left><input type=text name=group_name size=40 maxlength=40> (description of group)$NWB#vicidial_user_groups-group_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=1111111 display the ADD NEW SCRIPT SCREEN
######################
if ($ADD==1111111)
{
if ($LOGmodify_scripts==1)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_scripts' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$voi_count = "$row[0]";
}
##### END ID override optional section #####
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD NEW SCRIPT<form name=scriptForm action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=2111111>\n";
echo "<input type=hidden name=DB value=\"$DB\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
if ($voi_count > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Script ID: </td><td align=left>Auto-Generated $NWB#vicidial_scripts-script_id$NWE</td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>Script ID: </td><td align=left><input type=text name=script_id size=12 maxlength=10> (no spaces or punctuation)$NWB#vicidial_scripts-script_id$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Script Name: </td><td align=left><input type=text name=script_name size=40 maxlength=50> (title of the script)$NWB#vicidial_scripts-script_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Script Comments: </td><td align=left><input type=text name=script_comments size=50 maxlength=255> $NWB#vicidial_scripts-script_comments$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option SELECTED>Y</option><option>N</option></select>$NWB#vicidial_scripts-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Script Text: </td><td align=left>";
# BEGIN Insert Field
echo "<select id=\"selectedField\" name=\"selectedField\">";
echo "<option>vendor_lead_code</option>";
echo "<option>source_id</option>";
echo "<option>list_id</option>";
echo "<option>list_name</option>";
echo "<option>list_description</option>";
echo "<option>gmt_offset_now</option>";
echo "<option>called_since_last_reset</option>";
echo "<option>phone_code</option>";
echo "<option>phone_number</option>";
echo "<option>title</option>";
echo "<option>first_name</option>";
echo "<option>middle_initial</option>";
echo "<option>last_name</option>";
echo "<option>address1</option>";
echo "<option>address2</option>";
echo "<option>address3</option>";
echo "<option>city</option>";
echo "<option>state</option>";
echo "<option>province</option>";
echo "<option>postal_code</option>";
echo "<option>country_code</option>";
echo "<option>gender</option>";
echo "<option>date_of_birth</option>";
echo "<option>alt_phone</option>";
echo "<option>email</option>";
echo "<option>security_phrase</option>";
echo "<option>comments</option>";
echo "<option>lead_id</option>";
echo "<option>campaign</option>";
echo "<option>phone_login</option>";
echo "<option>group</option>";
echo "<option>channel_group</option>";
echo "<option>SQLdate</option>";
echo "<option>epoch</option>";
echo "<option>uniqueid</option>";
echo "<option>customer_zap_channel</option>";
echo "<option>server_ip</option>";
echo "<option>SIPexten</option>";
echo "<option>session_id</option>";
echo "<option>dialed_number</option>";
echo "<option>dialed_label</option>";
echo "<option>rank</option>";
echo "<option>owner</option>";
echo "<option>camp_script</option>";
echo "<option>in_script</option>";
echo "<option>script_width</option>";
echo "<option>script_height</option>";
echo "<option>recording_filename</option>";
echo "<option>recording_id</option>";
echo "<option>user_custom_one</option>";
echo "<option>user_custom_two</option>";
echo "<option>user_custom_three</option>";
echo "<option>user_custom_four</option>";
echo "<option>user_custom_five</option>";
echo "<option>preset_number_a</option>";
echo "<option>preset_number_b</option>";
echo "<option>preset_number_c</option>";
echo "<option>preset_number_d</option>";
echo "<option>preset_number_e</option>";
echo "<option>preset_number_f</option>";
echo "<option>preset_dtmf_a</option>";
echo "<option>preset_dtmf_b</option>";
echo "<option>did_id</option>";
echo "<option>did_extension</option>";
echo "<option>did_pattern</option>";
echo "<option>did_description</option>";
echo "<option>closecallid</option>";
echo "<option>xfercallid</option>";
echo "<option>agent_log_id</option>";
echo "<option>entry_list_id</option>";
echo "</select>";
echo "<input type=\"button\" name=\"insertField\" value=\"Insert\" onClick=\"scriptInsertField();\"><BR>";
# END Insert Field
echo "<TEXTAREA NAME=script_text ROWS=20 COLS=50 value=\"\"></TEXTAREA> $NWB#vicidial_scripts-script_text$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=11111111 display the ADD NEW FILTER SCREEN
######################
if ($ADD==11111111)
{
if ($LOGmodify_filters==1)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='vicidial_lead_filters' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$voi_count = "$row[0]";
}
##### END ID override optional section #####
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD NEW FILTER<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=21111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
if ($voi_count > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Filter ID: </td><td align=left>Auto-Generated $NWB#vicidial_lead_filters-lead_filter_id$NWE</td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>Filter ID: </td><td align=left><input type=text name=lead_filter_id size=12 maxlength=10> (no spaces or punctuation)$NWB#vicidial_lead_filters-lead_filter_id$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Filter Name: </td><td align=left><input type=text name=lead_filter_name size=30 maxlength=30> (short description of the filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Filter Comments: </td><td align=left><input type=text name=lead_filter_comments size=50 maxlength=255> $NWB#vicidial_lead_filters-lead_filter_comments$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Filter SQL: </td><td align=left><TEXTAREA NAME=lead_filter_sql ROWS=20 COLS=50 value=\"\"></TEXTAREA> $NWB#vicidial_lead_filters-lead_filter_sql$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=111111111 display the ADD NEW CALL TIME SCREEN
######################
if ($ADD==111111111)
{
if ($LOGmodify_call_times==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD NEW CALL TIME<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=211111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Call Time ID: </td><td align=left><input type=text name=call_time_id size=12 maxlength=10> (no spaces or punctuation)$NWB#vicidial_call_times-call_time_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Call Time Name: </td><td align=left><input type=text name=call_time_name size=30 maxlength=30> (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Call Time Comments: </td><td align=left><input type=text name=call_time_comments size=50 maxlength=255> $NWB#vicidial_call_times-call_time_comments$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>Day and time options will appear once you have created the Call Time Definition</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=1111111111 display the ADD NEW STATE CALL TIME SCREEN
######################
if ($ADD==1111111111)
{
if ($LOGmodify_call_times==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD NEW STATE CALL TIME<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=2111111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>State Call Time ID: </td><td align=left><input type=text name=call_time_id size=12 maxlength=10> (no spaces or punctuation)$NWB#vicidial_call_times-call_time_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>State Call Time State: </td><td align=left><input type=text name=state_call_time_state size=4 maxlength=2> (no spaces or punctuation)$NWB#vicidial_call_times-state_call_time_state$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>State Call Time Name: </td><td align=left><input type=text name=call_time_name size=30 maxlength=30> (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>State Call Time Comments: </td><td align=left><input type=text name=call_time_comments size=50 maxlength=255> $NWB#vicidial_call_times-call_time_comments$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>Day and time options will appear once you have created the Call Time Definition</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=131111111 display the ADD NEW SHIFT SCREEN
######################
if ($ADD==131111111)
{
if ($LOGmodify_call_times==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD NEW SHIFT<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=231111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Shift ID: </td><td align=left><input type=text name=shift_id size=22 maxlength=20> (no spaces or punctuation)$NWB#vicidial_shifts-shift_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Name: </td><td align=left><input type=text name=shift_name size=50 maxlength=50> (short description of the shift)$NWB#vicidial_shifts-shift_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Start Time: </td><td align=left><input type=text name=shift_start_time size=5 maxlength=4 id=shift_start_time>\n";
echo " &nbsp; Shift End Time: <input type=text name=shift_end_time size=5 maxlength=4 id=shift_end_time>\n";
echo "<input type=button name=shift_calc value=\"Calculate Shift Length\" onClick=\"shift_time();\"> $NWB#vicidial_shifts-shift_start_time$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Length: </td><td align=left><input type=text name=shift_length id=shift_length size=6 maxlength=5> $NWB#vicidial_shifts-shift_length$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Weekdays: <BR>$NWB#vicidial_shifts-shift_weekdays$NWE</td><td align=left>\n";
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"0\">Sunday<BR>\n";
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"1\">Monday<BR>\n";
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"2\">Tuesday<BR>\n";
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"3\">Wednesday<BR>\n";
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"4\">Thursday<BR>\n";
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"5\">Friday<BR>\n";
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"6\">Saturday<BR>\n";
echo "</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=11111111111 display the ADD NEW PHONE SCREEN
######################
if ($ADD==11111111111)
{
if ($LOGast_admin_access==1)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT count(*) FROM vicidial_override_ids where id_table='phones' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$voi_count = "$row[0]";
}
##### END ID override optional section #####
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD A NEW PHONE<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=21111111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
if ($voi_count > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Extension: </td><td align=left>Auto-Generated $NWB#phones-extension$NWE</td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Extension: </td><td align=left><input type=text name=extension size=20 maxlength=100 value=\"\">$NWB#phones-extension$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Dial Plan Number: </td><td align=left><input type=text name=dialplan_number size=15 maxlength=20> (digits only)$NWB#phones-dialplan_number$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Voicemail Box: </td><td align=left><input type=text name=voicemail_id size=10 maxlength=10> (digits only)$NWB#phones-voicemail_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Outbound CallerID: </td><td align=left><input type=text name=outbound_cid size=10 maxlength=20> (digits only)$NWB#phones-outbound_cid$NWE</td></tr>\n";
# echo "<tr bgcolor=#B6D3FC><td align=right>Phone IP address: </td><td align=left><input type=text name=phone_ip size=20 maxlength=15> (optional)$NWB#phones-phone_ip$NWE</td></tr>\n";
# echo "<tr bgcolor=#B6D3FC><td align=right>Computer IP address: </td><td align=left><input type=text name=computer_ip size=20 maxlength=15> (optional)$NWB#phones-computer_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server IP: </td><td align=left><select size=1 name=server_ip>\n";
echo "$servers_list";
echo "</select>$NWB#phones-server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Screen Login: </td><td align=left><input type=text name=login size=15 maxlength=15>$NWB#phones-login$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Login Password: </td><td align=left><input type=text name=pass size=10 maxlength=20 value=\"$SSdefault_phone_login_password\">$NWB#phones-pass$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Registration Password: </td><td align=left style=\"display:table-cell; vertical-align:middle;\"><input type=text id=reg_pass name=conf_secret size=20 maxlength=20 value=\"$SSdefault_phone_registration_password\" onkeyup=\"return pwdChanged('reg_pass','reg_pass_img');\">$NWB#phones-conf_secret$NWE &nbsp; &nbsp; Strength: <IMG id=reg_pass_img src='images/pixel.gif' style=\"vertical-align:middle;\" onLoad=\"return pwdChanged('reg_pass','reg_pass_img');\"></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Status: </td><td align=left><select size=1 name=status><option SELECTED>ACTIVE</option><option>SUSPENDED</option><option>CLOSED</option><option>PENDING</option><option>ADMIN</option></select>$NWB#phones-status$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active Account: </td><td align=left><select size=1 name=active><option SELECTED>Y</option><option>N</option></select>$NWB#phones-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Type: </td><td align=left><input type=text name=phone_type size=20 maxlength=50>$NWB#phones-phone_type$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Full Name: </td><td align=left><input type=text name=fullname size=20 maxlength=50>$NWB#phones-fullname$NWE</td></tr>\n";
# echo "<tr bgcolor=#B6D3FC><td align=right>Company: </td><td align=left><input type=text name=company size=10 maxlength=10>$NWB#phones-company$NWE</td></tr>\n";
# echo "<tr bgcolor=#B6D3FC><td align=right>Picture: </td><td align=left><input type=text name=picture size=20 maxlength=19>$NWB#phones-picture$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Client Protocol: </td><td align=left><select size=1 name=protocol><option SELECTED>SIP</option><option>Zap</option><option>IAX2</option><option>EXTERNAL</option></select>$NWB#phones-protocol$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Local GMT: </td><td align=left><select size=1 name=local_gmt><option>12.75</option><option>12.00</option><option>11.00</option><option>10.00</option><option>9.50</option><option>9.00</option><option>8.00</option><option>7.00</option><option>6.50</option><option>6.00</option><option>5.75</option><option>5.50</option><option>5.00</option><option>4.50</option><option>4.00</option><option>3.50</option><option>3.00</option><option>2.00</option><option>1.00</option><option>0.00</option><option>-1.00</option><option>-2.00</option><option>-3.00</option><option>-3.50</option><option>-4.00</option><option>-5.00</option><option>-6.00</option><option>-7.00</option><option>-8.00</option><option>-9.00</option><option>-10.00</option><option>-11.00</option><option>-12.00</option><option SELECTED>$SSdefault_local_gmt</option></select> (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=12111111111 display the ADD NEW PHONE ALIAS SCREEN
######################
if ($ADD==12111111111)
{
if ($LOGast_admin_access==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD A NEW PHONE ALIAS<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=22111111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Alias ID: </td><td align=left><input type=text name=alias_id size=20 maxlength=20 value=\"\">$NWB#phones-alias_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Alias Name: </td><td align=left><input type=text name=alias_name size=30 maxlength=50> $NWB#phones-alias_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Logins List: </td><td align=left><input type=text name=logins_list size=50 maxlength=255> (comma separated)$NWB#phones-logins_list$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=13111111111 display the ADD NEW GROUP ALIAS SCREEN
######################
if ($ADD==13111111111)
{
if ($LOGast_admin_access==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD A NEW GROUP ALIAS<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=23111111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Group Alias ID: </td><td align=left><input type=text name=group_alias_id size=30 maxlength=30 value=\"\">$NWB#phones-group_alias_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Group Alias Name: </td><td align=left><input type=text name=group_alias_name size=30 maxlength=50> $NWB#phones-group_alias_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>CallerID Number: </td><td align=left><input type=text name=caller_id_number size=20 maxlength=20> $NWB#phones-caller_id_number$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>CallerID Name: </td><td align=left><input type=text name=caller_id_name size=20 maxlength=20> $NWB#phones-caller_id_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option selected>N</option></select></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=111111111111 display the ADD NEW SERVER SCREEN
######################
if ($ADD==111111111111)
{
if ($LOGmodify_servers==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD A NEW SERVER<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=211111111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server ID: </td><td align=left><input type=text name=server_id size=10 maxlength=10>$NWB#servers-server_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server Description: </td><td align=left><input type=text name=server_description size=30 maxlength=255>$NWB#servers-server_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server IP Address: </td><td align=left><input type=text name=server_ip size=20 maxlength=15>$NWB#servers-server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option></select>$NWB#servers-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Asterisk Version: </td><td align=left><input type=text name=asterisk_version size=20 maxlength=20>$NWB#servers-asterisk_version$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=131111111111 display the ADD NEW CONF TEMPLATE SCREEN
######################
if ($ADD==131111111111)
{
if ($LOGmodify_servers==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD NEW CONF TEMPLATE<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=231111111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Template ID: </td><td align=left><input type=text name=template_id size=15 maxlength=15>$NWB#vicidial_conf_templates-template_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Template Name: </td><td align=left><input type=text name=template_name size=40 maxlength=50>$NWB#vicidial_conf_templates-template_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Template Contents: </td><td align=left><TEXTAREA NAME=template_contents ROWS=10 COLS=70></TEXTAREA> $NWB#vicidial_conf_templates-template_contents$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=141111111111 display the ADD NEW CARRIER SCREEN
######################
if ($ADD==141111111111)
{
if ($LOGmodify_servers==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD NEW CARRIER<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=241111111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier ID: </td><td align=left><input type=text name=carrier_id size=15 maxlength=15>$NWB#vicidial_server_carriers-carrier_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier Name: </td><td align=left><input type=text name=carrier_name size=40 maxlength=50>$NWB#vicidial_server_carriers-carrier_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier Description: </td><td align=left><input type=text name=carrier_description size=70 maxlength=255>$NWB#vicidial_server_carriers-carrier_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Registration String: </td><td align=left><input type=text name=registration_string size=50 maxlength=255>$NWB#vicidial_server_carriers-registration_string$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Template ID: </td><td align=left><select size=1 name=template_id>\n";
$stmt="SELECT template_id,template_name from vicidial_conf_templates order by template_id";
$rslt=mysql_query($stmt, $link);
$templates_to_print = mysql_num_rows($rslt);
$templates_list='<option SELECTED>--NONE--</option>';
$o=0;
while ($templates_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$templates_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "$templates_list";
echo "</select>$NWB#vicidial_server_carriers-template_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Account Entry: </td><td align=left><TEXTAREA NAME=account_entry ROWS=10 COLS=70></TEXTAREA> $NWB#vicidial_server_carriers-account_entry$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Protocol: </td><td align=left><select size=1 name=protocol><option SELECTED>SIP</option><option>Zap</option><option>IAX2</option><option>EXTERNAL</option></select>$NWB#vicidial_server_carriers-protocol$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Globals String: </td><td align=left><input type=text name=globals_string size=50 maxlength=255>$NWB#vicidial_server_carriers-globals_string$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Dialplan Entry: </td><td align=left><TEXTAREA NAME=dialplan_entry ROWS=10 COLS=70></TEXTAREA> $NWB#vicidial_server_carriers-dialplan_entry$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server IP: </td><td align=left><select size=1 name=server_ip>\n";
echo "$servers_list";
echo "</select>$NWB#vicidial_server_carriers-server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=140111111111 display the ADD COPIED CARRIER SCREEN
######################
if ($ADD==140111111111)
{
if ($LOGmodify_servers==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD COPIED CARRIER<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=240111111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier ID: </td><td align=left><input type=text name=carrier_id size=15 maxlength=15>$NWB#vicidial_server_carriers-carrier_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier Name: </td><td align=left><input type=text name=carrier_name size=40 maxlength=50>$NWB#vicidial_server_carriers-carrier_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server IP: </td><td align=left><select size=1 name=server_ip>\n";
echo "$servers_list";
echo "</select>$NWB#vicidial_server_carriers-server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Source Carrier: </td><td align=left><select size=1 name=source_carrier>\n";
$stmt="SELECT carrier_id,carrier_name,server_ip from vicidial_server_carriers order by carrier_id";
$rslt=mysql_query($stmt, $link);
$menus_to_print = mysql_num_rows($rslt);
$menus_list='';
$o=0;
while ($menus_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$menus_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1] - $rowx[2]</option>\n";
$o++;
}
echo "$menus_list";
echo "</select>$NWB#vicidial_server_carriers-carrier_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=151111111111 display the ADD NEW TTS ENTRY SCREEN
######################
if ($ADD==151111111111)
{
if ($LOGmodify_servers==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD NEW TTS ENTRY<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=251111111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>TTS ID: </td><td align=left><input type=text name=tts_id size=30 maxlength=50>$NWB#vicidial_tts_prompts-tts_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>TTS Name: </td><td align=left><input type=text name=tts_name size=50 maxlength=100>$NWB#vicidial_tts_prompts-tts_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>N</option><option>Y</option>$NWB#vicidial_tts_prompts-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=161111111111 display the ADD NEW MUSIC ON HOLD ENTRY SCREEN
######################
if ($ADD==161111111111)
{
if ($LOGmodify_servers==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD NEW MUSIC ON HOLD ENTRY<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=261111111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Music On Hold ID: </td><td align=left><input type=text name=moh_id size=50 maxlength=100>$NWB#vicidial_music_on_hold-moh_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Music On Hold Name: </td><td align=left><input type=text name=moh_name size=70 maxlength=255>$NWB#vicidial_music_on_hold-moh_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Random Order: </td><td align=left><select size=1 name=random><option>N</option><option>Y</option>$NWB#vicidial_music_on_hold-random$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=171111111111 display the ADD NEW VOICEMAIL BOX SCREEN
######################
if ($ADD==171111111111)
{
if ($LOGmodify_servers==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD NEW VOICEMAIL BOX<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=271111111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Voicemail ID: </td><td align=left><input type=text name=voicemail_id size=12 maxlength=10>$NWB#vicidial_voicemail-voicemail_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Pass: </td><td align=left><input type=text name=pass size=10 maxlength=10>$NWB#vicidial_voicemail-pass$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Name: </td><td align=left><input type=text name=fullname size=50 maxlength=100>$NWB#vicidial_voicemail-fullname$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>N</option><option>Y</option>$NWB#vicidial_voicemail-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email: </td><td align=left><input type=text name=email size=50 maxlength=100>$NWB#vicidial_voicemail-email$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=181111111111 display the ADD NEW SCREEN LABEL SCREEN
######################
if ($ADD==181111111111)
{
if ($LOGmodify_servers==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD NEW SCREEN LABEL<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=281111111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Screen Label ID: </td><td align=left><input type=text name=label_id size=21 maxlength=20>$NWB#vicidial_screen_labels-label_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Screen Label Name: </td><td align=left><input type=text name=label_name size=70 maxlength=100>$NWB#vicidial_screen_labels-label_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=1111111111111 display the ADD NEW CONFERENCE SCREEN
######################
if ($ADD==1111111111111)
{
if ($LOGast_admin_access==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD A NEW CONFERENCE<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=2111111111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Conference Number: </td><td align=left><input type=text name=conf_exten size=8 maxlength=7> (digits only)$NWB#conferences-conf_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server IP: </td><td align=left><select size=1 name=server_ip>\n";
echo "$servers_list";
echo "</select>$NWB#conferences-server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=11111111111111 display the ADD NEW VICIDIAL CONFERENCE SCREEN
######################
if ($ADD==11111111111111)
{
if ($LOGast_admin_access==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>ADD A NEW VICIDIAL CONFERENCE<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=21111111111111>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Conference Number: </td><td align=left><input type=text name=conf_exten size=8 maxlength=7> (digits only)$NWB#conferences-conf_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server IP: </td><td align=left><select size=1 name=server_ip>\n";
echo "$servers_list";
echo "</select>$NWB#conferences-server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################################################################################################
######################################################################################################
####### 2 series, validates form data and inserts the new record into the database
######################################################################################################
######################################################################################################
######################
# ADD=2 adds the new user to the system
######################
if ($ADD=="2")
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_users' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$user = ($row[0] + 1);
$stmt="UPDATE vicidial_override_ids SET value='$user' where id_table='vicidial_users' and active='1';";
$rslt=mysql_query($stmt, $link);
}
##### END ID override optional section #####
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_users where user='$user';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>USER NOT ADDED - there is already a user in the system with this user number\n";}
else
{
if (ereg('AUTOGENERA',$user))
{
$user = 'AUTOGENERA';
}
if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_group) < 2) or ( (strlen($user) > 20) and (!ereg('AUTOGENERA',$user)) ) )
{
echo "<br>USER NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>user id must be between 2 and 20 characters long\n";
echo "<br>full name and password must be at least 2 characters long\n";
echo "<br>you must select a user group\n";
}
else
{
if (ereg('AUTOGENERA',$user))
{
$new_user=0;
$auto_user_add_value=0;
while ($new_user < 2)
{
if ($new_user < 1)
{
$stmt = "SELECT auto_user_add_value FROM system_settings;";
$rslt=mysql_query($stmt, $link);
$ss_auav_ct = mysql_num_rows($rslt);
if ($ss_auav_ct > 0)
{
$row=mysql_fetch_row($rslt);
$auto_user_add_value = $row[0];
}
$new_user++;
}
$stmt = "SELECT count(*) FROM vicidial_users where user='$auto_user_add_value';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] < 1)
{
$new_user++;
}
else
{
echo "<!-- AG: $auto_user_add_value -->\n";
$auto_user_add_value = ($auto_user_add_value + 7);
}
}
$user = $auto_user_add_value;
echo "<br><B>user_id has been auto-generated: $user</B><br>\n";
$stmt="UPDATE system_settings SET auto_user_add_value='$user';";
$rslt=mysql_query($stmt, $link);
}
echo "<br><B>USER ADDED: $user</B>\n";
$stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass) values('$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass');";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='ADD', record_id='$user', event_code='ADMIN ADD USER', event_sql=\"$SQL_log\", event_notes='user: $user';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
###############################################################
##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP #####
$stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$ss_conf_ct = mysql_num_rows($rslt);
if ($ss_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$enable_vtiger_integration = $row[0];
$vtiger_server_ip = $row[1];
$vtiger_dbname = $row[2];
$vtiger_login = $row[3];
$vtiger_pass = $row[4];
$vtiger_url = $row[5];
}
##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP #####
#############################################################
if ($enable_vtiger_integration > 0)
{
### connect to your vtiger database
$linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass");
if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());}
echo 'Connected successfully';
mysql_select_db("$vtiger_dbname", $linkV);
$user_name = $user;
$user_password = $pass;
$last_name = $full_name;
$is_admin = 'off';
$roleid = 'H5';
$status = 'Active';
$groupid = '1';
if ($user_level >= 7) {$roleid = 'H3';}
if ($user_level >= 8) {$roleid = 'H4';}
if ($user_level >= 9) {$roleid = 'H2';}
if ($user_level >= 9) {$is_admin = 'on';}
$salt = substr($user_name, 0, 2);
$salt = '$1$' . $salt . '$';
$encrypted_password = crypt($user_password, $salt);
### search for role in ViciDial
$stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$vvr_ct = mysql_num_rows($rslt);
if ($vvr_ct > 0)
{
$row=mysql_fetch_row($rslt);
$roleid = $row[0];
}
######################################
##### BEGIN Add/Update group info in Vtiger
$stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$group_found_count = $row[0];
### group exists in vtiger, update it
if ($group_found_count > 0)
{
$stmt="SELECT groupid from vtiger_groups where groupname='$user_group';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$groupid = $row[0];
}
### user doesn't exist in vtiger, insert it
else
{
#### BEGIN CREATE NEW GROUP RECORD IN VTIGER
# Get next available id from vtiger_users_seq to use as groupid
$stmt="SELECT id from vtiger_users_seq;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
$row=mysql_fetch_row($rslt);
$groupid = ($row[0] + 1);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
# Increase next available groupid with 1 so next record gets proper id
$stmt="UPDATE vtiger_users_seq SET id = '$groupid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
#### END CREATE NEW GROUP RECORD IN VTIGER
}
##### END Add/Update group info in Vtiger
######################################
######################################
##### BEGIN Add/Update user info in Vtiger
$stmt="SELECT count(*) from vtiger_users where user_name='$user_name';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$found_count = $row[0];
### user exists in vtiger, update it
if ($found_count > 0)
{
$stmt="SELECT id from vtiger_users where user_name='$user_name';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$userid = $row[0];
$stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$usergroupcount = $row[0];
$stmtA = "UPDATE vtiger_users SET user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status' where id='$userid';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';";
if ($DB) {echo "|$stmtB|\n";}
$rslt=mysql_query($stmtB, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
if ($usergroupcount < 1)
{
$stmt="SELECT user_group FROM vicidial_user_groups;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$VD_groups_ct = mysql_num_rows($rslt);
$k=0;
$VD_groups_list='';
while ($k < $VD_groups_ct)
{
$row=mysql_fetch_row($rslt);
$VD_groups_list .= "'$row[0]',";
$k++;
}
$VD_groups_list = preg_replace("/.$/",'',$VD_groups_list);
$stmtC = "DELETE FROM vtiger_users2group WHERE userid='$userid' and groupid IN(SELECT groupid from vtiger_groups where groupname IN($VD_groups_list));";
if ($DB) {echo "|$stmtC|\n";}
$rslt=mysql_query($stmtC, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';";
if ($DB) {echo "|$stmtD|\n";}
$rslt=mysql_query($stmtD, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
}
}
### user doesn't exist in vtiger, insert it
else
{
#### BEGIN CREATE NEW USER RECORD IN VTIGER
$stmtA = "INSERT INTO vtiger_users SET user_name='$user_name',user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status',date_format='yyyy-mm-dd',first_name='',reports_to_id='',description='',title='',department='',phone_home='',phone_mobile='',phone_work='',phone_other='',phone_fax='',email1='',email2='',yahoo_id='',signature='',address_street='',address_city='',address_state='',address_country='',address_postalcode='',user_preferences='',imagename='';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$userid = mysql_insert_id($linkV);
$stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';";
if ($DB) {echo "|$stmtB|\n";}
$rslt=mysql_query($stmtB, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';";
if ($DB) {echo "|$stmtC|\n";}
$rslt=mysql_query($stmtC, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtD = "UPDATE vtiger_users_seq SET id='$userid';";
if ($DB) {echo "|$stmtD|\n";}
$rslt=mysql_query($stmtD, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
#### END CREATE NEW USER RECORD IN VTIGER
}
##### END Add/Update user info in Vtiger
######################################
}
### END vtiger integration
}
}
$ADD=3;
}
######################
# ADD=2A adds the copied new user to the system
######################
if ($ADD=="2A")
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_users' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$user = ($row[0] + 1);
$stmt="UPDATE vicidial_override_ids SET value='$user' where id_table='vicidial_users' and active='1';";
$rslt=mysql_query($stmt, $link);
}
##### END ID override optional section #####
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_users where user='$user';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>USER NOT ADDED - there is already a user in the system with this user number\n";}
else
{
if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 20) )
{
echo "<br>USER NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>user id must be between 2 and 20 characters long\n";
echo "<br>full name and password must be at least 2 characters long\n";
echo "<!-- |$user|$pass|$full_name| -->\n";
}
else
{
if (ereg('AUTOGEN',$user))
{
$new_user=0;
$auto_user_add_value=0;
while ($new_user < 2)
{
if ($new_user < 1)
{
$stmt = "SELECT auto_user_add_value FROM system_settings;";
$rslt=mysql_query($stmt, $link);
$ss_auav_ct = mysql_num_rows($rslt);
if ($ss_auav_ct > 0)
{
$row=mysql_fetch_row($rslt);
$auto_user_add_value = $row[0];
}
$new_user++;
}
$stmt = "SELECT count(*) FROM vicidial_users where user='$auto_user_add_value';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] < 1)
{
$new_user++;
}
else
{
echo "<!-- AG: $auto_user_add_value -->\n";
$auto_user_add_value = ($auto_user_add_value + 7);
}
}
$user = $auto_user_add_value;
echo "<br><B>user_id has been auto-generated: $user</B><br>\n";
$stmt="UPDATE system_settings SET auto_user_add_value='$user';";
$rslt=mysql_query($stmt, $link);
}
$stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override) SELECT \"$user\",\"$pass\",\"$full_name\",user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override from vicidial_users where user=\"$source_user_id\";";
$rslt=mysql_query($stmt, $link);
$stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today) SELECT \"$user\",group_id,group_rank,group_weight,\"0\" from vicidial_inbound_group_agents where user=\"$source_user_id\";";
$rslt=mysql_query($stmtA, $link);
$stmtA="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) SELECT \"$user\",campaign_id,campaign_rank,campaign_weight,\"0\" from vicidial_campaign_agents where user=\"$source_user_id\";";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='COPY', record_id='$user', event_code='ADMIN COPY USER', event_sql=\"$SQL_log\", event_notes='user: $user';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
###############################################################
##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP #####
$stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$ss_conf_ct = mysql_num_rows($rslt);
if ($ss_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$enable_vtiger_integration = $row[0];
$vtiger_server_ip = $row[1];
$vtiger_dbname = $row[2];
$vtiger_login = $row[3];
$vtiger_pass = $row[4];
$vtiger_url = $row[5];
}
##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP #####
#############################################################
if ($enable_vtiger_integration > 0)
{
### connect to your vtiger database
$linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass");
if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());}
echo 'Connected successfully';
mysql_select_db("$vtiger_dbname", $linkV);
$user_name = $user;
$user_password = $pass;
$last_name = $full_name;
$is_admin = 'off';
$roleid = 'H5';
$status = 'Active';
$groupid = '1';
if ($user_level >= 7) {$roleid = 'H3';}
if ($user_level >= 8) {$roleid = 'H4';}
if ($user_level >= 9) {$roleid = 'H2';}
if ($user_level >= 9) {$is_admin = 'on';}
$salt = substr($user_name, 0, 2);
$salt = '$1$' . $salt . '$';
$encrypted_password = crypt($user_password, $salt);
### search for role in ViciDial
$stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$vvr_ct = mysql_num_rows($rslt);
if ($vvr_ct > 0)
{
$row=mysql_fetch_row($rslt);
$roleid = $row[0];
}
######################################
##### BEGIN Add/Update group info in Vtiger
$stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$group_found_count = $row[0];
### group exists in vtiger, update it
if ($group_found_count > 0)
{
$stmt="SELECT groupid from vtiger_groups where groupname='$user_group';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$groupid = $row[0];
}
### user doesn't exist in vtiger, insert it
else
{
#### BEGIN CREATE NEW GROUP RECORD IN VTIGER
# Get next available id from vtiger_users_seq to use as groupid
$stmt="SELECT id from vtiger_users_seq;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
$row=mysql_fetch_row($rslt);
$groupid = ($row[0] + 1);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
# Increase next available groupid with 1 so next record gets proper id
$stmt="UPDATE vtiger_users_seq SET id = '$groupid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
#### END CREATE NEW GROUP RECORD IN VTIGER
}
##### END Add/Update group info in Vtiger
######################################
######################################
##### BEGIN Add/Update user info in Vtiger
$stmt="SELECT count(*) from vtiger_users where user_name='$user_name';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$found_count = $row[0];
### user exists in vtiger, update it
if ($found_count > 0)
{
$stmt="SELECT id from vtiger_users where user_name='$user_name';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$userid = $row[0];
$stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$usergroupcount = $row[0];
$stmtA = "UPDATE vtiger_users SET user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status' where id='$userid';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';";
if ($DB) {echo "|$stmtB|\n";}
$rslt=mysql_query($stmtB, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
if ($usergroupcount < 1)
{
$stmt="SELECT user_group FROM vicidial_user_groups;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$VD_groups_ct = mysql_num_rows($rslt);
$k=0;
$VD_groups_list='';
while ($k < $VD_groups_ct)
{
$row=mysql_fetch_row($rslt);
$VD_groups_list .= "'$row[0]',";
$k++;
}
$VD_groups_list = preg_replace("/.$/",'',$VD_groups_list);
$stmtC = "DELETE FROM vtiger_users2group WHERE userid='$userid' and groupid IN(SELECT groupid from vtiger_groups where groupname IN($VD_groups_list));";
if ($DB) {echo "|$stmtC|\n";}
$rslt=mysql_query($stmtC, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';";
if ($DB) {echo "|$stmtD|\n";}
$rslt=mysql_query($stmtD, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
}
}
### user doesn't exist in vtiger, insert it
else
{
#### BEGIN CREATE NEW USER RECORD IN VTIGER
$stmtA = "INSERT INTO vtiger_users SET user_name='$user_name',user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status',date_format='yyyy-mm-dd',first_name='',reports_to_id='',description='',title='',department='',phone_home='',phone_mobile='',phone_work='',phone_other='',phone_fax='',email1='',email2='',yahoo_id='',signature='',address_street='',address_city='',address_state='',address_country='',address_postalcode='',user_preferences='',imagename='';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$userid = mysql_insert_id($linkV);
$stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';";
if ($DB) {echo "|$stmtB|\n";}
$rslt=mysql_query($stmtB, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';";
if ($DB) {echo "|$stmtC|\n";}
$rslt=mysql_query($stmtC, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtD = "UPDATE vtiger_users_seq SET id='$userid';";
if ($DB) {echo "|$stmtD|\n";}
$rslt=mysql_query($stmtD, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
#### END CREATE NEW USER RECORD IN VTIGER
}
##### END Add/Update user info in Vtiger
######################################
}
### END vtiger integration
echo "<br><B>USER COPIED: $user copied from $source_user_id</B>\n";
echo "<br><br>\n";
echo "<a href=\"$PHP_SELF?ADD=3&user=$user\">Click here to go to the user record</a>\n";
echo "<br><br>\n";
}
}
exit;
}
######################
# ADD=21 adds the new campaign to the system
######################
if ($ADD==21)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_campaigns' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$campaign_id = ($row[0] + 1);
$stmt="UPDATE vicidial_override_ids SET value='$campaign_id' where id_table='vicidial_campaigns' and active='1';";
$rslt=mysql_query($stmt, $link);
}
##### END ID override optional section #####
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>CAMPAIGN NOT ADDED - there is already a campaign in the system with this ID\n";}
else
{
$stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>CAMPAIGN NOT ADDED - there is already an inbound group in the system with this ID\n";}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($campaign_id) > 8) or (strlen($campaign_name) < 6) or (strlen($campaign_name) > 40) )
{
echo "<br>CAMPAIGN NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>campaign ID must be between 2 and 8 characters in length\n";
echo "<br>campaign name must be between 6 and 40 characters in length\n";
}
else
{
echo "<br><B>CAMPAIGN ADDED: $campaign_id</B>\n";
$stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,campaign_description,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch,campaign_changedate,campaign_stats_refresh,list_order_mix,web_form_address_two,start_call_url,dispo_call_url) values('$campaign_id','$campaign_name','$campaign_description','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch','$SQLdate','Y','DISABLED','','','');";
$rslt=mysql_query($stmt, $link);
$stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');";
$rslt=mysql_query($stmtA, $link);
$stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADD CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
$ADD=31;
}
######################
# ADD=20 adds copied new campaign to the system
######################
if ($ADD==20)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_campaigns' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$campaign_id = ($row[0] + 1);
$stmt="UPDATE vicidial_override_ids SET value='$campaign_id' where id_table='vicidial_campaigns' and active='1';";
$rslt=mysql_query($stmt, $link);
}
##### END ID override optional section #####
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>CAMPAIGN NOT ADDED - there is already a campaign in the system with this ID\n";}
else
{
$stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>CAMPAIGN NOT ADDED - there is already an inbound group in the system with this ID\n";}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($campaign_id) > 8) or (strlen($campaign_name) < 2) or (strlen($source_campaign_id) < 2) or (strlen($source_campaign_id) > 8) )
{
echo "<br>CAMPAIGN NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>campaign ID must be between 2 and 8 characters in length\n";
echo "<br>source campaign ID must be between 2 and 8 characters in length\n";
}
else
{
echo "<br><B>CAMPAIGN COPIED: $campaign_id copied from $source_campaign_id</B>\n";
$stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields from vicidial_campaigns where campaign_id='$source_campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');";
$rslt=mysql_query($stmtA, $link);
$stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');";
$rslt=mysql_query($stmtA, $link);
$stmtA="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback) SELECT status,status_name,selectable,\"$campaign_id\",human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_campaign_statuses where campaign_id='$source_campaign_id';";
$rslt=mysql_query($stmtA, $link);
$stmtA="INSERT INTO vicidial_campaign_hotkeys (status,hotkey,status_name,selectable,campaign_id) SELECT status,hotkey,status_name,selectable,\"$campaign_id\" from vicidial_campaign_hotkeys where campaign_id='$source_campaign_id';";
$rslt=mysql_query($stmtA, $link);
$stmtA="INSERT INTO vicidial_lead_recycle (status,attempt_delay,attempt_maximum,active,campaign_id) SELECT status,attempt_delay,attempt_maximum,active,\"$campaign_id\" from vicidial_lead_recycle where campaign_id='$source_campaign_id';";
$rslt=mysql_query($stmtA, $link);
$stmtA="INSERT INTO vicidial_pause_codes (pause_code,pause_code_name,billable,campaign_id) SELECT pause_code,pause_code_name,billable,\"$campaign_id\" from vicidial_pause_codes where campaign_id='$source_campaign_id';";
$rslt=mysql_query($stmtA, $link);
$stmtA="INSERT INTO vicidial_xfer_presets (campaign_id,preset_name,preset_number,preset_dtmf,preset_hide_number) SELECT \"$campaign_id\",preset_name,preset_number,preset_dtmf,preset_hide_number from vicidial_xfer_presets where campaign_id='$source_campaign_id';";
$rslt=mysql_query($stmtA, $link);
$stmtA="INSERT INTO vicidial_xfer_stats (campaign_id,preset_name) SELECT \"$campaign_id\",preset_name from vicidial_xfer_presets where campaign_id='$source_campaign_id';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='COPY', record_id='$campaign_id', event_code='ADMIN COPY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
$ADD=31;
}
######################
# ADD=22 adds the new campaign status to the system
######################
if ($ADD==22)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>CAMPAIGN STATUS NOT ADDED - there is already a campaign-status in the system with this name\n";}
else
{
$stmt="SELECT count(*) from vicidial_statuses where status='$status_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>CAMPAIGN STATUS NOT ADDED - there is already a global-status in the system with this name\n";}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($status_id) < 1) or (strlen($status_name) < 2) )
{
echo "<br>CAMPAIGN STATUS NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>status must be between 1 and 8 characters in length\n";
echo "<br>status name must be between 2 and 30 characters in length\n";
}
else
{
echo "<br><B>CAMPAIGN STATUS ADDED: $campaign_id - $status_id</B>\n";
$stmt="INSERT INTO vicidial_campaign_statuses (status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback) values('$status_id','$status_name','$selectable','$campaign_id','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable','$scheduled_callbacks');";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_STATUS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADD CAMPAIGN STATUS', event_sql=\"$SQL_log\", event_notes='Status: $status_id';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
$SUB=22;
$ADD=31;
}
######################
# ADD=23 adds the new campaign hotkey to the system
######################
if ($ADD==23)
{
$HKstatus_data = explode('-----',$HKstatus);
$status = $HKstatus_data[0];
$status_name = $HKstatus_data[1];
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_campaign_hotkeys where campaign_id='$campaign_id' and hotkey='$hotkey' and hotkey='$hotkey';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>CAMPAIGN HOT KEY NOT ADDED - there is already a campaign-hotkey in the system with this hotkey\n";}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) )
{
echo "<br>CAMPAIGN HOT KEY NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>hotkey must be a single character between 1 and 9 \n";
echo "<br>status must be between 1 and 8 characters in length\n";
}
else
{
echo "<br><B>CAMPAIGN HOT KEY ADDED: $campaign_id - $status - $hotkey</B>\n";
$stmt="INSERT INTO vicidial_campaign_hotkeys values('$status','$hotkey','$status_name','$selectable','$campaign_id');";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_HOTKEY', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADD CAMPAIGN HOTKEY', event_sql=\"$SQL_log\", event_notes='Status: $status|HotKey: $hotkey';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$SUB=23;
$ADD=31;
}
######################
# ADD=25 adds the new campaign lead recycle entry to the system
######################
if ($ADD==25)
{
$status = eregi_replace("-----.*",'',$status);
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>CAMPAIGN LEAD RECYCLE NOT ADDED - there is already a lead-recycle for this campaign with this status\n";}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_delay >= 43200) or ($attempt_maximum < 1) or ($attempt_maximum > 10) )
{
echo "<br>CAMPAIGN LEAD RECYCLE NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>status must be between 1 and 6 characters in length\n";
echo "<br>attempt delay must be at least 120 seconds and less than 43200 seconds or 12 hours\n";
echo "<br>maximum attempts must be from 1 to 10\n";
}
else
{
echo "<br><B>CAMPAIGN LEAD RECYCLE ADDED: $campaign_id - $status - $attempt_delay</B>\n";
$stmt="INSERT INTO vicidial_lead_recycle(campaign_id,status,attempt_delay,attempt_maximum,active) values('$campaign_id','$status','$attempt_delay','$attempt_maximum','$active');";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_RECYCLE', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADD CAMPAIGN LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='Status: $status';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$SUB=25;
$ADD=31;
}
######################
# ADD=26 adds the new auto alt dial status to the campaign
######################
if ($ADD==26)
{
$status = eregi_replace("-----.*",'',$status);
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial_statuses LIKE \"% $status %\";";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>AUTO ALT DIAL STATUS NOT ADDED - there is already an entry for this campaign with this status\n";}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) )
{
echo "<br>AUTO ALT DIAL STATUS NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>status must be between 1 and 6 characters in length\n";
}
else
{
echo "<br><B>AUTO ALT DIAL STATUS ADDED: $campaign_id - $status</B>\n";
$stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if (strlen($row[0])<2) {$row[0] = ' -';}
$auto_alt_dial_statuses = " $status$row[0]";
$stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_ALTDIAL', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADD CAMPAIGN ALT DIAL', event_sql=\"$SQL_log\", event_notes='Status: $auto_alt_dial_statuses';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$SUB=26;
$ADD=31;
}
######################
# ADD=27 adds the new campaign agent pause code entry to the system
######################
if ($ADD==27)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>AGENT PAUSE CODE NOT ADDED - there is already an entry for this campaign with this pause code\n";}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) or (strlen($pause_code) > 6) or (strlen($pause_code_name) < 2) )
{
echo "<br>AGENT PAUSE CODE NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>pause code must be between 1 and 6 characters in length\n";
echo "<br>pause code name must be between 2 and 30 characters in length\n";
}
else
{
echo "<br><B>AGENT PAUSE CODE ADDED: $campaign_id - $pause_code - $pause_code_name</B>\n";
$stmt="INSERT INTO vicidial_pause_codes(campaign_id,pause_code,pause_code_name,billable) values('$campaign_id','$pause_code','$pause_code_name','$billable');";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_PAUSECODE', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADD CAMPAIGN PAUSE CODE', event_sql=\"$SQL_log\", event_notes='Pause Code: $pause_code';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$SUB=27;
$ADD=31;
}
######################
# ADD=28 adds new status to the campaign dial statuses
######################
if ($ADD==28)
{
$status = eregi_replace("-----.*",'',$status);
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\";";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>CAMPAIGN DIAL STATUS NOT ADDED - there is already an entry for this campaign with this status\n";}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) )
{
echo "<br>CAMPAIGN DIAL STATUS NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>status must be between 1 and 6 characters in length\n";
}
else
{
echo "<br><B>CAMPAIGN DIAL STATUS ADDED: $campaign_id - $status</B>\n";
$stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if (strlen($row[0])<2) {$row[0] = ' -';}
$dial_statuses = " $status$row[0]";
$stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_DIALSTATUS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADD CAMPAIGN DIAL STATUS', event_sql=\"$SQL_log\", event_notes='Status: $statuses';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
#$SUB=28;
$ADD=31;
}
######################
# ADD=201 adds new preset to the campaign presets
######################
if ($ADD==201)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_xfer_presets where campaign_id='$campaign_id' and preset_name='$preset_name';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>PRESET NOT ADDED - there is already an entry for this campaign with this preset\n";}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) )
{
echo "<br>PRESET NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>preset name must be between 1 and 40 characters in length\n";
echo "<br>preset number must be between 2 and 50 characters in length\n";
}
else
{
echo "<br><B>PRESET ADDED: $campaign_id - $preset_name - $preset_number</B>\n";
$stmt="INSERT INTO vicidial_xfer_presets(campaign_id,preset_name,preset_number,preset_dtmf,preset_hide_number) values('$campaign_id','$preset_name','$preset_number','$preset_dtmf','$preset_hide_number');";
$rslt=mysql_query($stmt, $link);
$stmt="INSERT INTO vicidial_xfer_stats(campaign_id,preset_name) values('$campaign_id','$preset_name');";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_PRESET', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADD CAMPAIGN PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name - $preset_number';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$SUB=201;
$ADD=31;
}
######################
# ADD=211 adds the new list to the system
######################
if ($ADD==211)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_lists' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$list_id = ($row[0] + 1);
$stmt="UPDATE vicidial_override_ids SET value='$list_id' where id_table='vicidial_lists' and active='1';";
$rslt=mysql_query($stmt, $link);
}
##### END ID override optional section #####
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_lists where list_id='$list_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>LIST NOT ADDED - there is already a list in the system with this ID\n";}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($list_name) < 2) or ($list_id < 100) or (strlen($list_id) > 8) )
{
echo "<br>LIST NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>List ID must be between 2 and 8 characters in length\n";
echo "<br>List name must be at least 2 characters in length\n";
echo "<br>List ID must be greater than 100\n";
}
else
{
echo "<br><B>LIST ADDED: $list_id</B>\n";
$stmt="INSERT INTO vicidial_lists (list_id,list_name,campaign_id,active,list_description,list_changedate) values('$list_id','$list_name','$campaign_id','$active','$list_description','$SQLdate');";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD LIST', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=311;
}
######################
# ADD=2111 adds the new inbound group to the system
######################
if ($ADD==2111)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_inbound_groups' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$group_id = ($row[0] + 1);
$stmt="UPDATE vicidial_override_ids SET value='$group_id' where id_table='vicidial_inbound_groups' and active='1';";
$rslt=mysql_query($stmt, $link);
}
##### END ID override optional section #####
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>GROUP NOT ADDED - there is already a group in the system with this ID\n";}
else
{
$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$group_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>GROUP NOT ADDED - there is already a campaign in the system with this ID\n";}
else
{
if ( (strlen($group_id) < 2) or (strlen($group_name) < 2) or (strlen($group_color) < 2) or (strlen($group_id) > 20) or (eregi(' ',$group_id)) or (eregi("\-",$group_id)) or (eregi("\+",$group_id)) )
{
echo "<br>GROUP NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>Group ID must be between 2 and 20 characters in length and contain no ' -+'.\n";
echo "<br>Group name and group color must be at least 2 characters in length\n";
}
else
{
$stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,web_form_address_two,start_call_url,dispo_call_url,add_lead_url) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','','');";
$rslt=mysql_query($stmt, $link);
$stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');";
$rslt=mysql_query($stmtA, $link);
$stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');";
$rslt=mysql_query($stmtA, $link);
echo "<br><B>GROUP ADDED: $group_id</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='ADD', record_id='$group_id', event_code='ADMIN ADD INBOUND GROUP', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
$ADD=3111;
}
######################
# ADD=2011 adds copied inbound group to the system
######################
if ($ADD==2011)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_inbound_groups' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$group_id = ($row[0] + 1);
$stmt="UPDATE vicidial_override_ids SET value='$group_id' where id_table='vicidial_inbound_groups' and active='1';";
$rslt=mysql_query($stmt, $link);
}
##### END ID override optional section #####
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>GROUP NOT ADDED - there is already a group in the system with this ID\n";}
else
{
$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$group_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>GROUP NOT ADDED - there is already a campaign in the system with this ID\n";}
else
{
if ( (strlen($group_id) < 2) or (strlen($group_name) < 2) or (strlen($group_id) > 20) or (eregi(' ',$group_id)) or (eregi("\-",$group_id)) or (eregi("\+",$group_id)) )
{
echo "<br>GROUP NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>Group ID must be between 2 and 20 characters in length and contain no ' -+'.\n";
echo "<br>Group name and group color must be at least 2 characters in length\n";
}
else
{
$stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,ignore_list_script_override,extension_appended_cidname,uniqueid_status_display,uniqueid_status_prefix,hold_time_option_minimum,hold_time_option_press_filename,hold_time_option_callmenu,onhold_prompt_no_block,onhold_prompt_seconds,hold_time_option_no_block,hold_time_option_prompt_seconds,hold_time_second_option,hold_time_third_option,wait_hold_option_priority,wait_time_option,wait_time_second_option,wait_time_third_option,wait_time_option_seconds,wait_time_option_exten,wait_time_option_voicemail,wait_time_option_xfer_group,wait_time_option_callmenu,wait_time_option_callback_filename,wait_time_option_callback_list_id,wait_time_option_press_filename,wait_time_option_no_block,wait_time_option_prompt_seconds,timer_action_destination,calculate_estimated_hold_seconds,add_lead_url,eht_minimum_prompt_filename,eht_minimum_prompt_no_block,eht_minimum_prompt_seconds,on_hook_ring_time) SELECT \"$group_id\",\"$group_name\",group_color,\"N\",web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,ignore_list_script_override,extension_appended_cidname,uniqueid_status_display,uniqueid_status_prefix,hold_time_option_minimum,hold_time_option_press_filename,hold_time_option_callmenu,onhold_prompt_no_block,onhold_prompt_seconds,hold_time_option_no_block,hold_time_option_prompt_seconds,hold_time_second_option,hold_time_third_option,wait_hold_option_priority,wait_time_option,wait_time_second_option,wait_time_third_option,wait_time_option_seconds,wait_time_option_exten,wait_time_option_voicemail,wait_time_option_xfer_group,wait_time_option_callmenu,wait_time_option_callback_filename,wait_time_option_callback_list_id,wait_time_option_press_filename,wait_time_option_no_block,wait_time_option_prompt_seconds,timer_action_destination,calculate_estimated_hold_seconds,add_lead_url,eht_minimum_prompt_filename,eht_minimum_prompt_no_block,eht_minimum_prompt_seconds,on_hook_ring_time from vicidial_inbound_groups where group_id=\"$source_group_id\";";
$rslt=mysql_query($stmt, $link);
$stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');";
$rslt=mysql_query($stmtA, $link);
$stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');";
$rslt=mysql_query($stmtA, $link);
echo "<br><B>GROUP ADDED: $group_id</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='COPY', record_id='$group_id', event_code='ADMIN COPY INBOUND GROUP', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
$ADD=3111;
}
######################
# ADD=2311 adds the new did to the system
######################
if ($ADD==2311)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$did_pattern';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>DID NOT ADDED - there is already a DID in the system with this ID\n";}
else
{
$stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$did_pattern';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>DID NOT ADDED - there is already a DID in the system with this extension\n";}
else
{
if ( (strlen($did_pattern) < 2) or (eregi(' ',$did_pattern)) or (eregi('-',$did_pattern)) or (eregi("\+",$did_pattern)) )
{
echo "<br>DID NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>DID Extension must be between 2 and 20 characters in length and contain no ' -+'.\n";
}
else
{
$stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description) values('$did_pattern','$did_description');";
$rslt=mysql_query($stmt, $link);
$stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$did_id = $row[0];
echo "<br><B>DID ADDED: $did_pattern $did_description - $did_id</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='DIDS', event_type='ADD', record_id='$did_id', event_code='ADMIN ADD DID', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
$ADD=3311;
}
######################
# ADD=2411 adds copied did to the system
######################
if ($ADD==2411)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$did_pattern';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>DID NOT ADDED - there is already a DID in the system with this extension\n";}
else
{
if ( (strlen($source_did) < 1) or (strlen($did_pattern) < 1) or (eregi(' ',$source_did)) or (eregi(' ',$did_pattern)) or (eregi("\+",$source_did)) )
{
echo "<br>DID NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>DID Extension must be between 2 and 20 characters in length and contain no ' -+'.\n";
}
else
{
$stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number) SELECT \"$did_pattern\",\"$did_description\",did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number from vicidial_inbound_dids where did_id=\"$source_did\";";
$rslt=mysql_query($stmt, $link);
$stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$did_id = $row[0];
echo "<br><B>DID ADDED: $did_pattern - $did_id</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='DIDS', event_type='COPY', record_id='$did_id', event_code='ADMIN COPY DID', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=3311;
}
######################
# ADD=2511 adds the new call menu to the system
######################
if ($ADD==2511)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_call_menu' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$menu_id = ($row[0] + 1);
$stmt="UPDATE vicidial_override_ids SET value='$menu_id' where id_table='vicidial_call_menu' and active='1';";
$rslt=mysql_query($stmt, $link);
}
##### END ID override optional section #####
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_call_menu where menu_id='$menu_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
echo "<br>CALL MENU NOT ADDED - there is already a CALL MENU in the system with this ID\n";
$ADD=1500;
}
else
{
if ( (preg_match("/^vicidial$/i",$menu_id)) or (preg_match("/^vicidial-auto$/i",$menu_id)) or (preg_match("/^general$/i",$menu_id)) or (preg_match("/^globals$/i",$menu_id)) or (preg_match("/^default$/i",$menu_id)) or (preg_match("/^trunkinbound$/i",$menu_id)) or (preg_match("/^loopback-no-log$/i",$menu_id)) or (preg_match("/^monitor_exit$/i",$menu_id)) or (preg_match("/^monitor$/i",$menu_id)) )
{
echo "<br>CALL MENU NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>Call Menu ID cannot use reserved words: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n";
$ADD=1500;
}
else
{
if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) )
{
echo "<br>CALL MENU NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>Call Menu ID must be between 2 and 50 characters in length and contain no ' '.\n";
$ADD=1500;
}
else
{
$stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name) values('$menu_id','$menu_name');";
$rslt=mysql_query($stmt, $link);
echo "<br><B>CALL MENU ADDED: $menu_id $menu_name</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='ADD', record_id='$menu_id', event_code='ADMIN ADD CALL MENU', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$ADD=3511;
}
}
}
}
######################
# ADD=2611 adds copied call menu to the system
######################
if ($ADD==2611)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_call_menu' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$menu_id = ($row[0] + 1);
$stmt="UPDATE vicidial_override_ids SET value='$menu_id' where id_table='vicidial_call_menu' and active='1';";
$rslt=mysql_query($stmt, $link);
}
##### END ID override optional section #####
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_call_menu where menu_id='$menu_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
echo "<br>CALL MENU NOT ADDED - there is already a CALL MENU in the system with this ID\n";
$ADD=1500;
}
else
{
if ( (preg_match("/^vicidial$/i",$menu_id)) or (preg_match("/^vicidial-auto$/i",$menu_id)) or (preg_match("/^general$/i",$menu_id)) or (preg_match("/^globals$/i",$menu_id)) or (preg_match("/^default$/i",$menu_id)) or (preg_match("/^trunkinbound$/i",$menu_id)) or (preg_match("/^loopback-no-log$/i",$menu_id)) or (preg_match("/^monitor_exit$/i",$menu_id)) or (preg_match("/^monitor$/i",$menu_id)) )
{
echo "<br>CALL MENU NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>Call Menu ID cannot use reserved words: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n";
$ADD=1500;
}
else
{
if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) or (strlen($source_menu) < 2) or (eregi(' ',$source_menu)) )
{
echo "<br>CALL MENU NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>Call Menu ID must be between 2 and 50 characters in length and contain no ' '.\n";
$ADD=1500;
}
else
{
$stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name,menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group,dtmf_log) SELECT \"$menu_id\",\"$menu_name\",menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group,dtmf_log from vicidial_call_menu where menu_id=\"$source_menu\";";
$rslt=mysql_query($stmt, $link);
$stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';";
$rslt=mysql_query($stmtA, $link);
echo "<br><B>CALL MENU ADDED: $menu_id - $menu_name</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtA";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='COPY', record_id='$menu_id', event_code='ADMIN COPY MENU', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$ADD=3511;
}
}
}
}
######################
# ADD=2711 adds the new filter phone group to the system
######################
if ($ADD==2711)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>PHONE FILTER GROUP NOT ADDED - there is already a PHONE FILTER GROUP in the system with this ID\n";}
else
{
if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_id) > 20) or (eregi(' ',$filter_phone_group_id)) )
{
echo "<br>PHONE FILTER GROUP NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>Phone Filter Group ID must be between 2 and 20 characters in length and contain no ' '.\n";
}
else
{
$stmt="INSERT INTO vicidial_filter_phone_groups (filter_phone_group_id,filter_phone_group_name,filter_phone_group_description) values('$filter_phone_group_id','$filter_phone_group_name','$filter_phone_group_description');";
$rslt=mysql_query($stmt, $link);
echo "<br><B>PHONE FILTER GROUP ADDED: $filter_phone_group_id $filter_phone_group_name</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='ADD', record_id='$filter_phone_group_id', event_code='ADMIN ADD FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='$filter_phone_group_name';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=3711;
}
######################
# ADD=21111 adds new remote agents to the system
######################
if ($ADD==21111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_remote_agents where server_ip='$server_ip' and user_start='$user_start';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>REMOTE AGENTS NOT ADDED - there is already a remote agents entry starting with this userID\n";}
else
{
### check for a valid user that will be associated with this account
$stmt="SELECT count(*) from vicidial_users where user='$user_start';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] < 1)
{echo "<br>REMOTE AGENTS NOT ADDED - you must use a valid user as the user_start for remote agents\n";}
else
{
### check for closest remote agents to this account to ensure no overlapping
$user_finish = ($user_start + $number_of_lines);
$stmt="SELECT count(*) from vicidial_remote_agents where user_start >= '$user_start' and user_start < '$user_finish';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>REMOTE AGENTS NOT ADDED - your number of lines overlaps with another remote agent\n";}
else
{
if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) )
{
echo "<br>REMOTE AGENTS NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>User ID start and external extension must be at least 2 characters in length\n";
}
else
{
$stmt="INSERT INTO vicidial_remote_agents (user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns) values('$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');";
$rslt=mysql_query($stmt, $link);
echo "<br><B>REMOTE AGENTS ADDED: $user_start</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='ADD', record_id='$user_start', event_code='ADMIN ADD REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
}
$ADD=10000;
}
######################
# ADD=22111 adds new extension group entry to the system
######################
if ($ADD==22111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>EXTENSION GROUP ENTRY NOT ADDED - there is already an extension group entry with these values\n";}
else
{
if ( (strlen($extension_group_id) < 2) or (strlen($extension) < 2) or (strlen($rank) < 1) )
{
echo "<br>EXTENSION GROUP ENTRY NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>extension group id and extension and rank must be at least 2 characters in length\n";
}
else
{
$stmt="INSERT INTO vicidial_extension_groups (extension_group_id,extension,rank,campaign_groups) values('$extension_group_id','$extension','$rank','$campaign_groups');";
$rslt=mysql_query($stmt, $link);
$stmt="SELECT extension_id from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$extension_id = $row[0];
echo "<br><B>EXTENSION GROUP ENTRY ADDED: $extension_id - $extension_group_id - $extension</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='ADD', record_id='$extension_id', event_code='ADMIN ADD EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=12000;
}
######################
# ADD=211111 adds new user group to the system
######################
if ($ADD==211111)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_user_groups' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$user_group = ($row[0] + 1);
$stmt="UPDATE vicidial_override_ids SET value='$user_group' where id_table='vicidial_user_groups' and active='1';";
$rslt=mysql_query($stmt, $link);
}
##### END ID override optional section #####
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_user_groups where user_group='$user_group';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>USER GROUP NOT ADDED - there is already a user group entry with this name\n";}
else
{
if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) )
{
echo "<br>USER GROUP NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>Group name and description must be at least 2 characters in length\n";
}
else
{
$stmt="INSERT INTO vicidial_user_groups(user_group,group_name,allowed_campaigns) values('$user_group','$group_name','-ALL-CAMPAIGNS-');";
$rslt=mysql_query($stmt, $link);
echo "<br><B>USER GROUP ADDED: $user_group</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='ADD', record_id='$user_group', event_code='ADMIN ADD USER GROUP', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
###############################################################
##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP #####
$stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$ss_conf_ct = mysql_num_rows($rslt);
if ($ss_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$enable_vtiger_integration = $row[0];
$vtiger_server_ip = $row[1];
$vtiger_dbname = $row[2];
$vtiger_login = $row[3];
$vtiger_pass = $row[4];
$vtiger_url = $row[5];
}
##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP #####
#############################################################
if ($enable_vtiger_integration > 0)
{
### connect to your vtiger database
$linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass");
if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());}
echo 'Connected successfully';
mysql_select_db("$vtiger_dbname", $linkV);
######################################
##### BEGIN Add/Update group info in Vtiger
$stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$group_found_count = $row[0];
### group exists in vtiger, update it
if ($group_found_count > 0)
{
$stmt="SELECT groupid from vtiger_groups where groupname='$user_group';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$groupid = $row[0];
}
### user doesn't exist in vtiger, insert it
else
{
#### BEGIN CREATE NEW GROUP RECORD IN VTIGER
# Get next available id from vtiger_users_seq to use as groupid
$stmt="SELECT id from vtiger_users_seq;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
$row=mysql_fetch_row($rslt);
$groupid = ($row[0] + 1);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
# Increase next available groupid with 1 so next record gets proper id
$stmt="UPDATE vtiger_users_seq SET id = '$groupid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
#### END CREATE NEW GROUP RECORD IN VTIGER
}
##### END Add/Update group info in Vtiger
######################################
}
}
}
$ADD=100000;
}
######################
# ADD=2111111 adds new script to the system
######################
if ($ADD==2111111)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_scripts' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$script_id = ($row[0] + 1);
$stmt="UPDATE vicidial_override_ids SET value='$script_id' where id_table='vicidial_scripts' and active='1';";
$rslt=mysql_query($stmt, $link);
}
##### END ID override optional section #####
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_scripts where script_id='$script_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>SCRIPT NOT ADDED - there is already a script entry with this name\n";}
else
{
if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) )
{
echo "<br>SCRIPT NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>Script name, description and text must be at least 2 characters in length\n";
}
else
{
$stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active');";
$rslt=mysql_query($stmt, $link);
if ($DB > 0) {echo "|$stmt|";}
echo "<br><B>SCRIPT ADDED: $script_id</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SCRIPTS', event_type='ADD', record_id='$script_id', event_code='ADMIN ADD SCRIPT', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=1000000;
}
######################
# ADD=21111111 adds new filter to the system
######################
if ($ADD==21111111)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_lead_filters' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$lead_filter_id = ($row[0] + 1);
$stmt="UPDATE vicidial_override_ids SET value='$lead_filter_id' where id_table='vicidial_lead_filters' and active='1';";
$rslt=mysql_query($stmt, $link);
}
##### END ID override optional section #####
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_lead_filters where lead_filter_id='$lead_filter_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>FILTER NOT ADDED - there is already a filter entry with this ID\n";}
else
{
if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) )
{
echo "<br>FILTER NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>Filter ID, name and SQL must be at least 2 characters in length\n";
}
else
{
$stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "';";
$rslt=mysql_query($stmt, $link);
if ($DB > 0) {echo "|$stmt|";}
echo "<br><B>FILTER ADDED: $lead_filter_id</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERS', event_type='ADD', record_id='$lead_filter_id', event_code='ADMIN ADD FILTER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=10000000;
}
######################
# ADD=211111111 adds new call time definition to the system
######################
if ($ADD==211111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_call_times where call_time_id='$call_time_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>CALL TIME DEFINITION NOT ADDED - there is already a call time entry with this ID\n";}
else
{
if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) )
{
echo "<br>CALL TIME DEFINITION NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>Call Time ID and name must be at least 2 characters in length\n";
}
else
{
$stmt="INSERT INTO vicidial_call_times SET call_time_id='$call_time_id',call_time_name='$call_time_name',call_time_comments='$call_time_comments';";
$rslt=mysql_query($stmt, $link);
if ($DB > 0) {echo "|$stmt|";}
echo "<br><B>CALL TIME ADDED: $call_time_id</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLTIMES', event_type='ADD', record_id='$call_time_id', event_code='ADMIN ADD CALL TIME', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=311111111;
}
######################
# ADD=2111111111 adds new state call time definition to the system
######################
if ($ADD==2111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_state_call_times where state_call_time_id='$call_time_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>STATE CALL TIME DEFINITION NOT ADDED - there is already a call time entry with this ID\n";}
else
{
if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) )
{
echo "<br>STATE CALL TIME DEFINITION NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>State Call Time ID, name and state must be at least 2 characters in length\n";
}
else
{
$stmt="INSERT INTO vicidial_state_call_times SET state_call_time_id='$call_time_id',state_call_time_name='$call_time_name',state_call_time_comments='$call_time_comments',state_call_time_state='$state_call_time_state';";
$rslt=mysql_query($stmt, $link);
if ($DB > 0) {echo "|$stmt|";}
echo "<br><B>STATE CALL TIME ADDED: $call_time_id</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLTIMES_STATE', event_type='ADD', record_id='$call_time_id', event_code='ADMIN ADD STATE CALL TIME', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=3111111111;
}
######################
# ADD=231111111 adds new shift definition to the system
######################
if ($ADD==231111111)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT value FROM vicidial_override_ids where id_table='vicidial_shifts' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$shift_id = ($row[0] + 1);
$stmt="UPDATE vicidial_override_ids SET value='$shift_id' where id_table='vicidial_shifts' and active='1';";
$rslt=mysql_query($stmt, $link);
}
##### END ID override optional section #####
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_shifts where shift_id='$shift_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>SHIFT DEFINITION NOT ADDED - there is already a shift entry with this ID\n";}
else
{
$shift_length_test = eregi_replace(':','',$shift_length);
if ( (strlen($shift_id) < 2) or (strlen($shift_name) < 2) or (strlen($shift_start_time) < 4) or (strlen($shift_start_time) > 4) or (strlen($shift_length) < 5) or (strlen($shift_length) > 5) or ($shift_start_time > 2359) or ($shift_length_test > 2400) )
{
echo "<br>SHIFT DEFINITION NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>Shift ID and name must be at least 2 characters in length\n";
echo "<br>Shift Start Time must be 4 digits in length and be a valid time\n";
echo "<br>Shift Length must be 5 characters in length and be 24 hours or less\n";
}
else
{
$p=0;
$shift_weekdays_ct = count($shift_weekdays);
while ($p <= $shift_weekdays_ct)
{
$SHIFT_weekdays .= "$shift_weekdays[$p]";
$p++;
}
$stmt="INSERT INTO vicidial_shifts SET shift_id='$shift_id',shift_name='$shift_name',shift_start_time='$shift_start_time',shift_length='$shift_length',shift_weekdays='$SHIFT_weekdays';";
$rslt=mysql_query($stmt, $link);
if ($DB > 0) {echo "|$stmt|";}
echo "<br><B>SHIFT ADDED: $shift_id</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SHIFTS', event_type='ADD', record_id='$shift_id', event_code='ADMIN ADD SHIFT', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=331111111;
}
######################
# ADD=21111111111 adds new phone to the system
######################
if ($ADD==21111111111)
{
##### BEGIN ID override optional section, if enabled it increments user by 1 ignoring entered value #####
$stmt = "SELECT value FROM vicidial_override_ids where id_table='phones' and active='1';";
$rslt=mysql_query($stmt, $link);
$voi_ct = mysql_num_rows($rslt);
if ($voi_ct > 0)
{
$row=mysql_fetch_row($rslt);
$extension = ($row[0] + 1);
$stmt="UPDATE vicidial_override_ids SET value='$extension' where id_table='phones' and active='1';";
$rslt=mysql_query($stmt, $link);
}
##### END ID override optional section #####
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>PHONE NOT ADDED - there is already a Phone in the system with this extension/server\n";}
else
{
$stmt="SELECT count(*) from phones where login='$login';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>PHONE NOT ADDED - there is already a Phone in the system with this login\n";}
else
{
$stmt="SELECT count(*) from phones_alias where alias_id='$login';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>PHONE NOT ADDED - there is already a Phone alias in the system with this login\n";}
else
{
$stmt="SELECT count(*) from vicidial_voicemail where voicemail_id='$voicemail_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>PHONE NOT ADDED - there is already a Voicemail ID in the system with this ID\n";}
else
{
if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1))
{
echo "<BR>PHONE NOT ADDED - Please go back and look at the data you entered\n";
echo "<BR>The following fields must have data: extension, server_ip, dialplan_number, voicemail_id, login, pass\n";
}
else
{
echo "<br>PHONE ADDED\n";
$stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid,conf_secret,voicemail_timezone) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid','$conf_secret','$SSdefault_voicemail_timezone');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONES', event_type='ADD', record_id='$extension', event_code='ADMIN ADD PHONE', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
}
}
$ADD=31111111111;
}
######################
# ADD=22111111111 adds new phone alias to the system
######################
if ($ADD==22111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from phones_alias where alias_id='$alias_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>PHONE ALIAS NOT ADDED - there is already a Phone Alias in the system with this ID\n";}
else
{
$stmt="SELECT count(*) from phones where login='$alias_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>PHONE ALIAS NOT ADDED - there is already a Phone Login in the system with this ID\n";}
else
{
if ( (strlen($alias_id) < 1) or (strlen($alias_name) < 2) )
{echo "<br>PHONE ALIAS NOT ADDED - Please go back and look at the data you entered\n";}
else
{
echo "<br>PHONE ALIAS ADDED\n";
$stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list) values('$alias_id','$alias_name','$logins_list');";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONEALIASES', event_type='ADD', record_id='$alias_id', event_code='ADMIN ADD PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
$ADD=32111111111;
}
######################
# ADD=23111111111 adds new group alias to the system
######################
if ($ADD==23111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from groups_alias where group_alias_id='$group_alias_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>GROUP ALIAS NOT ADDED - there is already a Phone Alias in the system with this ID\n";}
else
{
if (preg_match("/AGENT_PHONE|CUSTOMER|CAMPAIGN|NONE/",$group_alias_id))
{echo "<br>GROUP ALIAS NOT ADDED - you cannot use reserved words in group aliases\n";}
else
{
if ( (strlen($group_alias_id) < 1) or (strlen($group_alias_name) < 2) )
{echo "<br>GROUP ALIAS NOT ADDED - Please go back and look at the data you entered\n";}
else
{
echo "<br>GROUP ALIAS ADDED\n";
$stmt="INSERT INTO groups_alias (group_alias_id,group_alias_name,caller_id_number,caller_id_name,active) values('$group_alias_id','$group_alias_name','$caller_id_number','$caller_id_name','$active');";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='GROUPALIASES', event_type='ADD', record_id='$group_alias_id', event_code='ADMIN ADD GROUP ALIAS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
$ADD=33111111111;
}
######################
# ADD=211111111111 adds new server to the system
######################
if ($ADD==211111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from servers where server_id='$server_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>SERVER NOT ADDED - there is already a server in the system with this ID\n";}
else
{
if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) )
{echo "<br>SERVER NOT ADDED - Please go back and look at the data you entered\n";}
else
{
echo "<br>SERVER ADDED\n";
$stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version,conf_secret,local_gmt) values('$server_id','$server_description','$server_ip','$active','$asterisk_version','$SSdefault_server_password','$SSdefault_local_gmt');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y',sounds_update='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SERVERS', event_type='ADD', record_id='$server_id', event_code='ADMIN ADD SERVER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=311111111111;
}
######################
# ADD=221111111111 adds the new vicidial server trunk record to the system
######################
if ($ADD==221111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT max_vicidial_trunks from servers where server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
$MAXvicidial_trunks = $rowx[0];
$stmt="SELECT sum(dedicated_trunks) from vicidial_server_trunks where server_ip='$server_ip' and campaign_id !='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
$SUMvicidial_trunks = ($rowx[0] + $dedicated_trunks);
if ($SUMvicidial_trunks > $MAXvicidial_trunks)
{
echo "<br>VICIDIAL SERVER TRUNK RECORD NOT ADDED - the number of vicidial trunks is too high: $SUMvicidial_trunks / $MAXvicidial_trunks\n";
}
else
{
$stmt="SELECT count(*) from vicidial_server_trunks where campaign_id='$campaign_id' and server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>VICIDIAL SERVER TRUNK RECORD NOT ADDED - there is already a server-trunk record for this campaign\n";}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) or (strlen($dedicated_trunks) < 1) or (strlen($trunk_restriction) < 1) )
{
echo "<br>VICIDIAL SERVER TRUNK RECORD NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>campaign must be between 3 and 8 characters in length\n";
echo "<br>server_ip delay must be at least 7 characters\n";
echo "<br>trunks must be a digit from 0 to 9999\n";
}
else
{
echo "<br><B>VICIDIAL SERVER TRUNK RECORD ADDED: $campaign_id - $server_ip - $dedicated_trunks - $trunk_restriction</B>\n";
$stmt="INSERT INTO vicidial_server_trunks(server_ip,campaign_id,dedicated_trunks,trunk_restriction) values('$server_ip','$campaign_id','$dedicated_trunks','$trunk_restriction');";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SERVERS_TRUNK', event_type='ADD', record_id='$server_ip', event_code='ADMIN ADD SERVER TRUNK', event_sql=\"$SQL_log\", event_notes='campaign: $campaign_id';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
$ADD=311111111111;
}
######################
# ADD=231111111111 adds new conf template to the system
######################
if ($ADD==231111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_conf_templates where template_id='$template_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>CONF TEMPLATE NOT ADDED - there is already a template in the system with this ID\n";}
else
{
if (strlen($template_id) < 2)
{echo "<br>CONF TEMPLATE NOT ADDED - Please go back and look at the data you entered\n";}
else
{
echo "<br>CONF TEMPLATE ADDED\n";
$stmt="INSERT INTO vicidial_conf_templates (template_id,template_name,template_contents) values('$template_id','$template_name','$template_contents');";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONFTEMPLATES', event_type='ADD', record_id='$template_id', event_code='ADMIN ADD CONF TEMPLATE', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=331111111111;
}
######################
# ADD=241111111111 adds new server carrier to the system
######################
if ($ADD==241111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_server_carriers where carrier_id='$carrier_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>CARRIER NOT ADDED - there is already a carrier in the system with this ID\n";}
else
{
if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) )
{echo "<br>CARRIER NOT ADDED - Please go back and look at the data you entered\n";}
else
{
echo "<br>CARRIER ADDED\n";
$stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active,carrier_description) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N','$carrier_description');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CARRIERS', event_type='ADD', record_id='$carrier_id', event_code='ADMIN ADD CARRIER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=341111111111;
}
######################
# ADD=240111111111 adds copied server carrier to the system
######################
if ($ADD==240111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_server_carriers where carrier_id='$carrier_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>CARRIER NOT ADDED - there is already a carrier in the system with this ID\n";}
else
{
if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) )
{echo "<br>CARRIER NOT ADDED - Please go back and look at the data you entered\n";}
else
{
echo "<br>COPIED CARRIER ADDED\n";
$stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active,carrier_description) SELECT \"$carrier_id\",\"$carrier_name\",registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,\"$server_ip\",\"N\",carrier_description from vicidial_server_carriers where carrier_id=\"$source_carrier\";";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CARRIERS', event_type='COPY', record_id='$carrier_id', event_code='ADMIN COPY CARRIER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=341111111111;
}
######################
# ADD=251111111111 adds new tts entry to the system
######################
if ($ADD==251111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_tts_prompts where tts_id='$tts_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>TTS ENTRY NOT ADDED - there is already a tts entry in the system with this ID\n";}
else
{
if ( (strlen($tts_id) < 2) or (strlen($tts_name) < 3) )
{echo "<br>TTS ENTRY NOT ADDED - Please go back and look at the data you entered\n";}
else
{
echo "<br>TTS ENTRY ADDED\n";
$stmt="INSERT INTO vicidial_tts_prompts SET tts_id='$tts_id',tts_name='$tts_name',active='$active';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TTS', event_type='ADD', record_id='$tts_id', event_code='ADMIN ADD TTS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=351111111111;
}
######################
# ADD=261111111111 adds new music on hold entry to the system
######################
if ($ADD==261111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_music_on_hold where moh_id='$moh_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>MUSIC ON HOLD ENTRY NOT ADDED - there is already a moh entry in the system with this ID\n";}
else
{
if ( (strlen($moh_id) < 2) or (strlen($moh_name) < 3) or ($moh_id=='sounds') or ($moh_id=='agi-bin') or ($moh_id=='astdb') or ($moh_id=='keys') )
{echo "<br>MUSIC ON HOLD ENTRY NOT ADDED - Please go back and look at the data you entered\n";}
else
{
echo "<br>MUSIC ON HOLD ENTRY ADDED\n";
$stmt="INSERT INTO vicidial_music_on_hold SET moh_id='$moh_id',moh_name='$moh_name',random='$random';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='MOH', event_type='ADD', record_id='$moh_id', event_code='ADMIN ADD MOH', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=361111111111;
}
######################
# ADD=271111111111 adds new voicemail box to the system
######################
if ($ADD==271111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_voicemail where voicemail_id='$voicemail_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>VOICEMAIL BOX NOT ADDED - there is already a voicemail box in the system with this ID\n";}
else
{
$stmt="SELECT count(*) from phones where voicemail_id='$voicemail_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>VOICEMAIL BOX NOT ADDED - there is already a phone in the system with this voicemail ID\n";}
else
{
if ( (strlen($voicemail_id) < 2) or (strlen($pass) < 2) or (strlen($fullname) < 3) )
{echo "<br>VOICEMAIL BOX NOT ADDED - Please go back and look at the data you entered\n";}
else
{
echo "<br>VOICEMAIL BOX ADDED\n";
$stmt="INSERT INTO vicidial_voicemail SET voicemail_id='$voicemail_id',pass='$pass',email='$email',fullname='$fullname',active='$active',voicemail_timezone='$SSdefault_voicemail_timezone';";
$rslt=mysql_query($stmt, $link);
$stmt="SELECT active_voicemail_server from system_settings;";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$active_voicemail_server = $row[0];
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$active_voicemail_server';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='VOICEMAIL', event_type='ADD', record_id='$voicemail_id', event_code='ADMIN ADD VOICEMAIL', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
$ADD=371111111111;
}
######################
# ADD=281111111111 adds new screen label to the system
######################
if ($ADD==281111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_screen_labels where label_id='$label_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>SCREEN LABEL NOT ADDED - there is already a label in the system with this ID\n";}
else
{
if ( (strlen($label_id) < 2) or (strlen($label_name) < 2) )
{echo "<br>SCREEN LABEL NOT ADDED - Please go back and look at the data you entered\n";}
else
{
echo "<br>SCREEN LABEL ADDED\n";
$stmt="INSERT INTO vicidial_screen_labels SET label_id='$label_id',label_name='$label_name',active='N';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABELS', event_type='ADD', record_id='$label_id', event_code='ADMIN ADD LABEL', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=381111111111;
}
######################
# ADD=2111111111111 adds new conference to the system
######################
if ($ADD==2111111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>CONFERENCE NOT ADDED - there is already a conference in the system with this ID and server\n";}
else
{
if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) )
{echo "<br>CONFERENCE NOT ADDED - Please go back and look at the data you entered\n";}
else
{
echo "<br>CONFERENCE ADDED\n";
$stmt="INSERT INTO conferences (conf_exten,server_ip) values('$conf_exten','$server_ip');";
$rslt=mysql_query($stmt, $link);
}
}
$ADD=3111111111111;
}
######################
# ADD=21111111111111 adds new vicidial conference to the system
######################
if ($ADD==21111111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>VICIDIAL CONFERENCE NOT ADDED - there is already a vicidial conference in the system with this ID and server\n";}
else
{
if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) )
{echo "<br>VICIDIAL CONFERENCE NOT ADDED - Please go back and look at the data you entered\n";}
else
{
echo "<br>VICIDIAL CONFERENCE ADDED\n";
$stmt="INSERT INTO vicidial_conferences (conf_exten,server_ip) values('$conf_exten','$server_ip');";
$rslt=mysql_query($stmt, $link);
}
}
$ADD=31111111111111;
}
######################
# ADD=221111111111111 adds the new system status to the system
######################
if ($ADD==221111111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>SYSTEM STATUS NOT ADDED - there is already a campaign-status in the system with this name: $row[0]\n";}
else
{
$stmt="SELECT count(*) from vicidial_statuses where status='$status_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>SYSTEM STATUS NOT ADDED - there is already a global-status in the system with this name\n";}
else
{
if ( (strlen($status_id) < 1) or (strlen($status_name) < 2) )
{
echo "<br>SYSTEM STATUS NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>status must be between 1 and 8 characters in length\n";
echo "<br>status name must be between 2 and 30 characters in length\n";
}
else
{
echo "<br><B>SYSTEM STATUS ADDED: $status_name - $status_id</B>\n";
$stmt="INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback) values('$status_id','$status_name','$selectable','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable','$scheduled_callbacks');";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SYSTEMSTATUSES', event_type='ADD', record_id='$status_id', event_code='ADMIN ADD SYSTEM STATUS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
$ADD=321111111111111;
}
######################
# ADD=231111111111111 adds the new status category to the system
######################
if ($ADD==231111111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_status_categories where vsc_id='$vsc_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>STATUS CATEGORY NOT ADDED - there is already a status category in the system with this ID: $row[0]\n";}
else
{
if ( (strlen($vsc_id) < 2) or (strlen($vsc_id) > 20) or (strlen($vsc_name) < 2) )
{
echo "<br>STATUS CATEGORY NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>ID must be between 2 and 20 characters in length\n";
echo "<br>name name must be between 2 and 50 characters in length\n";
}
else
{
echo "<br><B>STATUS CATEGORY ADDED: $vsc_id - $vsc_name</B>\n";
$stmt="SELECT count(*) from vicidial_status_categories where tovdad_display='Y' and vsc_id NOT IN('$vsc_id');";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ( ($row[0] > 3) and (ereg('Y',$tovdad_display)) )
{
$tovdad_display = 'N';
echo "<br><B>ERROR: There are already 4 Status Categories set to TimeOnVDAD Display</B>\n";
}
$stmt="INSERT INTO vicidial_status_categories (vsc_id,vsc_name,vsc_description,tovdad_display,sale_category,dead_lead_category) values('$vsc_id','$vsc_name','$vsc_description','$tovdad_display','$sale_category','$dead_lead_category');";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='STATUSCATEGORIES', event_type='ADD', record_id='$vsc_id', event_code='ADMIN ADD STATUS CATEGORY', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=331111111111111;
}
######################
# ADD=241111111111111 adds the new qc status code to the system
######################
if ($ADD==241111111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_qc_codes where code='$code';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>QC STATUS CODE NOT ADDED - there is already a qc status code in the system with this name: $row[0]\n";}
else
{
if ( (strlen($code) < 1) or (strlen($code_name) < 2) )
{
echo "<br>QC STATUS CODE NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>code must be between 1 and 8 characters in length\n";
echo "<br>code name must be between 2 and 30 characters in length\n";
}
else
{
echo "<br><B>QC STATUS CODE ADDED: $code_name - $code</B>\n";
$stmt="INSERT INTO vicidial_qc_codes (code,code_name) values('$code','$code_name');";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='QCSTATUSES', event_type='ADD', record_id='$code', event_code='ADMIN ADD QC STATUS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$ADD=341111111111111;
}
######################################################################################################
######################################################################################################
####### 4 series, record modifications submitted and DB is modified, then on to 3 series forms below
######################################################################################################
######################################################################################################
######################
# ADD=4A submit user modifications to the system - ADMIN
######################
if ($ADD=="4A")
{
if ($LOGmodify_users==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) )
{
echo "<br>USER NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>Password and Full Name each need ot be at least 2 characters in length\n";
}
else
{
if ($SSoutbound_autodial_active < 1)
{
$closer_default_blended = '0';
$delete_filters = '0';
$load_leads = '0';
}
echo "<br><B>USER MODIFIED - ADMIN: $user</B>\n";
$stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times',modify_users='$modify_users',modify_campaigns='$modify_campaigns',modify_lists='$modify_lists',modify_scripts='$modify_scripts',modify_filters='$modify_filters',modify_ingroups='$modify_ingroups',modify_usergroups='$modify_usergroups',modify_remoteagents='$modify_remoteagents',modify_servers='$modify_servers',view_reports='$view_reports',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',add_timeclock_log='$add_timeclock_log',modify_timeclock_log='$modify_timeclock_log',delete_timeclock_log='$delete_timeclock_log',alter_custphone_override='$alter_custphone_override',vdc_agent_api_access='$vdc_agent_api_access',modify_inbound_dids='$modify_inbound_dids',delete_inbound_dids='$delete_inbound_dids',active='$active',download_lists='$download_lists',agent_shift_enforcement_override='$agent_shift_enforcement_override',manager_shift_enforcement_override='$manager_shift_enforcement_override',export_reports='$export_reports',delete_from_dnc='$delete_from_dnc',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five',voicemail_id='$voicemail_id',agent_call_log_view_override='$agent_call_log_view_override',callcard_admin='$callcard_admin',agent_choose_blended='$agent_choose_blended',realtime_block_user_info='$realtime_block_user_info',custom_fields_modify='$custom_fields_modify',force_change_password='$force_change_password',agent_lead_search_override='$agent_lead_search' where user='$user';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmt_grp_values|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
###############################################################
##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP #####
$stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$ss_conf_ct = mysql_num_rows($rslt);
if ($ss_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$enable_vtiger_integration = $row[0];
$vtiger_server_ip = $row[1];
$vtiger_dbname = $row[2];
$vtiger_login = $row[3];
$vtiger_pass = $row[4];
$vtiger_url = $row[5];
}
##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP #####
#############################################################
if ($enable_vtiger_integration > 0)
{
### connect to your vtiger database
$linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass");
if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());}
echo 'Connected successfully';
mysql_select_db("$vtiger_dbname", $linkV);
$user_name = $user;
$user_password = $pass;
$last_name = $full_name;
$is_admin = 'off';
$roleid = 'H5';
$status = 'Active';
$groupid = '1';
if ($user_level >= 7) {$roleid = 'H3';}
if ($user_level >= 8) {$roleid = 'H4';}
if ($user_level >= 9) {$roleid = 'H2';}
if ($user_level >= 9) {$is_admin = 'on';}
$salt = substr($user_name, 0, 2);
$salt = '$1$' . $salt . '$';
$encrypted_password = crypt($user_password, $salt);
### search for role in ViciDial
$stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$vvr_ct = mysql_num_rows($rslt);
if ($vvr_ct > 0)
{
$row=mysql_fetch_row($rslt);
$roleid = $row[0];
}
######################################
##### BEGIN Add/Update group info in Vtiger
$stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$group_found_count = $row[0];
### group exists in vtiger, update it
if ($group_found_count > 0)
{
$stmt="SELECT groupid from vtiger_groups where groupname='$user_group';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$groupid = $row[0];
}
### user doesn't exist in vtiger, insert it
else
{
#### BEGIN CREATE NEW GROUP RECORD IN VTIGER
# Get next available id from vtiger_users_seq to use as groupid
$stmt="SELECT id from vtiger_users_seq;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
$row=mysql_fetch_row($rslt);
$groupid = ($row[0] + 1);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
# Increase next available groupid with 1 so next record gets proper id
$stmt="UPDATE vtiger_users_seq SET id = '$groupid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
#### END CREATE NEW GROUP RECORD IN VTIGER
}
##### END Add/Update group info in Vtiger
######################################
######################################
##### BEGIN Add/Update user info in Vtiger
$stmt="SELECT count(*) from vtiger_users where user_name='$user_name';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$found_count = $row[0];
### user exists in vtiger, update it
if ($found_count > 0)
{
$stmt="SELECT id from vtiger_users where user_name='$user_name';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$userid = $row[0];
$stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$usergroupcount = $row[0];
$stmtA = "UPDATE vtiger_users SET user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status' where id='$userid';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';";
if ($DB) {echo "|$stmtB|\n";}
$rslt=mysql_query($stmtB, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
if ($usergroupcount < 1)
{
$stmt="SELECT user_group FROM vicidial_user_groups;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$VD_groups_ct = mysql_num_rows($rslt);
$k=0;
$VD_groups_list='';
while ($k < $VD_groups_ct)
{
$row=mysql_fetch_row($rslt);
$VD_groups_list .= "'$row[0]',";
$k++;
}
$VD_groups_list = preg_replace("/.$/",'',$VD_groups_list);
$stmtC = "DELETE FROM vtiger_users2group WHERE userid='$userid' and groupid IN(SELECT groupid from vtiger_groups where groupname IN($VD_groups_list));";
if ($DB) {echo "|$stmtC|\n";}
$rslt=mysql_query($stmtC, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';";
if ($DB) {echo "|$stmtD|\n";}
$rslt=mysql_query($stmtD, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
}
}
### user doesn't exist in vtiger, insert it
else
{
#### BEGIN CREATE NEW USER RECORD IN VTIGER
$stmtA = "INSERT INTO vtiger_users SET user_name='$user_name',user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status',date_format='yyyy-mm-dd',first_name='',reports_to_id='',description='',title='',department='',phone_home='',phone_mobile='',phone_work='',phone_other='',phone_fax='',email1='',email2='',yahoo_id='',signature='',address_street='',address_city='',address_state='',address_country='',address_postalcode='',user_preferences='',imagename='';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$userid = mysql_insert_id($linkV);
$stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';";
if ($DB) {echo "|$stmtB|\n";}
$rslt=mysql_query($stmtB, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';";
if ($DB) {echo "|$stmtC|\n";}
$rslt=mysql_query($stmtC, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtD = "UPDATE vtiger_users_seq SET id='$userid';";
if ($DB) {echo "|$stmtD|\n";}
$rslt=mysql_query($stmtD, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
#### END CREATE NEW USER RECORD IN VTIGER
}
##### END Add/Update user info in Vtiger
######################################
}
### END vtiger integration
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=3; # go to user modification below
}
######################
# ADD=4B submit user modifications to the system - ADMIN
######################
if ($ADD=="4B")
{
if ($LOGmodify_users==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) )
{
echo "<br>USER NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>Password and Full Name each need ot be at least 2 characters in length\n";
}
else
{
if ($SSoutbound_autodial_active < 1)
{
$closer_default_blended = '0';
$delete_filters = '0';
$load_leads = '0';
}
echo "<br><B>USER MODIFIED - ADMIN: $user</B>\n";
$stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',alter_custphone_override='$alter_custphone_override',active='$active',agent_shift_enforcement_override='$agent_shift_enforcement_override',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five',voicemail_id='$voicemail_id',agent_call_log_view_override='$agent_call_log_view_override',agent_choose_blended='$agent_choose_blended',agent_lead_search_override='$agent_lead_search' where user='$user';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
###############################################################
##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP #####
$stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$ss_conf_ct = mysql_num_rows($rslt);
if ($ss_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$enable_vtiger_integration = $row[0];
$vtiger_server_ip = $row[1];
$vtiger_dbname = $row[2];
$vtiger_login = $row[3];
$vtiger_pass = $row[4];
$vtiger_url = $row[5];
}
##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP #####
#############################################################
if ($enable_vtiger_integration > 0)
{
### connect to your vtiger database
$linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass");
if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());}
echo 'Connected successfully';
mysql_select_db("$vtiger_dbname", $linkV);
$user_name = $user;
$user_password = $pass;
$last_name = $full_name;
$is_admin = 'off';
$roleid = 'H5';
$status = 'Active';
$groupid = '1';
if ($user_level >= 7) {$roleid = 'H3';}
if ($user_level >= 8) {$roleid = 'H4';}
if ($user_level >= 9) {$roleid = 'H2';}
if ($user_level >= 9) {$is_admin = 'on';}
$salt = substr($user_name, 0, 2);
$salt = '$1$' . $salt . '$';
$encrypted_password = crypt($user_password, $salt);
### search for role in ViciDial
$stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$vvr_ct = mysql_num_rows($rslt);
if ($vvr_ct > 0)
{
$row=mysql_fetch_row($rslt);
$roleid = $row[0];
}
######################################
##### BEGIN Add/Update group info in Vtiger
$stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$group_found_count = $row[0];
### group exists in vtiger, update it
if ($group_found_count > 0)
{
$stmt="SELECT groupid from vtiger_groups where groupname='$user_group';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$groupid = $row[0];
}
### user doesn't exist in vtiger, insert it
else
{
#### BEGIN CREATE NEW GROUP RECORD IN VTIGER
# Get next available id from vtiger_users_seq to use as groupid
$stmt="SELECT id from vtiger_users_seq;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
$row=mysql_fetch_row($rslt);
$groupid = ($row[0] + 1);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
# Increase next available groupid with 1 so next record gets proper id
$stmt="UPDATE vtiger_users_seq SET id = '$groupid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
#### END CREATE NEW GROUP RECORD IN VTIGER
}
##### END Add/Update group info in Vtiger
######################################
######################################
##### BEGIN Add/Update user info in Vtiger
$stmt="SELECT count(*) from vtiger_users where user_name='$user_name';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$found_count = $row[0];
### user exists in vtiger, update it
if ($found_count > 0)
{
$stmt="SELECT id from vtiger_users where user_name='$user_name';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$userid = $row[0];
$stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$usergroupcount = $row[0];
$stmtA = "UPDATE vtiger_users SET user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status' where id='$userid';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';";
if ($DB) {echo "|$stmtB|\n";}
$rslt=mysql_query($stmtB, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
if ($usergroupcount < 1)
{
$stmt="SELECT user_group FROM vicidial_user_groups;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$VD_groups_ct = mysql_num_rows($rslt);
$k=0;
$VD_groups_list='';
while ($k < $VD_groups_ct)
{
$row=mysql_fetch_row($rslt);
$VD_groups_list .= "'$row[0]',";
$k++;
}
$VD_groups_list = preg_replace("/.$/",'',$VD_groups_list);
$stmtC = "DELETE FROM vtiger_users2group WHERE userid='$userid' and groupid IN(SELECT groupid from vtiger_groups where groupname IN($VD_groups_list));";
if ($DB) {echo "|$stmtC|\n";}
$rslt=mysql_query($stmtC, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';";
if ($DB) {echo "|$stmtD|\n";}
$rslt=mysql_query($stmtD, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
}
}
### user doesn't exist in vtiger, insert it
else
{
#### BEGIN CREATE NEW USER RECORD IN VTIGER
$stmtA = "INSERT INTO vtiger_users SET user_name='$user_name',user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status',date_format='yyyy-mm-dd',first_name='',reports_to_id='',description='',title='',department='',phone_home='',phone_mobile='',phone_work='',phone_other='',phone_fax='',email1='',email2='',yahoo_id='',signature='',address_street='',address_city='',address_state='',address_country='',address_postalcode='',user_preferences='',imagename='';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$userid = mysql_insert_id($linkV);
$stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';";
if ($DB) {echo "|$stmtB|\n";}
$rslt=mysql_query($stmtB, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';";
if ($DB) {echo "|$stmtC|\n";}
$rslt=mysql_query($stmtC, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtD = "UPDATE vtiger_users_seq SET id='$userid';";
if ($DB) {echo "|$stmtD|\n";}
$rslt=mysql_query($stmtD, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
#### END CREATE NEW USER RECORD IN VTIGER
}
##### END Add/Update user info in Vtiger
######################################
}
### END vtiger integration
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=3; # go to user modification below
}
######################
# ADD=4 submit user modifications to the system
######################
if ($ADD==4)
{
if ($LOGmodify_users==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) )
{
echo "<br>USER NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>Password and Full Name each need ot be at least 2 characters in length\n";
}
else
{
echo "<br><B>USER MODIFIED: $user</B>\n";
$stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',active='$active',email='$email',user_code='$user_code',territory='$territory' where user='$user';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
###############################################################
##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP #####
$stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$ss_conf_ct = mysql_num_rows($rslt);
if ($ss_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$enable_vtiger_integration = $row[0];
$vtiger_server_ip = $row[1];
$vtiger_dbname = $row[2];
$vtiger_login = $row[3];
$vtiger_pass = $row[4];
$vtiger_url = $row[5];
}
##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP #####
#############################################################
if ($enable_vtiger_integration > 0)
{
### connect to your vtiger database
$linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass");
if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());}
echo 'Connected successfully';
mysql_select_db("$vtiger_dbname", $linkV);
$user_name = $user;
$user_password = $pass;
$last_name = $full_name;
$is_admin = 'off';
$roleid = 'H5';
$status = 'Active';
$groupid = '1';
if ($user_level >= 7) {$roleid = 'H3';}
if ($user_level >= 8) {$roleid = 'H4';}
if ($user_level >= 9) {$roleid = 'H2';}
if ($user_level >= 9) {$is_admin = 'on';}
$salt = substr($user_name, 0, 2);
$salt = '$1$' . $salt . '$';
$encrypted_password = crypt($user_password, $salt);
### search for role in ViciDial
$stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$vvr_ct = mysql_num_rows($rslt);
if ($vvr_ct > 0)
{
$row=mysql_fetch_row($rslt);
$roleid = $row[0];
}
######################################
##### BEGIN Add/Update group info in Vtiger
$stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$group_found_count = $row[0];
### group exists in vtiger, update it
if ($group_found_count > 0)
{
$stmt="SELECT groupid from vtiger_groups where groupname='$user_group';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$groupid = $row[0];
}
### user doesn't exist in vtiger, insert it
else
{
#### BEGIN CREATE NEW GROUP RECORD IN VTIGER
# Get next available id from vtiger_users_seq to use as groupid
$stmt="SELECT id from vtiger_users_seq;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
$row=mysql_fetch_row($rslt);
$groupid = ($row[0] + 1);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
# Increase next available groupid with 1 so next record gets proper id
$stmt="UPDATE vtiger_users_seq SET id = '$groupid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
#### END CREATE NEW GROUP RECORD IN VTIGER
}
##### END Add/Update group info in Vtiger
######################################
######################################
##### BEGIN Add/Update user info in Vtiger
$stmt="SELECT count(*) from vtiger_users where user_name='$user_name';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$found_count = $row[0];
### user exists in vtiger, update it
if ($found_count > 0)
{
$stmt="SELECT id from vtiger_users where user_name='$user_name';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$userid = $row[0];
$stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$usergroupcount = $row[0];
$stmtA = "UPDATE vtiger_users SET user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status' where id='$userid';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';";
if ($DB) {echo "|$stmtB|\n";}
$rslt=mysql_query($stmtB, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
if ($usergroupcount < 1)
{
$stmt="SELECT user_group FROM vicidial_user_groups;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$VD_groups_ct = mysql_num_rows($rslt);
$k=0;
$VD_groups_list='';
while ($k < $VD_groups_ct)
{
$row=mysql_fetch_row($rslt);
$VD_groups_list .= "'$row[0]',";
$k++;
}
$VD_groups_list = preg_replace("/.$/",'',$VD_groups_list);
$stmtC = "DELETE FROM vtiger_users2group WHERE userid='$userid' and groupid IN(SELECT groupid from vtiger_groups where groupname IN($VD_groups_list));";
if ($DB) {echo "|$stmtC|\n";}
$rslt=mysql_query($stmtC, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';";
if ($DB) {echo "|$stmtD|\n";}
$rslt=mysql_query($stmtD, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
}
}
### user doesn't exist in vtiger, insert it
else
{
#### BEGIN CREATE NEW USER RECORD IN VTIGER
$stmtA = "INSERT INTO vtiger_users SET user_name='$user_name',user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status',date_format='yyyy-mm-dd',first_name='',reports_to_id='',description='',title='',department='',phone_home='',phone_mobile='',phone_work='',phone_other='',phone_fax='',email1='',email2='',yahoo_id='',signature='',address_street='',address_city='',address_state='',address_country='',address_postalcode='',user_preferences='',imagename='';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$userid = mysql_insert_id($linkV);
$stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';";
if ($DB) {echo "|$stmtB|\n";}
$rslt=mysql_query($stmtB, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';";
if ($DB) {echo "|$stmtC|\n";}
$rslt=mysql_query($stmtC, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtD = "UPDATE vtiger_users_seq SET id='$userid';";
if ($DB) {echo "|$stmtD|\n";}
$rslt=mysql_query($stmtD, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
#### END CREATE NEW USER RECORD IN VTIGER
}
##### END Add/Update user info in Vtiger
######################################
}
### END vtiger integration
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=3; # go to user modification below
}
######################
# ADD=41 submit campaign modifications to the system - DETAIL
######################
if ($ADD==41)
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ($SSoutbound_autodial_active < 1)
{
$adaptive_dl_diff_target = '0';
$dl_diff_target_method = 'ADAPT_CALC_ONLY';
$adaptive_dropped_percentage = '99';
$adaptive_intensity = '0';
$adaptive_latest_server_time = '2359';
$adaptive_maximum_level = '1.0';
$agent_extended_alt_dial = 'N';
$alt_number_dialing = 'N';
$am_message_exten = '8320';
$amd_send_to_vmx = 'N';
$auto_alt_dial = 'N';
$auto_dial_level = '1.0';
$available_only_ratio_tally = 'Y';
$campaign_allow_inbound = 'Y';
$campaign_vdad_exten = '8368';
$concurrent_transfers = 'AUTO';
$dial_method = 'RATIO';
$dial_status = '';
$dial_timeout = '60';
$drop_action = 'HANGUP';
$drop_call_seconds = '5';
$drop_inbound_group = '---NONE---';
$force_reset_hopper = 'N';
$hopper_level = '5';
$lead_filter_id = 'NONE';
$lead_order = 'DOWN';
$list_order_mix = 'DISABLED';
$no_hopper_leads_logins = 'Y';
$queue_priority = '50';
$safe_harbor_exten = '8300';
$safe_harbor_audio = 'buzz';
$safe_harbor_menu_id = '';
$survey_camp_record_dir = '/home/survey';
$survey_dtmf_digits = '1238';
$survey_first_audio_file = 'US_pol_survey_hello';
$survey_method = 'AGENT_XFER';
$survey_ni_audio_file = '';
$survey_ni_digit = '8';
$survey_ni_status = 'NI';
$survey_no_response_action = 'OPTIN';
$survey_opt_in_audio_file = 'US_pol_survey_transfer';
$survey_response_digit_map = '1-DEMOCRAT|2-REPUBLICAN|3-INDEPENDANT|8-OPTOUT|X-NO RESPONSE|';
$survey_xfer_exten = '8300';
$voicemail_ext = '';
$cpd_amd_action = 'DISABLED';
$drop_lockout_time = '0';
$lead_order_randomize = 'N';
$lead_order_secondary = 'LEAD_ASCEND';
}
if ( (ereg('list_activation',$stage)) or (ereg('test_call',$stage)) )
{
if (ereg('test_call',$stage))
{
$p=0;
echo "<BR>TEST CALL:";
if (strlen($phone_number)<6)
{
echo " NOT PLACED, number too small - $phone_number";
}
else
{
### insert a new lead in the system with this phone number
$stmtA = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$manual_dial_list_id',status='CTCALL',user='VDAD',called_since_last_reset='Y',entry_date='$SQLdate',last_local_call_time='$SQLdate',called_count='1',first_name='Test',last_name='Call',address1='Test Call',city='Springfield',state='IL',vendor_lead_code='999999',comments='$campaign_id test call placed $SQLdate',rank='99',owner='Test Outbound Call';";
if ($DB) {echo "$stmtA\n";}
$rslt=mysql_query($stmtA, $link);
$affected_rows = mysql_affected_rows($link);
$lead_id = mysql_insert_id($link);
### LOG INSERTION Admin Log Table, for lead ###
$SQL_log = "$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='ADD', record_id='$lead_id', event_code='ADMIN ADD TEST LEAD', event_sql=\"$SQL_log\", event_notes='';";
$rslt=mysql_query($stmt, $link);
### gather list_id overrides
$stmt="SELECT campaign_cid_override FROM vicidial_lists where list_id='$manual_dial_list_id';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$CIDor_ct = mysql_num_rows($rslt);
$campaign_cid_override='';
if ($CIDor_ct > 0)
{
$row=mysql_fetch_row($rslt);
$campaign_cid_override = $row[0];
}
$CCID_on=0; $CCID='';
$local_DEF = 'Local/';
$local_AMP = '@';
$Local_out_prefix = '9';
$Local_dial_timeout = '60';
if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;}
$Local_dial_timeout = ($Local_dial_timeout * 1000);
if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";}
if (strlen($campaign_vdad_exten) > 0) {$VDAD_dial_exten = "$campaign_vdad_exten";}
else {$VDAD_dial_exten = "$SSanswer_transfer_agent";}
if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;}
if (strlen($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;}
if (preg_match("/x/",$dial_prefix)) {$Local_out_prefix = '';}
if (strlen($ext_context) < 1) {$ext_context='default';}
if ($omit_phone_code > 0) {$Ndialstring = "$Local_out_prefix$phone_number";}
else {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";}
# generate callerID for unique identifier in xfer_log file
$PADlead_id = sprintf("%010s", $lead_id); while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);}
# Create unique calleridname to track the call: VmddhhmmssLLLLLLLLLL
$VqueryCID = "V$CIDdate$PADlead_id";
if ($CCID_on) {$CIDstring = "\"$VqueryCID\" <$CCID>";}
else {$CIDstring = "$VqueryCID";}
### insert a NEW record to the vicidial_manager table to be processed
$stmtB = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$SSactive_voicemail_server','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Ndialstring$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','VDACnote: $campaign_id|$lead_id|$phone_code|$phone_number|OUT|MAIN|99')";
$rslt=mysql_query($stmtB, $link);
### insert a SENT record to the vicidial_auto_calls table
$stmtC = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type,alt_dial,queue_priority) values('$SSactive_voicemail_server','$campaign_id','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUT','MAIN','99')";
$rslt=mysql_query($stmtC, $link);
### LOG INSERTION Admin Log Table, for campaign ###
$SQL_log = "$stmtA|$stmtB|$stmtC|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='OTHER', record_id='$campaign_id', event_code='ADMIN CAMPAIGN TEST CALL', event_sql=\"$SQL_log\", event_notes='';";
$rslt=mysql_query($stmt, $link);
if ($DB > 0) {echo "|$stmtA|\n|$stmtB|\n|$stmtC|\n";}
echo " PLACED TO $phone_code $phone_number\n<BR>";
}
}
if (ereg('list_activation',$stage))
{
$p=0;
echo "<BR>ACTIVE LISTS CHANGED";
$list_active_change_ct = count($list_active_change);
while ($p < $list_active_change_ct)
{
$LIST_ACTIVATE .= "'$list_active_change[$p]',";
$p++;
}
$stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';";
$stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$rslt=mysql_query($stmtB, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtB|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";}
}
}
else
{
if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) )
{
echo "<br>CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>the campaign name needs to be at least 6 characters in length\n";
echo "<br>|$campaign_name|$active|\n";
}
else
{
echo "<br><B>CAMPAIGN MODIFIED: $campaign_id</B>\n";
if ( ($dial_method != 'MANUAL') and ($dial_method != 'INBOUND_MAN') )
{
$no_hopper_dialing='N';
$agent_dial_owner_only='NONE';
}
if ($no_hopper_dialing == 'Y')
{
$use_auto_hopper='N';
$auto_alt_dial='NONE';
$list_order_mix='DISABLED';
}
if ($dial_method == 'MANUAL')
{
$auto_dial_level='0';
$use_auto_hopper='N';
$adlSQL = "auto_dial_level='0',";
$campaign_allow_inbound='N';
}
else
{
if ($dial_level_override > 0)
{
$adlSQL = "auto_dial_level='$auto_dial_level',";
}
else
{
if ($dial_method == 'RATIO')
{
if ($auto_dial_level < 1) {$auto_dial_level = "1.0";}
$adlSQL = "auto_dial_level='$auto_dial_level',";
}
else
{
$adlSQL = "";
if ($auto_dial_level < 1)
{
$auto_dial_level = "1.0";
$adlSQL = "auto_dial_level='$auto_dial_level',";
}
}
}
}
if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) )
{$hopper_level='100';}
$closer_campaignsSQL = "'$groups_value'";
if ( ($campaign_allow_inbound == 'N') or ($old_campaign_allow_inbound == 'N') )
{
$closer_campaignsSQL = 'closer_campaigns';
$groups_list='';
$stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$Mcloser_campaigns = $row[0];
$Mcloser_campaigns = preg_replace("/ -$/","",$Mcloser_campaigns);
$groups = explode(" ", $Mcloser_campaigns);
$o=0;
while ($groups_to_print > $o)
{
$groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_values[$o]\"";
$p=0;
$group_ct = count($groups);
while ($p < $group_ct)
{
if ($group_id_values[$o] == $groups[$p])
{
$groups_list .= " CHECKED";
$groups_value .= " $group_id_values[$o]";
}
$p++;
}
$stmt="SELECT queue_priority from vicidial_inbound_groups where group_id='$group_id_values[$o]';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$VIG_priority = $row[0];
$groups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] - $VIG_priority <BR>\n";
$o++;
}
if (strlen($groups_value)>2) {$groups_value .= " -";}
}
$stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns=$closer_campaignsSQL,use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method',queuemetrics_phone_environment='$queuemetrics_phone_environment',auto_pause_precall='$auto_pause_precall',auto_resume_precall='$auto_resume_precall',auto_pause_precall_code='$auto_pause_precall_code',manual_dial_cid='$manual_dial_cid',post_phone_time_diff_alert='$post_phone_time_diff_alert',custom_3way_button_transfer='$custom_3way_button_transfer',available_only_tally_threshold='$available_only_tally_threshold',available_only_tally_threshold_agents='$available_only_tally_threshold_agents',dial_level_threshold='$dial_level_threshold',dial_level_threshold_agents='$dial_level_threshold_agents',safe_harbor_audio='$safe_harbor_audio',safe_harbor_menu_id='$safe_harbor_menu_id',callback_days_limit='$callback_days_limit',dl_diff_target_method='$dl_diff_target_method',disable_dispo_screen='$disable_dispo_screen',disable_dispo_status='$disable_dispo_status',screen_labels='$screen_labels',status_display_fields='$status_display_fields' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmtA, $link);
if ($reset_hopper == 'Y')
{
echo "<br>RESETTING CAMPAIGN LEAD HOPPER\n";
echo "<br> - Wait 1 minute before dialing next number\n";
$stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN DETAIL', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=31; # go to campaign modification form below
}
######################
# ADD=42 modify/delete campaign status in the system
######################
if ($ADD==42)
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) )
{
echo "<br>CAMPAIGN STATUS NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>the campaign id needs to be at least 2 characters in length\n";
echo "<br>the campaign status needs to be at least 1 characters in length\n";
}
else
{
if (ereg('delete',$stage))
{
echo "<br><B>CUSTOM CAMPAIGN STATUS DELETED: $campaign_id - $status</B>\n";
$stmt="DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';";
$rslt=mysql_query($stmt, $link);
$stmtA="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_STATUS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN STATUS', event_sql=\"$SQL_log\", event_notes='Status: $status';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
if (ereg('modify',$stage))
{
echo "<br><B>CUSTOM CAMPAIGN STATUS MODIFIED: $campaign_id - $status</B>\n";
$stmt="UPDATE vicidial_campaign_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category',sale='$sale',dnc='$dnc',customer_contact='$customer_contact',not_interested='$not_interested',unworkable='$unworkable',scheduled_callback='$scheduled_callbacks' where campaign_id='$campaign_id' and status='$status';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_STATUS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN STATUS', event_sql=\"$SQL_log\", event_notes='Status: $status';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$SUB=22;
$ADD=31; # go to campaign modification form below
}
######################
# ADD=43 delete campaign hotkey in the system
######################
if ($ADD==43)
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) )
{
echo "<br>CAMPAIGN HOT KEY NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>the campaign id needs to be at least 2 characters in length\n";
echo "<br>the campaign status needs to be at least 1 characters in length\n";
echo "<br>the campaign hotkey needs to be at least 1 characters in length\n";
}
else
{
echo "<br><B>CUSTOM CAMPAIGN HOT KEY DELETED: $campaign_id - $status - $hotkey</B>\n";
$stmt="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_HOTKEY', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN HOTKEY', event_sql=\"$SQL_log\", event_notes='Status: $status|HotKey: $hotkey';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$SUB=23;
$ADD=31; # go to campaign modification form below
}
######################
# ADD=44 submit campaign modifications to the system - Basic View
######################
if ($ADD==44)
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ($SSoutbound_autodial_active < 1)
{
$adaptive_dl_diff_target = '0';
$adaptive_dropped_percentage = '99';
$adaptive_intensity = '0';
$adaptive_latest_server_time = '2359';
$adaptive_maximum_level = '1.0';
$agent_extended_alt_dial = 'N';
$alt_number_dialing = 'N';
$am_message_exten = '8320';
$amd_send_to_vmx = 'N';
$auto_alt_dial = 'N';
$auto_dial_level = '1.0';
$available_only_ratio_tally = 'Y';
$campaign_allow_inbound = 'Y';
$campaign_vdad_exten = '8368';
$concurrent_transfers = 'AUTO';
$dial_method = 'RATIO';
$dial_status = '';
$dial_timeout = '60';
$drop_action = 'HANGUP';
$drop_call_seconds = '5';
$drop_inbound_group = '---NONE---';
$force_reset_hopper = 'N';
$hopper_level = '5';
$lead_filter_id = 'NONE';
$lead_order = 'DOWN';
$list_order_mix = 'DISABLED';
$no_hopper_leads_logins = 'Y';
$queue_priority = '50';
$safe_harbor_exten = '8300';
$safe_harbor_audio = 'buzz';
$safe_harbor_menu_id = '';
$voicemail_ext = '';
}
if (ereg('list_activation',$stage))
{
$p=0;
echo "<BR>ACTIVE LISTS CHANGED";
$list_active_change_ct = count($list_active_change);
while ($p < $list_active_change_ct)
{
$LIST_ACTIVATE .= "'$list_active_change[$p]',";
$p++;
}
$stmt = "UPDATE vicidial_lists SET active='Y' where list_id IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';";
$stmtB = "UPDATE vicidial_lists SET active='N' where list_id NOT IN($LIST_ACTIVATE'') and campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$rslt=mysql_query($stmtB, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtB|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";}
}
else
{
if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) )
{
echo "<br>CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>the campaign name needs to be at least 6 characters in length\n";
}
else
{
echo "<br><B>CAMPAIGN MODIFIED: $campaign_id</B>\n";
if ($dial_method == 'RATIO')
{
if ($auto_dial_level < 1) {$auto_dial_level = "1.0";}
$adlSQL = "auto_dial_level='$auto_dial_level',";
}
else
{
if ($dial_method == 'MANUAL')
{
$auto_dial_level='0';
$adlSQL = "auto_dial_level='0',";
}
else
{
$adlSQL = "";
if ($auto_dial_level < 1)
{
$auto_dial_level = "1.0";
$adlSQL = "auto_dial_level='$auto_dial_level',";
}
}
}
if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) )
{$hopper_level='100';}
$stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', $adlSQL lead_filter_id='$lead_filter_id',dial_method='$dial_method',adaptive_intensity='$adaptive_intensity',campaign_changedate='$SQLdate',list_order_mix='$list_order_mix' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN BASIC', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($reset_hopper == 'Y')
{
echo "<br>RESETTING CAMPAIGN LEAD HOPPER\n";
echo "<br> - Wait 1 minute before dialing next number\n";
$stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=34; # go to campaign modification form below
}
######################
# ADD=45 modify campaign lead recycle in the system
######################
if ($ADD==45)
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_delay >= 43200) or ($attempt_maximum < 1) or ($attempt_maximum > 10) )
{
echo "<br>CAMPAIGN LEAD RECYCLE NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>status must be between 1 and 6 characters in length\n";
echo "<br>attempt delay must be at least 120 seconds and less than 43200 seconds or 12 hours\n";
echo "<br>maximum attempts must be from 1 to 10\n";
}
else
{
echo "<br><B>CAMPAIGN LEAD MODIFIED: $campaign_id - $status - $attempt_delay</B>\n";
$stmt="UPDATE vicidial_lead_recycle SET attempt_delay='$attempt_delay',attempt_maximum='$attempt_maximum',active='$active' where campaign_id='$campaign_id' and status='$status';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_RECYCLE', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$SUB=25;
$ADD=31; # go to campaign modification form below
}
######################
# ADD=47 modify agent pause code in the system
######################
if ($ADD==47)
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) or (strlen($pause_code) > 6) or (strlen($pause_code_name) < 2) )
{
echo "<br>AGENT PAUSE CODE NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>pause_code must be between 1 and 6 characters in length\n";
echo "<br>pause_code name must be between 2 and 30 characters in length\n";
}
else
{
echo "<br><B>AGENT PAUSE CODE MODIFIED: $campaign_id - $pause_code - $pause_code_name</B>\n";
$stmt="UPDATE vicidial_pause_codes SET pause_code_name='$pause_code_name',billable='$billable' where campaign_id='$campaign_id' and pause_code='$pause_code';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_PAUSECODE', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN PAUSE CODE', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$SUB=27;
$ADD=31; # go to campaign modification form below
}
######################
# ADD=48 modify campaign QC settings in the system
######################
if ($ADD==48)
{
if ( ($LOGmodify_campaigns==1) and ($SSqc_features_active) )
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (strlen($campaign_id) < 2)
{
echo "<br>QC SETTINGS NOT MODIFIED - Please go back and look at the data you entered\n";
}
else
{
$p=0;
$qc_statuses_ct = count($qc_statuses);
while ($p < $qc_statuses_ct)
{
$QC_statuses .= " $qc_statuses[$p]";
$p++;
}
$p=0;
$qc_lists_ct = count($qc_lists);
while ($p < $qc_lists_ct)
{
$QC_lists .= " $qc_lists[$p]";
$p++;
}
if (strlen($QC_statuses)>0) {$QC_statuses .= " -";}
if (strlen($QC_lists)>0) {$QC_lists .= " -";}
echo "<br><B>QC SETTINGS MODIFIED: $campaign_id</B>\n";
$stmt="UPDATE vicidial_campaigns SET qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_lists='$QC_lists',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_shift_id='$qc_shift_id' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_QC', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN QC SETTINGS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$SUB=28;
$ADD=31; # go to campaign modification form below
}
######################
# ADD=40A modify campaign survey settings in the system
######################
if ($ADD=='40A')
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (strlen($campaign_id) < 2)
{
echo "<br>SURVEY SETTINGS NOT MODIFIED - Please go back and look at the data you entered\n";
}
else
{
echo "<br><B>SURVEY SETTINGS MODIFIED: $campaign_id</B>\n";
$stmt="UPDATE vicidial_campaigns SET survey_first_audio_file='$survey_first_audio_file',survey_dtmf_digits='$survey_dtmf_digits',survey_ni_digit='$survey_ni_digit',survey_opt_in_audio_file='$survey_opt_in_audio_file',survey_ni_audio_file='$survey_ni_audio_file',survey_method='$survey_method',survey_no_response_action='$survey_no_response_action',survey_ni_status='$survey_ni_status',survey_response_digit_map='$survey_response_digit_map',survey_xfer_exten='$survey_xfer_exten',survey_camp_record_dir='$survey_camp_record_dir',voicemail_ext='$voicemail_ext',survey_third_digit='$survey_third_digit',survey_fourth_digit='$survey_fourth_digit',survey_third_audio_file='$survey_third_audio_file',survey_fourth_audio_file='$survey_fourth_audio_file',survey_third_status='$survey_third_status',survey_fourth_status='$survey_fourth_status',survey_third_exten='$survey_third_exten',survey_fourth_exten='$survey_fourth_exten',survey_menu_id='$survey_menu_id' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_SURVEY', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN SURVEY', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$SUB='20A';
$ADD=31; # go to campaign modification form below
}
######################
# ADD=49 modify campaign list mix in the system
######################
if ($ADD==49)
{
if ($LOGmodify_campaigns==1)
{
##### MODIFY a list mix container entry #####
if ($stage=='MODIFY')
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$Flist_mix_container = "list_mix_container_$vcl_id";
$Fmix_method = "mix_method_$vcl_id";
$Fstatus = "status_$vcl_id";
$Fvcl_name = "vcl_name_$vcl_id";
if (isset($_GET[$Flist_mix_container])) {$list_mix_container=$_GET[$Flist_mix_container];}
elseif (isset($_POST[$Flist_mix_container])) {$list_mix_container=$_POST[$Flist_mix_container];}
if (isset($_GET[$Fmix_method])) {$mix_method=$_GET[$Fmix_method];}
elseif (isset($_POST[$Fmix_method])) {$mix_method=$_POST[$Fmix_method];}
if (isset($_GET[$Fstatus])) {$status=$_GET[$Fstatus];}
elseif (isset($_POST[$Fstatus])) {$status=$_POST[$Fstatus];}
if (isset($_GET[$Fvcl_name])) {$vcl_name=$_GET[$Fvcl_name];}
elseif (isset($_POST[$Fvcl_name])) {$vcl_name=$_POST[$Fvcl_name];}
$list_mix_container = preg_replace("/:$/","",$list_mix_container);
if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($list_mix_container) < 6) or (strlen($vcl_name) < 2) )
{
echo "<br>LIST MIX NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>vcl_id must be between 1 and 20 characters in length\n";
echo "<br>vcl_name name must be between 2 and 30 characters in length\n";
}
else
{
$stmt="UPDATE vicidial_campaigns_list_mix SET vcl_name='$vcl_name',mix_method='$mix_method',list_mix_container='$list_mix_container' where campaign_id='$campaign_id' and vcl_id='$vcl_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='List Mix: $vcl_id';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>LIST MIX MODIFIED: $campaign_id - $vcl_id - $vcl_name</B>\n";
}
}
##### ADD a list mix container entry #####
if ($stage=='ADD')
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($list_id) < 1) )
{
echo "<br>LIST MIX NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>vcl_id must be between 1 and 20 characters in length\n";
echo "<br>list_id must be at least 2 characters in length\n";
}
else
{
$stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$OLDlist_mix_container = $row[0];
$NEWlist_mix_container = "$OLDlist_mix_container:$list_id|10|0| -|";
$stmt="UPDATE vicidial_campaigns_list_mix SET list_mix_container='$NEWlist_mix_container' where campaign_id='$campaign_id' and vcl_id='$vcl_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='List Mix: $vcl_id';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>LIST MIX MODIFIED: $campaign_id - $vcl_id - $list_id</B>\n";
}
}
##### REMOVE a list mix container entry #####
if ($stage=='REMOVE')
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($list_id) < 1) )
{
echo "<br>LIST MIX NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>vcl_id must be between 1 and 20 characters in length\n";
echo "<br>list_id must be at least 2 characters in length\n";
}
else
{
$stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$MIXentries = $MT;
$MIXentries = explode(":", $row[0]);
$Ms_to_print = (count($MIXentries) - 0);
if ($Ms_to_print < 2)
{
echo "<br><B>LIST MIX NOT MODIFIED: You cannot delete the last list_id entry from a list mix</B>\n";
}
else
{
$MIXdetailsPCT = explode('|', $MIXentries[$mix_container_item]);
$MIXpercentPCT = $MIXdetailsPCT[2];
$q=0;
while ($Ms_to_print > $q)
{
if ( ($mix_container_item > $q) or ($mix_container_item < $q) )
{
if ( ($q==0) and ($mix_container_item > 0) )
{
$MIXdetailsONE = explode('|', $MIXentries[$q]);
$MIXpercentONE = ($MIXdetailsONE[2] + $MIXpercentPCT);
$NEWlist_mix_container .= "$MIXdetailsONE[0]|$MIXdetailsONE[1]|$MIXpercentONE|$MIXdetailsONE[3]|:";
}
else
{
if ( ($q==1) and ($mix_container_item < 1) )
{
$MIXdetailsONE = explode('|', $MIXentries[$q]);
$MIXpercentONE = ($MIXdetailsONE[2] + $MIXpercentPCT);
$NEWlist_mix_container .= "$MIXdetailsONE[0]|$MIXdetailsONE[1]|$MIXpercentONE|$MIXdetailsONE[3]|:";
}
else
{
$NEWlist_mix_container .= "$MIXentries[$q]:";
}
}
}
$q++;
}
$NEWlist_mix_container = preg_replace("/.$/",'',$NEWlist_mix_container);
$stmt="UPDATE vicidial_campaigns_list_mix SET list_mix_container='$NEWlist_mix_container' where campaign_id='$campaign_id' and vcl_id='$vcl_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='List Mix: $vcl_id';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>LIST MIX MODIFIED: $campaign_id - $vcl_id - $list_id - $mix_container_item</B>\n";
}
}
}
##### ADD a NEW list mix #####
if ($stage=='NEWMIX')
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($vcl_name) < 2) )
{
echo "<br>LIST MIX NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>vcl_id must be between 1 and 20 characters in length\n";
echo "<br>vcl_name must be at least 2 characters in length\n";
}
else
{
$stmt="SELECT count(*) from vicidial_campaigns_list_mix where vcl_id='$vcl_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
echo "<br>LIST MIX NOT ADDED - There is already a list mix with this ID in the system\n";
}
else
{
$stmt="INSERT INTO vicidial_campaigns_list_mix SET list_mix_container='$list_id|1|100| $status -|',campaign_id='$campaign_id',vcl_id='$vcl_id',vcl_name='$vcl_name',mix_method='$mix_method',status='INACTIVE';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_LISTMIX', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADD CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='List Mix: $vcl_id';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>LIST MIX ADDED: $campaign_id - $vcl_id - $vcl_name</B>\n";
}
}
}
##### DELETE an existing list mix #####
if ($stage=='DELMIX')
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) )
{
echo "<br>LIST MIX NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>vcl_id must be between 1 and 20 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_campaigns_list_mix where vcl_id='$vcl_id' and campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_LISTMIX', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN LIST MIX', event_sql=\"$SQL_log\", event_notes='List Mix: $vcl_id';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>LIST MIX DELETED: $campaign_id - $vcl_id - $vcl_name</B>\n";
}
}
##### Set list mix entry to active #####
if ($stage=='SETACTIVE')
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) )
{
echo "<br>LIST MIX NOT ACTIVATED - Please go back and look at the data you entered\n";
echo "<br>vcl_id must be between 1 and 20 characters in length\n";
}
else
{
$stmt="UPDATE vicidial_campaigns_list_mix SET status='INACTIVE' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmt="UPDATE vicidial_campaigns_list_mix SET status='ACTIVE' where vcl_id='$vcl_id' and campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_LISTMIX', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN LIST MIX ACTIVE', event_sql=\"$SQL_log\", event_notes='List Mix: $vcl_id';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>LIST MIX ACTIVATED: $campaign_id - $vcl_id - $vcl_name</B>\n";
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$SUB=29;
$ADD=31; # go to campaign modification form below
}
######################
# ADD=401 modify campaign preset in the system
######################
if ($ADD==401)
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) )
{
echo "<br>PRESET NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>preset name must be between 1 and 40 characters in length\n";
echo "<br>preset number must be between 2 and 50 characters in length\n";
}
else
{
echo "<br><B>PRESET MODIFIED: $campaign_id - $preset_name - $preset_number</B>\n";
$stmt="UPDATE vicidial_xfer_presets SET preset_dtmf='$preset_dtmf',preset_number='$preset_number',preset_hide_number='$preset_hide_number' where campaign_id='$campaign_id' and preset_name='$preset_name';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_PRESET', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name - $preset_number';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$SUB=201;
$ADD=31; # go to campaign modification form below
}
######################
# ADD=411 submit list modifications to the system
######################
if ($ADD==411)
{
if ($LOGmodify_lists==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) )
{
echo "<br>LIST NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>list name must be at least 2 characters in length\n";
}
else
{
if (strlen($reset_time) < 4) {$reset_time='';}
echo "<br><B>LIST MODIFIED: $list_id</B>\n";
$stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description',list_changedate='$SQLdate',reset_time='$reset_time',agent_script_override='$agent_script_override',campaign_cid_override='$campaign_cid_override',am_message_exten_override='$am_message_exten_override',drop_inbound_group_override='$drop_inbound_group_override',xferconf_a_number='$xferconf_a_number',xferconf_b_number='$xferconf_b_number',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',web_form_address='" . mysql_real_escape_string($web_form_address) . "',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',time_zone_setting='$time_zone_setting' where list_id='$list_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY LIST', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($reset_list == 'Y')
{
echo "<br>RESETTING LIST-CALLED-STATUS\n";
$stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';";
$rslt=mysql_query($stmtB, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
if ($campaign_id != "$old_campaign_id")
{
echo "<br>REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($old_campaign_id)\n";
$stmtC="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';";
$rslt=mysql_query($stmtC, $link);
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=311; # go to list modification form below
}
######################
# ADD=4111 modify in-group info in the system
######################
if ($ADD==4111)
{
if ($LOGmodify_ingroups==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) )
{
echo "<br>GROUP NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>group name and group color must be at least 2 characters in length\n";
}
else
{
$p=0;
$qc_statuses_ct = count($qc_statuses);
while ($p < $qc_statuses_ct)
{
$QC_statuses .= " $qc_statuses[$p]";
$p++;
}
$p=0;
$qc_lists_ct = count($qc_lists);
while ($p < $qc_lists_ct)
{
$QC_lists .= " $qc_lists[$p]";
$p++;
}
if (strlen($QC_statuses)>0) {$QC_statuses .= " -";}
if (strlen($QC_lists)>0) {$QC_lists .= " -";}
if ($no_agent_action == "INGROUP")
{
if (isset($_GET["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_GET["IGgroup_id_no_agent_action"];}
elseif (isset($_POST["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_POST["IGgroup_id_no_agent_action"];}
if (isset($_GET["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_GET["IGhandle_method_no_agent_action"];}
elseif (isset($_POST["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_POST["IGhandle_method_no_agent_action"];}
if (isset($_GET["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_GET["IGsearch_method_no_agent_action"];}
elseif (isset($_POST["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_POST["IGsearch_method_no_agent_action"];}
if (isset($_GET["IGlist_id_no_agent_action"])) {$IGlist_id=$_GET["IGlist_id_no_agent_action"];}
elseif (isset($_POST["IGlist_id_no_agent_action"])) {$IGlist_id=$_POST["IGlist_id_no_agent_action"];}
if (isset($_GET["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_GET["IGcampaign_id_no_agent_action"];}
elseif (isset($_POST["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_POST["IGcampaign_id_no_agent_action"];}
if (isset($_GET["IGphone_code_no_agent_action"])) {$IGphone_code=$_GET["IGphone_code_no_agent_action"];}
elseif (isset($_POST["IGphone_code_no_agent_action"])) {$IGphone_code=$_POST["IGphone_code_no_agent_action"];}
if (strlen($IGhandle_method)<1)
{
if (isset($_GET["IGhandle_method_"])) {$IGhandle_method=$_GET["IGhandle_method_"];}
elseif (isset($_POST["IGhandle_method_"])) {$IGhandle_method=$_POST["IGhandle_method_"];}
}
if (strlen($IGsearch_method)<1)
{
if (isset($_GET["IGsearch_method_"])) {$IGsearch_method=$_GET["IGsearch_method_"];}
elseif (isset($_POST["IGsearch_method_"])) {$IGsearch_method=$_POST["IGsearch_method_"];}
}
if (strlen($IGlist_id)<1)
{
if (isset($_GET["IGlist_id_"])) {$IGlist_id=$_GET["IGlist_id_"];}
elseif (isset($_POST["IGlist_id_"])) {$IGlist_id=$_POST["IGlist_id_"];}
}
if (strlen($IGcampaign_id)<1)
{
if (isset($_GET["IGcampaign_id_"])) {$IGcampaign_id=$_GET["IGcampaign_id_"];}
elseif (isset($_POST["IGcampaign_id_"])) {$IGcampaign_id=$_POST["IGcampaign_id_"];}
}
if (strlen($IGphone_code)<1)
{
if (isset($_GET["IGphone_code_"])) {$IGphone_code=$_GET["IGphone_code_"];}
elseif (isset($_POST["IGphone_code_"])) {$IGphone_code=$_POST["IGphone_code_"];}
}
$no_agent_action_value = "$IGgroup_id,$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code";
if ($DB) {echo "\nNANQUE: |$no_agent_action_value|$no_agent_action|\n";}
}
if ($no_agent_action == "EXTENSION")
{
if (isset($_GET["EXextension_no_agent_action"])) {$EXextension=$_GET["EXextension_no_agent_action"];}
elseif (isset($_POST["EXextension_no_agent_action"])) {$EXextension=$_POST["EXextension_no_agent_action"];}
if (isset($_GET["EXcontext_no_agent_action"])) {$EXcontext=$_GET["EXcontext_no_agent_action"];}
elseif (isset($_POST["EXcontext_no_agent_action"])) {$EXcontext=$_POST["EXcontext_no_agent_action"];}
$no_agent_action_value = "$EXextension,$EXcontext";
}
$no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value);
echo "<br><B>GROUP MODIFIED: $group_id</B>\n";
$stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',ignore_list_script_override='$ignore_list_script_override',extension_appended_cidname='$extension_appended_cidname',uniqueid_status_display='$uniqueid_status_display',uniqueid_status_prefix='$uniqueid_status_prefix',hold_time_option_minimum='$hold_time_option_minimum',hold_time_option_press_filename='$hold_time_option_press_filename',hold_time_option_callmenu='$hold_time_option_callmenu',onhold_prompt_no_block='$onhold_prompt_no_block',onhold_prompt_seconds='$onhold_prompt_seconds',hold_time_option_no_block='$hold_time_option_no_block',hold_time_option_prompt_seconds='$hold_time_option_prompt_seconds',hold_time_second_option='$hold_time_second_option',hold_time_third_option='$hold_time_third_option',wait_hold_option_priority='$wait_hold_option_priority',wait_time_option='$wait_time_option',wait_time_second_option='$wait_time_second_option',wait_time_third_option='$wait_time_third_option',wait_time_option_seconds='$wait_time_option_seconds',wait_time_option_exten='$wait_time_option_exten',wait_time_option_voicemail='$wait_time_option_voicemail',wait_time_option_xfer_group='$wait_time_option_xfer_group',wait_time_option_callmenu='$wait_time_option_callmenu',wait_time_option_callback_filename='$wait_time_option_callback_filename',wait_time_option_callback_list_id='$wait_time_option_callback_list_id',wait_time_option_press_filename='$wait_time_option_press_filename',wait_time_option_no_block='$wait_time_option_no_block',wait_time_option_prompt_seconds='$wait_time_option_prompt_seconds',timer_action_destination='$timer_action_destination',calculate_estimated_hold_seconds='$calculate_estimated_hold_seconds',add_lead_url='" . mysql_real_escape_string($add_lead_url) . "',eht_minimum_prompt_filename='$eht_minimum_prompt_filename',eht_minimum_prompt_no_block='$eht_minimum_prompt_no_block',eht_minimum_prompt_seconds='$eht_minimum_prompt_seconds',on_hook_ring_time='$on_hook_ring_time' where group_id='$group_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='ADMIN MODIFY INGROUP', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=3111; # go to in-group modification form below
}
######################
# ADD=4311 modify did info in the system
######################
if ($ADD==4311)
{
if ($LOGmodify_dids==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($did_id) < 1) or (strlen($did_pattern) < 1) )
{
echo "<br>DID NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>did_extension must be at least 1 character in length\n";
}
else
{
echo "<br><B>DID MODIFIED: $did_pattern</B>\n";
$stmt="UPDATE vicidial_inbound_dids set did_pattern='$did_pattern',did_description='$did_description',did_active='$did_active',did_route='$did_route',extension='$extension',exten_context='$exten_context',voicemail_ext='$voicemail_ext',phone='$phone',server_ip='$server_ip',user='$user',user_unavailable_action='$user_unavailable_action',user_route_settings_ingroup='$user_route_settings_ingroup',group_id='$group_id',call_handle_method='$call_handle_method',agent_search_method='$agent_search_method',list_id='$list_id',campaign_id='$campaign_id',phone_code='$phone_code',menu_id='$menu_id',record_call='$record_call',filter_inbound_number='$filter_inbound_number',filter_phone_group_id='$filter_phone_group_id',filter_url='$filter_url',filter_action='$filter_action',filter_extension='$filter_extension',filter_exten_context='$filter_exten_context',filter_voicemail_ext='$filter_voicemail_ext',filter_phone='$filter_phone',filter_server_ip='$filter_server_ip',filter_user='$filter_user',filter_user_unavailable_action='$filter_user_unavailable_action',filter_user_route_settings_ingroup='$filter_user_route_settings_ingroup',filter_group_id='$filter_group_id',filter_call_handle_method='$filter_call_handle_method',filter_agent_search_method='$filter_agent_search_method',filter_list_id='$filter_list_id',filter_campaign_id='$filter_campaign_id',filter_phone_code='$filter_phone_code',filter_menu_id='$filter_menu_id',filter_clean_cid_number='$filter_clean_cid_number' where did_id='$did_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='DIDS', event_type='MODIFY', record_id='$did_id', event_code='ADMIN MODIFY DID', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=3311; # go to did modification form below
}
######################
# ADD=4511 modify call menu info in the system
######################
if ($ADD==4511)
{
if ($LOGmodify_dids==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (strlen($menu_id) < 1)
{
echo "<br>CALL MENU NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>menu_id must be at least 1 character in length\n";
}
else
{
echo "<br><B>CALL MENU MODIFIED: $menu_id</B>\n";
$stmt="UPDATE vicidial_call_menu set menu_name='$menu_name',menu_prompt='$menu_prompt',menu_timeout='$menu_timeout',menu_timeout_prompt='$menu_timeout_prompt',menu_invalid_prompt='$menu_invalid_prompt',menu_repeat='$menu_repeat',menu_time_check='$menu_time_check',call_time_id='$call_time_id',track_in_vdac='$track_in_vdac',custom_dialplan_entry='$custom_dialplan_entry',tracking_group='$tracking_group',dtmf_log='$dtmf_log' where menu_id='$menu_id';";
$rslt=mysql_query($stmt, $link);
$h=0;
$option_value_list='|';
while ($h <= 18)
{
$option_value=''; $option_description=''; $option_route=''; $option_route_value=''; $option_route_value_context='';
if (isset($_GET["option_value_$h"])) {$option_value=$_GET["option_value_$h"];}
elseif (isset($_POST["option_value_$h"])) {$option_value=$_POST["option_value_$h"];}
if (isset($_GET["option_description_$h"])) {$option_description=$_GET["option_description_$h"];}
elseif (isset($_POST["option_description_$h"])) {$option_description=$_POST["option_description_$h"];}
if (isset($_GET["option_route_$h"])) {$option_route=$_GET["option_route_$h"];}
elseif (isset($_POST["option_route_$h"])) {$option_route=$_POST["option_route_$h"];}
if (isset($_GET["option_route_value_$h"])) {$option_route_value=$_GET["option_route_value_$h"];}
elseif (isset($_POST["option_route_value_$h"])) {$option_route_value=$_POST["option_route_value_$h"];}
if (isset($_GET["option_route_value_context_$h"])) {$option_route_value_context=$_GET["option_route_value_context_$h"];}
elseif (isset($_POST["option_route_value_context_$h"])) {$option_route_value_context=$_POST["option_route_value_context_$h"];}
if ($option_route == "INGROUP")
{
if (isset($_GET["IGhandle_method_$h"])) {$IGhandle_method=$_GET["IGhandle_method_$h"];}
elseif (isset($_POST["IGhandle_method_$h"])) {$IGhandle_method=$_POST["IGhandle_method_$h"];}
if (isset($_GET["IGsearch_method_$h"])) {$IGsearch_method=$_GET["IGsearch_method_$h"];}
elseif (isset($_POST["IGsearch_method_$h"])) {$IGsearch_method=$_POST["IGsearch_method_$h"];}
if (isset($_GET["IGlist_id_$h"])) {$IGlist_id=$_GET["IGlist_id_$h"];}
elseif (isset($_POST["IGlist_id_$h"])) {$IGlist_id=$_POST["IGlist_id_$h"];}
if (isset($_GET["IGcampaign_id_$h"])) {$IGcampaign_id=$_GET["IGcampaign_id_$h"];}
elseif (isset($_POST["IGcampaign_id_$h"])) {$IGcampaign_id=$_POST["IGcampaign_id_$h"];}
if (isset($_GET["IGphone_code_$h"])) {$IGphone_code=$_GET["IGphone_code_$h"];}
elseif (isset($_POST["IGphone_code_$h"])) {$IGphone_code=$_POST["IGphone_code_$h"];}
if (isset($_GET["IGvid_enter_filename_$h"])) {$IGvid_enter_filename=$_GET["IGvid_enter_filename_$h"];}
elseif (isset($_POST["IGvid_enter_filename_$h"])) {$IGvid_enter_filename=$_POST["IGvid_enter_filename_$h"];}
if (isset($_GET["IGvid_id_number_filename_$h"])) {$IGvid_id_number_filename=$_GET["IGvid_id_number_filename_$h"];}
elseif (isset($_POST["IGvid_id_number_filename_$h"])) {$IGvid_id_number_filename=$_POST["IGvid_id_number_filename_$h"];}
if (isset($_GET["IGvid_confirm_filename_$h"])) {$IGvid_confirm_filename=$_GET["IGvid_confirm_filename_$h"];}
elseif (isset($_POST["IGvid_confirm_filename_$h"])) {$IGvid_confirm_filename=$_POST["IGvid_confirm_filename_$h"];}
if (isset($_GET["IGvid_validate_digits_$h"])) {$IGvid_validate_digits=$_GET["IGvid_validate_digits_$h"];}
elseif (isset($_POST["IGvid_validate_digits_$h"])) {$IGvid_validate_digits=$_POST["IGvid_validate_digits_$h"];}
$option_route_value_context = "$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code,$IGvid_enter_filename,$IGvid_id_number_filename,$IGvid_confirm_filename,$IGvid_validate_digits";
}
if ($non_latin < 1)
{
$option_value = ereg_replace("[^-\_0-9A-Z]","",$option_value);
$option_description = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$option_description);
$option_route = ereg_replace("[^-_0-9a-zA-Z]","",$option_route);
$option_route_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$option_route_value);
$option_route_value_context = ereg_replace("[^,-_0-9a-zA-Z]","",$option_route_value_context);
}
if (strlen($option_route) > 0)
{
$stmtA="SELECT count(*) from vicidial_call_menu_options where menu_id='$menu_id' and option_value='$option_value';";
$rslt=mysql_query($stmtA, $link);
$row=mysql_fetch_row($rslt);
$option_exists = $row[0];
if ($option_exists > 0)
{
$stmtA="UPDATE vicidial_call_menu_options SET option_description='$option_description',option_route='$option_route',option_route_value='$option_route_value',option_route_value_context='$option_route_value_context' where menu_id='$menu_id' and option_value='$option_value';";
$rslt=mysql_query($stmtA, $link);
$stmtAX .= "$stmtA|";
}
else
{
$stmtA="INSERT INTO vicidial_call_menu_options SET menu_id='$menu_id',option_value='$option_value',option_description='$option_description',option_route='$option_route',option_route_value='$option_route_value',option_route_value_context='$option_route_value_context';";
$rslt=mysql_query($stmtA, $link);
$stmtAX .= "$stmtA|";
}
}
else
{
$stmtA="SELECT count(*) from vicidial_call_menu_options where menu_id='$menu_id' and option_value='$option_value';";
$rslt=mysql_query($stmtA, $link);
$row=mysql_fetch_row($rslt);
$option_exists_db = $row[0];
if ($option_exists_db > 0)
{
$stmtA="DELETE FROM vicidial_call_menu_options where menu_id='$menu_id' and option_value='$option_value';";
$rslt=mysql_query($stmtA, $link);
$stmtAX .= "$stmtA|";
}
}
$option_value_list .= "$option_value|";
$h++;
}
## delete existing database records that were not in the submit
while ($h <= 18)
{
if (!preg_match("/\|$dtmf[$h]\|/i",$option_value_list))
{
$stmtA="SELECT count(*) from vicidial_call_menu_options where menu_id='$menu_id' and option_value='$dtmf[$h]';";
$rslt=mysql_query($stmtA, $link);
$row=mysql_fetch_row($rslt);
$option_exists_db = $row[0];
if ($option_exists_db > 0)
{
$stmtA="DELETE FROM vicidial_call_menu_options where menu_id='$menu_id' and option_value='$dtmf[$h]';";
$rslt=mysql_query($stmtA, $link);
$stmtAX .= "$stmtA|";
}
}
$h++;
}
$stmtA="UPDATE servers set rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';";
$rslt=mysql_query($stmtA, $link);
$stmtAX .= "$stmtA|";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtAX";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='MODIFY', record_id='$menu_id', event_code='ADMIN MODIFY CALL MENU', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=3511; # go to call menu modification form below
}
######################
# ADD=4711 modify filter phone group info in the system
######################
if ($ADD==4711)
{
if ($LOGmodify_dids==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_name) < 2) or (strlen($filter_phone_group_name) > 40) )
{
echo "<br>FILTER PHONE GROUP NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>Filter Phone Group Name and ID must be at least 2 characters in length\n";
}
else
{
$stmt="UPDATE vicidial_filter_phone_groups set filter_phone_group_name='$filter_phone_group_name', filter_phone_group_description='$filter_phone_group_description' where filter_phone_group_id='$filter_phone_group_id';";
$rslt=mysql_query($stmt, $link);
echo "<br><B>FILTER PHONE GROUP MODIFIED</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='MODIFY', record_id='$filter_phone_group_id', event_code='ADMIN FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=3711; # go to filter phone group modification form below
}
######################
# ADD=41111 modify remote agents info in the system
######################
if ($ADD==41111)
{
if ($LOGmodify_remoteagents==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_users where user='$user_start';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] < 1)
{echo "<br>REMOTE AGENTS NOT MODIFIED - you must use a valid user as the user_start for remote agents\n";}
else
{
### check for closest remote agents to this account to ensure no overlapping
$user_finish = ($user_start + $number_of_lines);
$stmt="SELECT count(*) from vicidial_remote_agents where user_start > '$user_start' and user_start < '$user_finish';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>REMOTE AGENTS NOT MODIFIED - your number of lines overlaps with another remote agent\n";}
else
{
if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) )
{
echo "<br>REMOTE AGENTS NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>User ID Start and External Extension must be at least 2 characters in length\n";
}
else
{
$stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value',extension_group='$extension_group',on_hook_agent='$on_hook_agent',on_hook_ring_time='$on_hook_ring_time' where remote_agent_id='$remote_agent_id';";
$rslt=mysql_query($stmt, $link);
echo "<br><B>REMOTE AGENTS MODIFIED</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='MODIFY', record_id='$remote_agent_id', event_code='ADMIN MODIFY REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=31111; # go to remote agents modification form below
}
######################
# ADD=42111 modify extenison group entry in the system
######################
if ($ADD==42111)
{
if ($LOGmodify_remoteagents==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($extension_id) < 1) or (strlen($extension_group_id) < 2) or (strlen($extension) < 2) or (strlen($rank) < 1) )
{
echo "<br>EXTENSION GROUP ENTRY NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>Extension group id and extension must be at least 2 characters in length\n";
}
else
{
$stmt="UPDATE vicidial_extension_groups set extension_group_id='$extension_group_id', extension='$extension', rank='$rank', campaign_groups='$campaign_groups' where extension_id='$extension_id';";
$rslt=mysql_query($stmt, $link);
echo "<br><B>EXTENSION GROUP ENTRY MODIFIED</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='MODIFY', record_id='$extension_id', event_code='ADMIN MODIFY EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=32111; # go to extension group modification form below
}
######################
# ADD=411111 modify user group info in the system
######################
if ($ADD==411111)
{
if ($LOGmodify_usergroups==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) )
{
echo "<br>USER GROUP NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>Group name and description must be at least 2 characters in length\n";
}
else
{
$p=0;
$GROUP_shifts=' ';
$group_shifts_ct = count($group_shifts);
while ($p <= $group_shifts_ct)
{
$group_shifts[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$group_shifts[$p]);
$GROUP_shifts .= "$group_shifts[$p] ";
$p++;
}
$p=0;
$VGROUP_vgroups=' ';
$vgroup_vgroups_ct = count($agent_status_viewable_groups);
while ($p <= $vgroup_vgroups_ct)
{
$agent_status_viewable_groups[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]);
$VGROUP_vgroups .= "$agent_status_viewable_groups[$p] ";
$p++;
}
$k=0;
$multi_count = count($allowed_reports);
$multi_array = $allowed_reports;
while ($k < $multi_count)
{
$new_field_value .= "$multi_array[$k],";
$k++;
}
$allowed_reports = preg_replace("/,$/","",$new_field_value);
$stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time',agent_call_log_view='$agent_call_log_view',agent_xfer_consultative='$agent_xfer_consultative',agent_xfer_dial_override='$agent_xfer_dial_override',agent_xfer_vm_transfer='$agent_xfer_vm_transfer',agent_xfer_blind_transfer='$agent_xfer_blind_transfer',agent_xfer_dial_with_customer='$agent_xfer_dial_with_customer',agent_xfer_park_customer_dial='$agent_xfer_park_customer_dial',agent_fullscreen='$agent_fullscreen',allowed_reports='$allowed_reports',webphone_url_override='" . mysql_real_escape_string($webphone_url_override) . "',webphone_systemkey_override='$webphone_systemkey_override',webphone_dialpad_override='$webphone_dialpad_override' where user_group='$OLDuser_group';";
$rslt=mysql_query($stmt, $link);
echo "<br><B>USER GROUP MODIFIED</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$user_group', event_code='ADMIN MODIFY USER GROUP', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
###############################################################
##### START SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP #####
$stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$ss_conf_ct = mysql_num_rows($rslt);
if ($ss_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$enable_vtiger_integration = $row[0];
$vtiger_server_ip = $row[1];
$vtiger_dbname = $row[2];
$vtiger_login = $row[3];
$vtiger_pass = $row[4];
$vtiger_url = $row[5];
}
##### END SYSTEM_SETTINGS VTIGER CONNECTION INFO LOOKUP #####
#############################################################
if ($enable_vtiger_integration > 0)
{
### connect to your vtiger database
$linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass");
if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());}
echo 'Connected successfully';
mysql_select_db("$vtiger_dbname", $linkV);
######################################
##### BEGIN Add/Update group info in Vtiger
$stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$group_found_count = $row[0];
### group exists in vtiger, update it
if ($group_found_count > 0)
{
$stmt="SELECT groupid from vtiger_groups where groupname='$user_group';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$groupid = $row[0];
$stmtA = "UPDATE vtiger_groups SET description='$group_name' where groupid='$groupid';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
}
### user doesn't exist in vtiger, insert it
else
{
#### BEGIN CREATE NEW GROUP RECORD IN VTIGER
# Get next available id from vtiger_users_seq to use as groupid
$stmt="SELECT id from vtiger_users_seq;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
$row=mysql_fetch_row($rslt);
$groupid = ($row[0] + 1);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
# Increase next available groupid with 1 so next record gets proper id
$stmt="UPDATE vtiger_users_seq SET id = '$groupid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
#### END CREATE NEW GROUP RECORD IN VTIGER
}
##### END Add/Update group info in Vtiger
######################################
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=311111; # go to user group modification form below
}
######################
# ADD=4111111 modify script in the system
######################
if ($ADD==4111111)
{
if ($LOGmodify_scripts==1)
{
echo "<!-- $script_text -->\n";
echo "<!--" . mysql_real_escape_string($script_text) . " -->\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) )
{
echo "<br>SCRIPT NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>Script name, description and text must be at least 2 characters in length\n";
}
else
{
$stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active' where script_id='$script_id';";
$rslt=mysql_query($stmt, $link);
echo "<br><B>SCRIPT MODIFIED</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SCRIPTS', event_type='MODIFY', record_id='$script_id', event_code='ADMIN MODIFY SCRIPT', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=3111111; # go to script modification form below
}
######################
# ADD=41111111 modify filter in the system
######################
if ($ADD==41111111)
{
if ($LOGmodify_filters==1)
{
echo "<!-- $lead_filter_sql -->\n";
echo "<!--" . mysql_real_escape_string($lead_filter_sql) . " -->\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) )
{
echo "<br>FILTER NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>Filter ID, name and SQL must be at least 2 characters in length\n";
}
else
{
$stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "' where lead_filter_id='$lead_filter_id';";
$rslt=mysql_query($stmt, $link);
echo "<br><B>FILTER MODIFIED</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERS', event_type='MODIFY', record_id='$lead_filter_id', event_code='ADMIN MODIFY FILTER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=31111111; # go to filter modification form below
}
######################
# ADD=411111111 modify call time in the system
######################
if ($ADD==411111111)
{
if ($LOGmodify_call_times==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) )
{
echo "<br>CALL TIME NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>Call Time ID and name must be at least 2 characters in length\n";
}
else
{
$ct_default_start = preg_replace('/\D/', '', $ct_default_start);
$ct_default_stop = preg_replace('/\D/', '', $ct_default_stop);
$ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start);
$ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop);
$ct_monday_start = preg_replace('/\D/', '', $ct_monday_start);
$ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop);
$ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start);
$ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop);
$ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start);
$ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop);
$ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start);
$ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop);
$ct_friday_start = preg_replace('/\D/', '', $ct_friday_start);
$ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop);
$ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start);
$ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop);
$stmt="UPDATE vicidial_call_times set call_time_name='$call_time_name', call_time_comments='$call_time_comments', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop', ct_sunday_start='$ct_sunday_start', ct_sunday_stop='$ct_sunday_stop', ct_monday_start='$ct_monday_start', ct_monday_stop='$ct_monday_stop', ct_tuesday_start='$ct_tuesday_start', ct_tuesday_stop='$ct_tuesday_stop', ct_wednesday_start='$ct_wednesday_start', ct_wednesday_stop='$ct_wednesday_stop', ct_thursday_start='$ct_thursday_start', ct_thursday_stop='$ct_thursday_stop', ct_friday_start='$ct_friday_start', ct_friday_stop='$ct_friday_stop', ct_saturday_start='$ct_saturday_start', ct_saturday_stop='$ct_saturday_stop', default_afterhours_filename_override='$default_afterhours_filename_override', sunday_afterhours_filename_override='$sunday_afterhours_filename_override', monday_afterhours_filename_override='$monday_afterhours_filename_override', tuesday_afterhours_filename_override='$tuesday_afterhours_filename_override', wednesday_afterhours_filename_override='$wednesday_afterhours_filename_override', thursday_afterhours_filename_override='$thursday_afterhours_filename_override', friday_afterhours_filename_override='$friday_afterhours_filename_override', saturday_afterhours_filename_override='$saturday_afterhours_filename_override' where call_time_id='$call_time_id';";
$rslt=mysql_query($stmt, $link);
echo "<br><B>CALL TIME MODIFIED</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLTIMES', event_type='MODIFY', record_id='$call_time_id', event_code='ADMIN MODIFY CALL TIME', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=311111111; # go to call time modification form below
}
######################
# ADD=4111111111 modify state call time in the system
######################
if ($ADD==4111111111)
{
if ($LOGmodify_call_times==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) )
{
echo "<br>STATE CALL TIME NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>State Call Time ID, name and state must be at least 2 characters in length\n";
}
else
{
$ct_default_start = preg_replace('/\D/', '', $ct_default_start);
$ct_default_stop = preg_replace('/\D/', '', $ct_default_stop);
$ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start);
$ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop);
$ct_monday_start = preg_replace('/\D/', '', $ct_monday_start);
$ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop);
$ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start);
$ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop);
$ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start);
$ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop);
$ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start);
$ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop);
$ct_friday_start = preg_replace('/\D/', '', $ct_friday_start);
$ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop);
$ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start);
$ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop);
$stmt="UPDATE vicidial_state_call_times set state_call_time_name='$call_time_name', state_call_time_comments='$call_time_comments', sct_default_start='$ct_default_start', sct_default_stop='$ct_default_stop', sct_sunday_start='$ct_sunday_start', sct_sunday_stop='$ct_sunday_stop', sct_monday_start='$ct_monday_start', sct_monday_stop='$ct_monday_stop', sct_tuesday_start='$ct_tuesday_start', sct_tuesday_stop='$ct_tuesday_stop', sct_wednesday_start='$ct_wednesday_start', sct_wednesday_stop='$ct_wednesday_stop', sct_thursday_start='$ct_thursday_start', sct_thursday_stop='$ct_thursday_stop', sct_friday_start='$ct_friday_start', sct_friday_stop='$ct_friday_stop', sct_saturday_start='$ct_saturday_start', sct_saturday_stop='$ct_saturday_stop', state_call_time_state='$state_call_time_state' where state_call_time_id='$call_time_id';";
$rslt=mysql_query($stmt, $link);
echo "<br><B>STATE CALL TIME MODIFIED</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLTIMES', event_type='MODIFY', record_id='$call_time_id', event_code='ADMIN MODIFY STATE CALL TIME', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=3111111111; # go to state call time modification form below
}
######################
# ADD=431111111 modify shift in the system
######################
if ($ADD==431111111)
{
if ($LOGmodify_call_times==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$shift_length_test = eregi_replace(':','',$shift_length);
if ( (strlen($shift_id) < 2) or (strlen($shift_name) < 2) or (strlen($shift_start_time) < 4) or (strlen($shift_start_time) > 4) or (strlen($shift_length) < 5) or (strlen($shift_length) > 5) or ($shift_start_time > 2359) or ($shift_length_test > 2400) )
{
echo "<br>SHIFT DEFINITION NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>Shift ID and name must be at least 2 characters in length\n";
echo "<br>Shift Start Time must be 4 digits in length and be a valid time\n";
echo "<br>Shift Length must be 5 characters in length and be 24 hours or less\n";
}
else
{
$p=0;
$shift_weekdays_ct = count($shift_weekdays);
while ($p <= $shift_weekdays_ct)
{
$SHIFT_weekdays .= "$shift_weekdays[$p]";
$p++;
}
$shift_start_time = preg_replace('/\D/', '', $shift_start_time);
$stmt="UPDATE vicidial_shifts set shift_name='$shift_name', shift_start_time='$shift_start_time', shift_length='$shift_length', shift_weekdays='$SHIFT_weekdays' where shift_id='$shift_id';";
$rslt=mysql_query($stmt, $link);
echo "<br><B>SHIFT MODIFIED</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SHIFTS', event_type='MODIFY', record_id='$shift_id', event_code='ADMIN MODIFY SHIFT', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=331111111; # go to shift modification form below
}
######################
# ADD=41111111111 modify phone record in the system
######################
if ($ADD==41111111111)
{
if ($LOGast_admin_access==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ( ($row[0] > 0) and ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) )
{echo "<br>PHONE NOT MODIFIED - there is already a Phone in the system with this extension/server\n";}
else
{
if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1))
{echo "<br>PHONE NOT MODIFIED - Please go back and look at the data you entered\n";}
else
{
echo "<br>PHONE MODIFIED: $extension\n";
$stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret', delete_vm_after_email='$delete_vm_after_email',is_webphone='$is_webphone',use_external_server_ip='$use_external_server_ip',codecs_list='$codecs_list',codecs_with_template='$codecs_with_template',webphone_dialpad='$webphone_dialpad',on_hook_agent='$on_hook_agent',webphone_auto_answer='$webphone_auto_answer',voicemail_timezone='$voicemail_timezone',voicemail_options='$voicemail_options' where extension='$old_extension' and server_ip='$old_server_ip';";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONES', event_type='MODIFY', record_id='$extension', event_code='ADMIN MODIFY PHONE', event_sql=\"$SQL_log\", event_notes='Server IP: $server_ip';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=31111111111; # go to phone modification form below
}
######################
# ADD=42111111111 modify phone alias record in the system
######################
if ($ADD==42111111111)
{
if ($LOGast_admin_access==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from phones_alias where alias_id='$alias_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ( (strlen($alias_id) < 1) or (strlen($alias_name) < 2) )
{echo "<br>PHONE ALIAS NOT MODIFIED - Please go back and look at the data you entered\n";}
else
{
echo "<br>PHONE ALIAS MODIFIED: $alias_id\n";
$stmt="UPDATE phones_alias set alias_name='$alias_name', logins_list='$logins_list' where alias_id='$alias_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONEALIASES', event_type='MODIFY', record_id='$alias_id', event_code='ADMIN MODIFY PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=32111111111; # go to phone alias modification form below
}
######################
# ADD=43111111111 modify group alias record in the system
######################
if ($ADD==43111111111)
{
if ($LOGast_admin_access==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from groups_alias where group_alias_id='$group_alias_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ( (strlen($group_alias_id) < 1) or (strlen($group_alias_name) < 2) )
{echo "<br>GROUP ALIAS NOT MODIFIED - Please go back and look at the data you entered\n";}
else
{
echo "<br>GROUP ALIAS MODIFIED: $alias_id\n";
$stmt="UPDATE groups_alias set group_alias_name='$group_alias_name', caller_id_number='$caller_id_number', caller_id_name='$caller_id_name', active='$active' where group_alias_id='$group_alias_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='GROUPALIASES', event_type='MODIFY', record_id='$group_alias_id', event_code='ADMIN MODIFY GROUP ALIAS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=33111111111; # go to group alias modification form below
}
######################
# ADD=411111111111 modify server record in the system
######################
if ($ADD==411111111111)
{
if ($LOGmodify_servers==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from servers where server_id='$server_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ( ($row[0] > 0) and ($server_id != $old_server_id) )
{echo "<br>SERVER NOT MODIFIED - there is already a server in the system with this server_id\n";}
else
{
$stmt="SELECT count(*) from servers where server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ( ($row[0] > 0) and ($server_ip != $old_server_ip) )
{echo "<br>SERVER NOT MODIFIED - there is already a server in the system with this server_ip\n";}
else
{
if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) )
{echo "<br>SERVER NOT MODIFIED - Please go back and look at the data you entered\n";}
else
{
$stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context', sys_perf_log='$sys_perf_log', vd_server_logs='$vd_server_logs', agi_output='$agi_output', vicidial_balance_active='$vicidial_balance_active',balance_trunks_offlimits='$balance_trunks_offlimits',recording_web_link='$recording_web_link',alt_server_ip='$alt_server_ip',active_asterisk_server='$active_asterisk_server',generate_vicidial_conf='$generate_vicidial_conf',rebuild_conf_files='$rebuild_conf_files',outbound_calls_per_second='$outbound_calls_per_second',sounds_update='$sounds_update',vicidial_recording_limit='$vicidial_recording_limit',carrier_logging_active='$carrier_logging_active',vicidial_balance_rank='$vicidial_balance_rank',rebuild_music_on_hold='$rebuild_music_on_hold',active_agent_login_server='$active_agent_login_server',conf_secret='$conf_secret',external_server_ip='$external_server_ip',custom_dialplan_entry='$custom_dialplan_entry',active_twin_server_ip='$active_twin_server_ip' where server_id='$old_server_id';";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';";
$rslt=mysql_query($stmtA, $link);
echo "<br>SERVER MODIFIED: $server_ip\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SERVERS', event_type='MODIFY', record_id='$server_id', event_code='ADMIN MODIFY SERVER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=311111111111; # go to server modification form below
}
######################
# ADD=421111111111 modify vicidial server trunks record in the system
######################
if ($ADD==421111111111)
{
if ($LOGmodify_servers==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT max_vicidial_trunks from servers where server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
$MAXvicidial_trunks = $rowx[0];
$stmt="SELECT sum(dedicated_trunks) from vicidial_server_trunks where server_ip='$server_ip' and campaign_id !='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
$SUMvicidial_trunks = ($rowx[0] + $dedicated_trunks);
if ($SUMvicidial_trunks > $MAXvicidial_trunks)
{
echo "<br>VICIDIAL SERVER TRUNK RECORD NOT ADDED - the number of vicidial trunks is too high: $SUMvicidial_trunks / $MAXvicidial_trunks\n";
}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) or (strlen($dedicated_trunks) < 1) or (strlen($trunk_restriction) < 1) )
{
echo "<br>VICIDIAL SERVER TRUNK RECORD NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>campaign must be between 3 and 8 characters in length\n";
echo "<br>server_ip delay must be at least 7 characters\n";
echo "<br>trunks must be a digit from 0 to 9999\n";
}
else
{
$stmt="UPDATE vicidial_server_trunks SET dedicated_trunks='$dedicated_trunks',trunk_restriction='$trunk_restriction' where campaign_id='$campaign_id' and server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
echo "<br><B>VICIDIAL SERVER TRUNK RECORD MODIFIED: $campaign_id - $server_ip - $dedicated_trunks - $trunk_restriction</B>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SERVERTRUNKS', event_type='MODIFY', record_id='$server_ip', event_code='ADMIN MODIFY SERVER TRUNK', event_sql=\"$SQL_log\", event_notes='Campaign: $campaign_id';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=311111111111; # go to server modification form below
}
######################
# ADD=431111111111 modify conf template record in the system
###################### '$template_id','$template_name','$template_contents'
if ($ADD==431111111111)
{
if ($LOGmodify_servers==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($template_id) < 1) or (strlen($template_name) < 1) )
{echo "<br>CONF TEMPLATE NOT MODIFIED - Please go back and look at the data you entered\n";}
else
{
$stmt="UPDATE vicidial_conf_templates set template_name='$template_name',template_contents='$template_contents' where template_id='$template_id';";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';";
$rslt=mysql_query($stmtA, $link);
echo "<br>CONF TEMPLATE MODIFIED: $template_id\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONFTEMPLATES', event_type='MODIFY', record_id='$template_id', event_code='ADMIN MODIFY CONF TEMPLATE', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=331111111111; # go to conf template modification form below
}
######################
# ADD=441111111111 modify carrier record in the system
######################
if ($ADD==441111111111)
{
if ($LOGmodify_servers==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($carrier_id) < 1) or (strlen($server_ip) < 7) or (strlen($protocol) < 1) )
{echo "<br>CARRIER NOT MODIFIED - Please go back and look at the data you entered\n";}
else
{
$stmt="UPDATE vicidial_server_carriers set carrier_name='$carrier_name',registration_string='$registration_string',template_id='$template_id',account_entry='$account_entry',protocol='$protocol',globals_string='$globals_string',dialplan_entry='$dialplan_entry',server_ip='$server_ip',active='$active',carrier_description='$carrier_description' where carrier_id='$carrier_id';";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
echo "<br>CARRIER MODIFIED: $carrier_id\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CARRIERS', event_type='MODIFY', record_id='$carrier_id', event_code='ADMIN MODIFY CARRIER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=341111111111; # go to carrier modification form below
}
######################
# ADD=451111111111 modify tts record in the system
######################
if ($ADD==451111111111)
{
if ($LOGmodify_servers==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($tts_id) < 2) or (strlen($tts_name) < 5) )
{echo "<br>TTS ENTRY NOT MODIFIED - Please go back and look at the data you entered\n";}
else
{
$stmt="UPDATE vicidial_tts_prompts set tts_name='$tts_name',active='$active',tts_voice='$tts_voice',tts_text=\"$tts_text\" where tts_id='$tts_id';";
$rslt=mysql_query($stmt, $link);
echo "<br>TTS ENTRY MODIFIED: $tts_id\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TTS', event_type='MODIFY', record_id='$tts_id', event_code='ADMIN MODIFY TTS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=351111111111; # go to tts entry modification form below
}
######################
# ADD=461111111111 modify music on hold record in the system
######################
if ($ADD==461111111111)
{
if ($LOGmodify_servers==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ($stage == "FILEDELETE")
{
if ( (strlen($moh_id) < 2) or (strlen($filename) < 1) or ($moh_id=='sounds') or ($moh_id=='agi-bin') or ($moh_id=='astdb') or ($moh_id=='keys') )
{echo "<br>MUSIC ON HOLD ENTRY NOT MODIFIED - Please go back and look at the data you entered\n";}
else
{
$stmt="DELETE FROM vicidial_music_on_hold_files where moh_id='$moh_id' and filename='$filename';";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y',sounds_update='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';";
$rslt=mysql_query($stmtA, $link);
echo "<br>MUSIC ON HOLD ENTRY MODIFIED: $moh_id - $filename\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='MOH', event_type='MODIFY', record_id='$moh_id', event_code='ADMIN MODIFY MOH', event_sql=\"$SQL_log\", event_notes='FILE DELETE';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
if ( (strlen($moh_id) < 2) or (strlen($moh_name) < 5) or ($moh_id=='sounds') or ($moh_id=='agi-bin') or ($moh_id=='astdb') or ($moh_id=='keys') )
{echo "<br>MUSIC ON HOLD ENTRY NOT MODIFIED - Please go back and look at the data you entered\n";}
else
{
$stmt="UPDATE vicidial_music_on_hold set moh_name='$moh_name',active='$active',random='$random' where moh_id='$moh_id';";
$rslt=mysql_query($stmt, $link);
$stmtLIST = $stmt;
$stmt="SELECT filename,rank from vicidial_music_on_hold_files where moh_id='$moh_id' order by rank;";
$rsltx=mysql_query($stmt, $link);
$mohfiles_to_print = mysql_num_rows($rsltx);
$ranks = ($mohfiles_to_print + 1);
$o=0;
while ($mohfiles_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
$mohfiles[$o] = $rowx[0];
$mohranks[$o] = $rowx[1];
$o++;
}
$o=0;
while ($mohfiles_to_print > $o)
{
$new_rank=0;
$Ffilename = $mohfiles[$o];
if (isset($_GET[$Ffilename])) {$new_rank=$_GET[$Ffilename];}
elseif (isset($_POST[$Ffilename])) {$new_rank=$_POST[$Ffilename];}
$stmt="UPDATE vicidial_music_on_hold_files set rank='$new_rank' where moh_id='$moh_id' and filename='$mohfiles[$o]';";
$rslt=mysql_query($stmt, $link);
$stmtLIST .= "|$stmt";
$o++;
}
if (strlen($filename) > 0)
{
$stmt="INSERT INTO vicidial_music_on_hold_files set filename='$filename',rank='$ranks',moh_id='$moh_id';";
$rslt=mysql_query($stmt, $link);
$stmtLIST .= "|$stmt";
}
$stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y',sounds_update='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';";
$rslt=mysql_query($stmtA, $link);
echo "<br>MUSIC ON HOLD ENTRY MODIFIED: $moh_id\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmtLIST|$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='MOH', event_type='MODIFY', record_id='$moh_id', event_code='ADMIN MODIFY MOH', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=361111111111; # go to music on hold entry modification form below
}
######################
# ADD=471111111111 modify voicemail record in the system
######################
if ($ADD==471111111111)
{
if ($LOGmodify_servers==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($voicemail_id) < 2) or (strlen($fullname) < 2) )
{echo "<br>VOICEMAIL BOX NOT MODIFIED - Please go back and look at the data you entered\n";}
else
{
$stmt="UPDATE vicidial_voicemail set fullname='$fullname',active='$active',pass='$pass',email='$email',delete_vm_after_email='$delete_vm_after_email',voicemail_timezone='$voicemail_timezone',voicemail_options='$voicemail_options' where voicemail_id='$voicemail_id';";
$rslt=mysql_query($stmt, $link);
$stmt="SELECT active_voicemail_server from system_settings;";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$active_voicemail_server = $row[0];
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$active_voicemail_server';";
$rslt=mysql_query($stmtA, $link);
echo "<br>VOICEMAIL BOX MODIFIED: $voicemail_id\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='VOICEMAIL', event_type='MODIFY', record_id='$voicemail_id', event_code='ADMIN MODIFY VOICEMAIL', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=371111111111; # go to voicemail entry modification form below
}
######################
# ADD=481111111111 modify screen label record in the system
######################
if ($ADD==481111111111)
{
if ($LOGmodify_servers==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($label_id) < 2) or (strlen($label_name) < 2) )
{echo "<br>SCREEN LABEL NOT MODIFIED - Please go back and look at the data you entered\n";}
else
{
$stmt="UPDATE vicidial_screen_labels set label_name='$label_name',active='$active',label_hide_field_logs='$label_hide_field_logs',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments' where label_id='$label_id';";
$rslt=mysql_query($stmt, $link);
echo "<br>SCREEN LABEL MODIFIED: $label_id\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABEL', event_type='MODIFY', record_id='$label_id', event_code='ADMIN MODIFY LABEL', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=381111111111; # go to screen label entry modification form below
}
######################
# ADD=4111111111111 modify conference record in the system
######################
if ($ADD==4111111111111)
{
if ($LOGast_admin_access==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) )
{echo "<br>CONFERENCE NOT MODIFIED - there is already a Conference in the system with this extension-server\n";}
else
{
if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) )
{echo "<br>CONFERENCE NOT MODIFIED - Please go back and look at the data you entered\n";}
else
{
echo "<br>CONFERENCE MODIFIED: $conf_exten\n";
$stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten' and server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=3111111111111; # go to conference modification form below
}
######################
# ADD=41111111111111 modify vicidial conference record in the system
######################
if ($ADD==41111111111111)
{
if ($LOGast_admin_access==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) )
{echo "<br>VICIDIAL CONFERENCE NOT MODIFIED - there is already a Conference in the system with this extension-server\n";}
else
{
if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) )
{echo "<br>VICIDIAL CONFERENCE NOT MODIFIED - Please go back and look at the data you entered\n";}
else
{
echo "<br>VICIDIAL CONFERENCE MODIFIED: $conf_exten\n";
$stmt="UPDATE vicidial_conferences set conf_exten='$conf_exten',extension='$extension' where conf_exten='$old_conf_exten' and server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=31111111111111; # go to vicidial conference modification form below
}
######################
# ADD=411111111111111 modify vicidial system settings
######################
if ($ADD==411111111111111)
{
if ($LOGmodify_servers==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>VICIDIAL SYSTEM SETTINGS MODIFIED\n";
$k=0;
$multi_count = count($reports_use_slave_db);
$multi_array = $reports_use_slave_db;
while ($k < $multi_count)
{
$new_field_value .= "$multi_array[$k],";
$k++;
}
$reports_use_slave_db = preg_replace("/,$/","",$new_field_value);
$stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset',default_voicemail_timezone='$default_voicemail_timezone',default_local_gmt='$default_local_gmt';";
$rslt=mysql_query($stmt, $link);
if ($reload_dialplan_on_servers > 0)
{
$stmtB="UPDATE servers set rebuild_conf_files='Y' where active='Y' and active_asterisk_server='Y' and generate_vicidial_conf='Y';";
$rslt=mysql_query($stmtB, $link);
}
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtB|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SYSTEMSETTINGS', event_type='MODIFY', record_id='system_settings', event_code='ADMIN MODIFY SYSTEM SETTINGS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=311111111111111; # go to vicidial system settings form below
}
######################
# ADD=421111111111111 modify/delete system status in the system
######################
if ($ADD==421111111111111)
{
if ($LOGmodify_servers==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (ereg('delete',$stage))
{
if ( (strlen($status) < 1) or (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$status)) )
{
echo "<br>SYSTEM STATUS NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>the system status cannot be a reserved status: B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n";
echo "<br>the system status needs to be at least 1 characters in length\n";
}
else
{
echo "<br><B>SYSTEM STATUS DELETED: $status</B>\n";
$stmt="DELETE FROM vicidial_statuses where status='$status';";
$rslt=mysql_query($stmt, $link);
$stmtA="DELETE FROM vicidial_campaign_hotkeys where status='$status';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SYSTEMSTATUSES', event_type='DELETE', record_id='$status', event_code='ADMIN DELETE SYSTEM STATUS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
if (ereg('modify',$stage))
{
if ( (strlen($status) < 1) or (strlen($status_name) < 2) )
{
echo "<br>SYSTEM STATUS NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>the system status needs to be at least 1 characters in length\n";
echo "<br>the system status name needs to be at least 1 characters in length\n";
}
else
{
echo "<br><B>SYSTEM STATUS MODIFIED: $status</B>\n";
$stmt="UPDATE vicidial_statuses SET status_name='$status_name',selectable='$selectable',human_answered='$human_answered',category='$category',sale='$sale',dnc='$dnc',customer_contact='$customer_contact',not_interested='$not_interested',unworkable='$unworkable',scheduled_callback='$scheduled_callbacks' where status='$status';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SYSTEMSTATUSES', event_type='MODIFY', record_id='$status', event_code='ADMIN MODIFY SYSTEM STATUS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=321111111111111; # go to system settings modification form below
}
######################
# ADD=431111111111111 modify/delete status category in the system
######################
if ($ADD==431111111111111)
{
if ($LOGmodify_servers==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($vsc_id) < 2) or (preg_match("/^UNDEFINED$/i",$vsc_id)) )
{
echo "<br>STATUS CATEGORY NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>the status category cannot be a reserved category: UNDEFINED\n";
echo "<br>the status category needs to be at least 2 characters in length\n";
}
else
{
if (ereg('delete',$stage))
{
echo "<br><B>STATUS CATEGORY DELETED: $vsc_id</B>\n";
$stmt="DELETE FROM vicidial_status_categories where vsc_id='$vsc_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='STATUSCATEGORIES', event_type='DELETE', record_id='$vsc_id', event_code='ADMIN DELETE STATUS CATEGORY', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
if (ereg('modify',$stage))
{
echo "<br><B>STATUS CATEGORY MODIFIED: $vsc_id</B>\n";
$stmt="SELECT count(*) from vicidial_status_categories where tovdad_display='Y' and vsc_id NOT IN('$vsc_id');";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ( ($row[0] > 3) and (ereg('Y',$tovdad_display)) )
{
$tovdad_display = 'N';
echo "<br><B>ERROR: There are already 4 Status Categories set to TimeOnVDAD Display</B>\n";
}
$stmt="UPDATE vicidial_status_categories SET vsc_name='$vsc_name',vsc_description='$vsc_description',tovdad_display='$tovdad_display',sale_category='$sale_category',dead_lead_category='$dead_lead_category' where vsc_id='$vsc_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='STATUSCATEGORIES', event_type='MODIFY', record_id='$vsc_id', event_code='ADMIN MODIFY STATUS CATEGORY', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=331111111111111; # go to system settings modification form below
}
######################
# ADD=441111111111111 modify/delete qc status code in the system
######################
if ($ADD==441111111111111)
{
if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) )
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (ereg('delete',$stage))
{
if ( (strlen($code) < 1) or (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$code)) )
{
echo "<br>QC STATUS CODE NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>the qc status code cannot be a reserved status: B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n";
echo "<br>the qc status code needs to be at least 1 characters in length\n";
}
else
{
echo "<br><B>QC STATUS CODE DELETED: $code</B>\n";
$stmt="DELETE FROM vicidial_qc_codes where code='$code';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='QCCODES', event_type='DELETE', record_id='$vsc_id', event_code='ADMIN DELETE QC CODES', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
if (ereg('modify',$stage))
{
if ( (strlen($code) < 1) or (strlen($code_name) < 2) )
{
echo "<br>QC STATUS CODE NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>the qc status code needs to be at least 1 characters in length\n";
echo "<br>the qc status code name needs to be at least 1 characters in length\n";
}
else
{
echo "<br><B>QC STATUS CODE MODIFIED: $code</B>\n";
$stmt="UPDATE vicidial_qc_codes SET code_name='$code_name' where code='$code';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='QCCODES', event_type='MODIFY', record_id='$vsc_id', event_code='ADMIN MODIFY QC CODES', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=341111111111111; # go to qc status code modification form below
}
######################################################################################################
######################################################################################################
####### 5 series, delete records confirmation
######################################################################################################
######################################################################################################
######################
# ADD=5 confirmation before deletion of user
######################
if ($ADD==5)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($user) < 2) or ($LOGdelete_users < 1) )
{
echo "<br>USER NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>User be at least 2 characters in length\n";
}
else
{
echo "<br><B>USER DELETION CONFIRMATION: $user</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=6&user=$user&CoNfIrM=YES\">Click here to delete user $user</a><br><br><br>\n";
}
$ADD='3'; # go to user modification below
}
######################
# ADD=51 confirmation before deletion of campaign
######################
if ($ADD==51)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or ($LOGdelete_campaigns < 1) )
{
echo "<br>CAMPAIGN NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Campaign_id be at least 2 characters in length\n";
}
else
{
echo "<br><B>CAMPAIGN DELETION CONFIRMATION: $campaign_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=61&campaign_id=$campaign_id&CoNfIrM=YES\">Click here to delete campaign $campaign_id</a><br><br><br>\n";
}
$ADD='31'; # go to campaign modification below
}
######################
# ADD=52 confirmation before logging all agents out of campaign of campaign
######################
if ($ADD==52)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (strlen($campaign_id) < 2)
{
echo "<br>AGENTS NOT LOGGED OUT OF CAMPAIGN - Please go back and look at the data you entered\n";
echo "<br>Campaign_id be at least 2 characters in length\n";
}
else
{
echo "<br><B>AGENT LOGOUT CONFIRMATION: $campaign_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=62&campaign_id=$campaign_id&CoNfIrM=YES&DB=$DB\">Click here to log all agents out of $campaign_id</a><br><br><br>\n";
}
$ADD='31'; # go to campaign modification below
}
######################
# ADD=53 confirmation before Emergency VDAC Jam Clear - deletes oldest LIVE vicidial_auto_call record
######################
if ($ADD==53)
{
if (eregi('IN',$stage))
{$group_id=$campaign_id;}
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (strlen($campaign_id) < 2)
{
echo "<br>VDAC NOT CLEARED FOR CAMPAIGN - Please go back and look at the data you entered\n";
echo "<br>Campaign_id be at least 2 characters in length\n";
}
else
{
echo "<br><B>VDAC CLEAR CONFIRMATION: $campaign_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=63&campaign_id=$campaign_id&CoNfIrM=YES&stage=$stage\">Click here to delete the oldest LIVE record in VDAC for $campaign_id</a><br><br><br>\n";
}
# go to campaign modification below
if (eregi('IN',$stage))
{$ADD='3111';}
else
{$ADD='31';}
}
######################
# ADD=511 confirmation before deletion of list
######################
if ($ADD==511)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($list_id) < 2) or ($LOGdelete_lists < 1) )
{
echo "<br>LIST NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>List_id be at least 2 characters in length\n";
}
else
{
echo "<br><B>LIST DELETION CONFIRMATION: $list_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=611&list_id=$list_id&CoNfIrM=YES\">Click here to delete list and all of its leads $list_id</a><br><br><br>\n";
}
$ADD='311'; # go to campaign modification below
}
######################
# ADD=5111 confirmation before deletion of in-group
######################
if ($ADD==5111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($group_id) < 2) or ($LOGdelete_ingroups < 1) )
{
echo "<br>IN-GROUP NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Group_id be at least 2 characters in length\n";
}
else
{
echo "<br><B>IN-GROUP DELETION CONFIRMATION: $group_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=6111&group_id=$group_id&CoNfIrM=YES\">Click here to delete in-group $group_id</a><br><br><br>\n";
}
$ADD='3111'; # go to in-group modification below
}
######################
# ADD=5311 confirmation before deletion of did
######################
if ($ADD==5311)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($did_id) < 1) or ($LOGdelete_dids < 1) )
{
echo "<br>DID NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>did_id be at least 1 characters in length\n";
}
else
{
echo "<br><B>DID DELETION CONFIRMATION: $menu_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=6311&did_id=$did_id&CoNfIrM=YES\">Click here to delete DID $did_id</a><br><br><br>\n";
}
$ADD='3311'; # go to did modification below
}
######################
# ADD=5511 confirmation before deletion of call menu
######################
if ($ADD==5511)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($menu_id) < 2) or ($LOGdelete_dids < 1) )
{
echo "<br>CALL MENU NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>menu_id be at least 2 characters in length\n";
}
else
{
echo "<br><B>CALL MENU DELETION CONFIRMATION: $menu_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=6511&menu_id=$menu_id&CoNfIrM=YES\">Click here to delete CALL MENU $menu_id</a><br><br><br>\n";
}
$ADD='3511'; # go to call menu modification below
}
######################
# ADD=5711 confirmation before deletion of filter phone group
######################
if ($ADD==5711)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($filter_phone_group_id) < 2) or ($LOGdelete_dids < 1) )
{
echo "<br>FILTER PHONE GROUP NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>filter_phone_group_id be at least 2 characters in length\n";
}
else
{
echo "<br><B>FILTER PHONE GROUP DELETION CONFIRMATION: $filter_phone_group_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=6711&filter_phone_group_id=$filter_phone_group_id&CoNfIrM=YES\">Click here to delete FILTER PHONE GROUP $filter_phone_group_id</a><br><br><br>\n";
}
$ADD='3711'; # go to filter phone group modification below
}
######################
# ADD=51111 confirmation before deletion of remote agent record
######################
if ($ADD==51111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($remote_agent_id) < 1) or ($LOGdelete_remote_agents < 1) )
{
echo "<br>REMOTE AGENT NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Remote_agent_id be at least 2 characters in length\n";
}
else
{
echo "<br><B>REMOTE AGENT DELETION CONFIRMATION: $remote_agent_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=61111&remote_agent_id=$remote_agent_id&CoNfIrM=YES\">Click here to delete remote agent $remote_agent_id</a><br><br><br>\n";
}
$ADD='31111'; # go to remote agent modification below
}
######################
# ADD=52111 confirmation before deletion of extension group record
######################
if ($ADD==52111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($extension_id) < 1) or ($LOGdelete_remote_agents < 1) )
{
echo "<br>EXTENSION GROUP ENTRY NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>extension_id be at least 1 characters in length\n";
}
else
{
echo "<br><B>EXTENSION GROUP ENTRY DELETION CONFIRMATION: $extension_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=62111&extension_id=$extension_id&CoNfIrM=YES\">Click here to delete extension group entry $extension_id</a><br><br><br>\n";
}
$ADD='32111'; # go to extension group modification below
}
######################
# ADD=511111 confirmation before deletion of user group record
######################
if ($ADD==511111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($user_group) < 2) or ($LOGdelete_user_groups < 1) )
{
echo "<br>USER GROUP NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>User_group be at least 2 characters in length\n";
}
else
{
echo "<br><B>USER GROUP DELETION CONFIRMATION: $user_group</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=611111&user_group=$user_group&CoNfIrM=YES\">Click here to delete user group $user_group</a><br><br><br>\n";
}
$ADD='311111'; # go to user group modification below
}
######################
# ADD=5111111 confirmation before deletion of script record
######################
if ($ADD==5111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($script_id) < 2) or ($LOGdelete_scripts < 1) )
{
echo "<br>SCRIPT NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Script_id must be at least 2 characters in length\n";
}
else
{
echo "<br><B>SCRIPT DELETION CONFIRMATION: $script_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=6111111&script_id=$script_id&CoNfIrM=YES\">Click here to delete script $script_id</a><br><br><br>\n";
}
$ADD='3111111'; # go to script modification below
}
######################
# ADD=51111111 confirmation before deletion of filter record
######################
if ($ADD==51111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($lead_filter_id) < 2) or ($LOGdelete_filters < 1) )
{
echo "<br>FILTER NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Filter ID must be at least 2 characters in length\n";
}
else
{
echo "<br><B>FILTER DELETION CONFIRMATION: $lead_filter_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=61111111&lead_filter_id=$lead_filter_id&CoNfIrM=YES\">Click here to delete filter $lead_filter_id</a><br><br><br>\n";
}
$ADD='31111111'; # go to filter modification below
}
######################
# ADD=511111111 confirmation before deletion of call time record
######################
if ($ADD==511111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) )
{
echo "<br>CALL TIME NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Call Time ID must be at least 2 characters in length\n";
}
else
{
echo "<br><B>CALL TIME DELETION CONFIRMATION: $call_time_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=611111111&call_time_id=$call_time_id&CoNfIrM=YES\">Click here to delete call time $call_time_id</a><br><br><br>\n";
}
$ADD='311111111'; # go to call time modification below
}
######################
# ADD=5111111111 confirmation before deletion of state call time record
######################
if ($ADD==5111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) )
{
echo "<br>STATE CALL TIME NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Call Time ID must be at least 2 characters in length\n";
}
else
{
echo "<br><B>STATE CALL TIME DELETION CONFIRMATION: $call_time_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=6111111111&call_time_id=$call_time_id&CoNfIrM=YES\">Click here to delete state call time $call_time_id</a><br><br><br>\n";
}
$ADD='3111111111'; # go to state call time modification below
}
######################
# ADD=531111111 confirmation before deletion of shift record
######################
if ($ADD==531111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($shift_id) < 2) or ($LOGdelete_call_times < 1) )
{
echo "<br>SHIFT NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Shift ID must be at least 2 characters in length\n";
}
else
{
echo "<br><B>SHIFT DELETION CONFIRMATION: $shift_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=631111111&shift_id=$shift_id&CoNfIrM=YES\">Click here to delete shift $shift_id</a><br><br><br>\n";
}
$ADD='331111111'; # go to call time modification below
}
######################
# ADD=51111111111 confirmation before deletion of phone record
######################
if ($ADD==51111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($LOGast_delete_phones < 1) )
{
echo "<br>PHONE NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Extension be at least 2 characters in length\n";
echo "<br>Server IP be at least 7 characters in length\n";
}
else
{
echo "<br><B>PHONE DELETION CONFIRMATION: $extension - $server_ip</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=61111111111&extension=$extension&server_ip=$server_ip&CoNfIrM=YES\">Click here to delete phone $extension - $server_ip</a><br><br><br>\n";
}
$ADD='31111111111'; # go to phone modification below
}
######################
# ADD=52111111111 confirmation before deletion of phone alias record
######################
if ($ADD==52111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($alias_id) < 1) or ($LOGast_delete_phones < 1) )
{
echo "<br>PHONE ALIAS NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Alias ID must be at least 2 characters in length\n";
}
else
{
echo "<br><B>PHONE ALIAS DELETION CONFIRMATION: $alias_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=62111111111&alias_id=$alias_id&CoNfIrM=YES\">Click here to delete phone alias $alias_id</a><br><br><br>\n";
}
$ADD='32111111111'; # go to phone alias modification below
}
######################
# ADD=53111111111 confirmation before deletion of group alias record
######################
if ($ADD==53111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($group_alias_id) < 1) or ($LOGast_delete_phones < 1) )
{
echo "<br>GROUP ALIAS NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Group Alias ID must be at least 2 characters in length\n";
}
else
{
echo "<br><B>GROUP ALIAS DELETION CONFIRMATION: $group_alias_id</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=63111111111&group_alias_id=$group_alias_id&CoNfIrM=YES\">Click here to delete group alias $group_alias_id</a><br><br><br>\n";
}
$ADD='33111111111'; # go to group alias modification below
}
######################
# ADD=511111111111 confirmation before deletion of server record
######################
if ($ADD==511111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($server_id) < 2) or (strlen($server_ip) < 7) or ($LOGast_delete_phones < 1) )
{
echo "<br>SERVER NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Server ID be at least 2 characters in length\n";
echo "<br>Server IP be at least 7 characters in length\n";
}
else
{
echo "<br><B>SERVER DELETION CONFIRMATION: $server_id - $server_ip</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=611111111111&server_id=$server_id&server_ip=$server_ip&CoNfIrM=YES\">Click here to delete phone $server_id - $server_ip</a><br><br><br>\n";
}
$ADD='311111111111'; # go to server modification below
}
######################
# ADD=531111111111 confirmation before deletion of conf template record
######################
if ($ADD==531111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (strlen($template_id) < 2)
{
echo "<br>CONF TEMPLATE NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Template ID be at least 2 characters in length\n";
}
else
{
echo "<br><B>CONF TEMPLATE DELETION CONFIRMATION: $template_id - $template_name</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=631111111111&template_id=$template_id&server_ip=$server_ip&CoNfIrM=YES\">Click here to delete conf template $template_id - $template_name</a><br><br><br>\n";
}
$ADD='331111111111'; # go to conf template modification below
}
######################
# ADD=541111111111 confirmation before deletion of carrier record
######################
if ($ADD==541111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (strlen($carrier_id) < 2)
{
echo "<br>CARRIER NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Carrier ID be at least 2 characters in length\n";
}
else
{
echo "<br><B>CARRIER DELETION CONFIRMATION: $carrier_id - $carrier_name</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=641111111111&carrier_id=$carrier_id&CoNfIrM=YES\">Click here to delete carrier $carrier_id - $carrier_name</a><br><br><br>\n";
}
$ADD='341111111111'; # go to carrier modification below
}
######################
# ADD=551111111111 confirmation before deletion of tts record
######################
if ($ADD==551111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (strlen($tts_id) < 2)
{
echo "<br>TTS ENTRY NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>TTS ID be at least 2 characters in length\n";
}
else
{
echo "<br><B>TTS ENTRY DELETION CONFIRMATION: $tts_id - $tts_name</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=651111111111&tts_id=$tts_id&CoNfIrM=YES\">Click here to delete tts entry $tts_id - $tts_name</a><br><br><br>\n";
}
$ADD='351111111111'; # go to tts entry modification below
}
######################
# ADD=561111111111 confirmation before deletion of music on hold record
######################
if ($ADD==561111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (strlen($moh_id) < 2)
{
echo "<br>MUSIC ON HOLD ENTRY NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>MOH ID be at least 2 characters in length\n";
}
else
{
echo "<br><B>MUSIC ON HOLD ENTRY DELETION CONFIRMATION: $moh_id - $moh_name</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=661111111111&moh_id=$moh_id&CoNfIrM=YES\">Click here to delete music on hold entry $moh_id - $moh_name</a><br><br><br>\n";
}
$ADD='361111111111'; # go to music on hold entry modification below
}
######################
# ADD=571111111111 confirmation before deletion of voicemail record
######################
if ($ADD==571111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (strlen($voicemail_id) < 2)
{
echo "<br>VOICEMAIL BOX NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Voicemail ID be at least 2 characters in length\n";
}
else
{
echo "<br><B>VOICEMAIL BOX DELETION CONFIRMATION: $voicemail_id - $fullname</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=671111111111&voicemail_id=$voicemail_id&CoNfIrM=YES\">Click here to delete voicemail box $voicemail_id - $fullname</a><br><br><br>\n";
}
$ADD='371111111111'; # go to voicemail entry modification below
}
######################
# ADD=581111111111 confirmation before deletion of screen label record
######################
if ($ADD==581111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (strlen($label_id) < 2)
{
echo "<br>SCREEN LABEL NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Label ID be at least 2 characters in length\n";
}
else
{
echo "<br><B>SCREEN LABEL DELETION CONFIRMATION: $label_id - $label_name</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=681111111111&label_id=$label_id&CoNfIrM=YES\">Click here to delete screen label $label_id - $label_name</a><br><br><br>\n";
}
$ADD='381111111111'; # go to screen label entry modification below
}
######################
# ADD=5111111111111 confirmation before deletion of conference record
######################
if ($ADD==5111111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($LOGast_delete_phones < 1) )
{
echo "<br>CONFERENCE NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Conference must be at least 2 characters in length\n";
echo "<br>Server IP be at least 7 characters in length\n";
}
else
{
echo "<br><B>CONFERENCE DELETION CONFIRMATION: $conf_exten - $server_ip</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=6111111111111&conf_exten=$conf_exten&server_ip=$server_ip&CoNfIrM=YES\">Click here to delete phone $conf_exten - $server_ip</a><br><br><br>\n";
}
$ADD='3111111111111'; # go to conference modification below
}
######################
# ADD=51111111111111 confirmation before deletion of vicidial conference record
######################
if ($ADD==51111111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($LOGast_delete_phones < 1) )
{
echo "<br>VICIDIAL CONFERENCE NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Conference must be at least 2 characters in length\n";
echo "<br>Server IP be at least 7 characters in length\n";
}
else
{
echo "<br><B>VICIDIAL CONFERENCE DELETION CONFIRMATION: $conf_exten - $server_ip</B>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=61111111111111&conf_exten=$conf_exten&server_ip=$server_ip&CoNfIrM=YES\">Click here to delete phone $conf_exten - $server_ip</a><br><br><br>\n";
}
$ADD='31111111111111'; # go to vicidial conference modification below
}
######################################################################################################
######################################################################################################
####### 6 series, delete records
######################################################################################################
######################################################################################################
######################
# ADD=6 delete user record
######################
if ($ADD==6)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) )
{
echo "<br>USER NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>User be at least 2 characters in length\n";
}
else
{
$stmtA="DELETE from vicidial_users where user='$user' limit 1;";
$rslt=mysql_query($stmtA, $link);
$stmt="DELETE from vicidial_campaign_agents where user='$user';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_inbound_group_agents where user='$user';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='DELETE', record_id='$user', event_code='ADMIN DELETE USER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>USER DELETION COMPLETED: $user</B>\n";
echo "<br><br>\n";
}
$ADD='0'; # go to user list
}
######################
# ADD=61 delete campaign record
######################
if ($ADD==61)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( ( strlen($campaign_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_campaigns < 1) )
{
echo "<br>CAMPAIGN NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Campaign_id be at least 2 characters in length\n";
}
else
{
$stmtA="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;";
$rslt=mysql_query($stmtA, $link);
$stmt="DELETE from vicidial_campaign_agents where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_campaign_statuses where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_campaign_hotkeys where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_callbacks where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_campaign_stats where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_lead_recycle where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_campaign_server_stats where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_server_trunks where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_pause_codes where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_xfer_presets where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_xfer_stats where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
echo "<br>REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($campaign_id)\n";
$stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>CAMPAIGN DELETION COMPLETED: $campaign_id</B>\n";
echo "<br><br>\n";
}
$ADD='10'; # go to campaigns list
}
######################
# ADD=62 Logout all agents from a campaign
######################
if ($ADD==62)
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (strlen($campaign_id) < 2)
{
echo "<br>AGENTS NOT LOGGED OUT OF CAMPAIGN - Please go back and look at the data you entered\n";
echo "<br>Campaign_id be at least 2 characters in length\n";
}
else
{
$now_date_epoch = date('U');
$inactive_epoch = ($now_date_epoch - 60);
$stmt = "SELECT user,campaign_id,UNIX_TIMESTAMP(last_update_time),extension from vicidial_live_agents where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "<BR>$stmt\n";}
$vla_ct = mysql_num_rows($rslt);
$k=0;
while ($vla_ct > $k)
{
$row=mysql_fetch_row($rslt);
$VLA_user[$k] = $row[0];
$VLA_campaign_id[$k] = $row[1];
$VLA_update_time[$k] = $row[2];
$VLA_extension[$k] = $row[3];
$k++;
}
$k=0;
while ($vla_ct > $k)
{
if ($VLA_update_time[$k] > $inactive_epoch)
{
$lead_active=0;
$stmt = "SELECT agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status,dead_epoch,dead_sec from vicidial_agent_log where user='$VLA_user[$k]' order by agent_log_id desc LIMIT 1;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "<BR>$stmt\n";}
$val_ct = mysql_num_rows($rslt);
if ($val_ct > 0)
{
$row=mysql_fetch_row($rslt);
$VAL_agent_log_id = $row[0];
$VAL_user = $row[1];
$VAL_server_ip = $row[2];
$VAL_event_time = $row[3];
$VAL_lead_id = $row[4];
$VAL_campaign_id = $row[5];
$VAL_pause_epoch = $row[6];
$VAL_pause_sec = $row[7];
$VAL_wait_epoch = $row[8];
$VAL_wait_sec = $row[9];
$VAL_talk_epoch = $row[10];
$VAL_talk_sec = $row[11];
$VAL_dispo_epoch = $row[12];
$VAL_dispo_sec = $row[13];
$VAL_status = $row[14];
$VAL_user_group = $row[15];
$VAL_comments = $row[16];
$VAL_sub_status = $row[17];
$VAL_dead_epoch = $row[18];
$VAL_dead_sec = $row[19];
if ($DB) {echo "\n<BR>VAL VALUES: $VAL_agent_log_id|$VAL_status|$VAL_lead_id\n";}
if ( ($VAL_wait_epoch < 1) or ( ($VAL_status == 'PAUSE') and ($VAL_dispo_epoch < 1) ) )
{
$VAL_pause_sec = ( ($now_date_epoch - $VAL_pause_epoch) + $VAL_pause_sec);
$stmt = "UPDATE vicidial_agent_log SET wait_epoch='$now_date_epoch', pause_sec='$VAL_pause_sec' where agent_log_id='$VAL_agent_log_id';";
}
else
{
if ($VAL_talk_epoch < 1)
{
$VAL_wait_sec = ( ($now_date_epoch - $VAL_wait_epoch) + $VAL_wait_sec);
$stmt = "UPDATE vicidial_agent_log SET talk_epoch='$now_date_epoch', wait_sec='$VAL_wait_sec' where agent_log_id='$VAL_agent_log_id';";
}
else
{
$lead_active++;
$status_update_SQL='';
if ( ( (strlen($VAL_status) < 1) or ($VAL_status == 'NULL') ) and ($VAL_lead_id > 0) )
{
$status_update_SQL = ", status='PU'";
$stmt="UPDATE vicidial_list SET status='PU' where lead_id='$VAL_lead_id';";
if ($DB) {echo "<BR>$stmt\n";}
$rslt=mysql_query($stmt, $link);
}
if ($VAL_dispo_epoch < 1)
{
$VAL_talk_sec = ($now_date_epoch - $VAL_talk_epoch);
$stmt = "UPDATE vicidial_agent_log SET dispo_epoch='$now_date_epoch', talk_sec='$VAL_talk_sec'$status_update_SQL where agent_log_id='$VAL_agent_log_id';";
}
else
{
if ($VAL_dispo_sec < 1)
{
$VAL_dispo_sec = ($now_date_epoch - $VAL_dispo_epoch);
$stmt = "UPDATE vicidial_agent_log SET dispo_sec='$VAL_dispo_sec' where agent_log_id='$VAL_agent_log_id';";
}
}
}
}
if ($DB) {echo "<BR>$stmt\n";}
$rslt=mysql_query($stmt, $link);
}
}
$stmt="DELETE from vicidial_live_agents where user='$VLA_user[$k]';";
if ($DB) {echo "<BR>$stmt\n";}
$rslt=mysql_query($stmt, $link);
if (strlen($VAL_user_group) < 1)
{
$stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user[$k]';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "<BR>$stmt\n";}
$val_ct = mysql_num_rows($rslt);
if ($val_ct > 0)
{
$row=mysql_fetch_row($rslt);
$VAL_user_group = $row[0];
}
}
$stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VLA_user[$k]','LOGOUT','$VLA_campaign_id[$k]','$SQLdate','$now_date_epoch','$VAL_user_group');";
if ($DB) {echo "<BR>$stmt\n";}
$rslt=mysql_query($stmt, $link);
#############################################
##### START QUEUEMETRICS LOGGING LOOKUP #####
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,queuemetrics_pe_phone_append FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "<BR>$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$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];
$queuemetrics_loginout = $row[6];
$queuemetrics_addmember_enabled = $row[7];
$queuemetrics_dispo_pause = $row[8];
$queuemetrics_pe_phone_append = $row[9];
}
##### END QUEUEMETRICS LOGGING LOOKUP #####
###########################################
if ($enable_queuemetrics_logging > 0)
{
$QM_LOGOFF = 'AGENTLOGOFF';
if ($queuemetrics_loginout=='CALLBACK')
{$QM_LOGOFF = 'AGENTCALLBACKLOGOFF';}
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
mysql_select_db("$queuemetrics_dbname", $linkB);
$agents='@agents';
$agent_logged_in='';
$time_logged_in='0';
$stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;";
$rsltB=mysql_query($stmtB, $linkB);
if ($DB) {echo "<BR>$stmtB\n";}
$qml_ct = mysql_num_rows($rsltB);
if ($qml_ct > 0)
{
$row=mysql_fetch_row($rsltB);
$agent_logged_in = $row[0];
$time_logged_in = $row[1];
$RAWtime_logged_in = $row[1];
$phone_logged_in = $row[2];
}
$time_logged_in = ($now_date_epoch - $time_logged_in);
if ($time_logged_in > 1000000) {$time_logged_in=1;}
if ($queuemetrics_loginout == 'NONE')
{
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='Agent/$VLA_user[$k]',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LOGOFF';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkB);
$affected_rows = mysql_affected_rows($linkB);
}
if ($queuemetrics_addmember_enabled > 0)
{
$queuemetrics_phone_environment='';
$stmt = "SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$VLA_campaign_id[$k]';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "<BR>$stmt\n";}
$cqpe_ct = mysql_num_rows($rslt);
if ($cqpe_ct > 0)
{
$row=mysql_fetch_row($rslt);
$queuemetrics_phone_environment = $row[0];
}
if ( ($time_logged_in < 1) or ($queuemetrics_loginout == 'NONE') )
{
$stmtB = "SELECT agent,time_id,data3 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb='PAUSEREASON' and data1='LOGIN' order by time_id desc limit 1;";
$rsltB=mysql_query($stmtB, $linkB);
if ($DB) {echo "<BR>$stmtB\n";}
$qml_ct = mysql_num_rows($rsltB);
if ($qml_ct > 0)
{
$row=mysql_fetch_row($rsltB);
$agent_logged_in = $row[0];
$time_logged_in = $row[1];
$RAWtime_logged_in = $row[1];
$phone_logged_in = $row[2];
}
$time_logged_in = ($now_date_epoch - $time_logged_in);
if ($time_logged_in > 1000000) {$time_logged_in=1;}
}
$stmt = "SELECT distinct queue FROM queue_log where time_id >= $RAWtime_logged_in and agent='$agent_logged_in' and verb IN('ADDMEMBER','ADDMEMBER2') and queue != '$VLA_campaign_id[$k]' order by time_id desc;";
$rslt=mysql_query($stmt, $linkB);
if ($DB) {echo "$stmt\n";}
$amq_conf_ct = mysql_num_rows($rslt);
$i=0;
while ($i < $amq_conf_ct)
{
$row=mysql_fetch_row($rslt);
$AMqueue[$i] = $row[0];
$i++;
}
### add the logged-in campaign as well
$AMqueue[$i] = $VLA_campaign_id[$k];
$i++;
$amq_conf_ct++;
$i=0;
while ($i < $amq_conf_ct)
{
$pe_append='';
if ( ($queuemetrics_pe_phone_append > 0) and (strlen($queuemetrics_phone_environment)>0) )
{
$qm_extension = explode('/',$phone_logged_in);
$pe_append = "-$qm_extension[1]";
}
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='$AMqueue[$i]',agent='$agent_logged_in',verb='REMOVEMEMBER',data1='$phone_logged_in',serverid='$queuemetrics_log_id',data4='$queuemetrics_phone_environment$pe_append';";
$rslt=mysql_query($stmt, $linkB);
$affected_rows = mysql_affected_rows($linkB);
$i++;
}
}
if ($queuemetrics_loginout != 'NONE')
{
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';";
if ($DB) {echo "<BR>$stmtB\n";}
$rsltB=mysql_query($stmtB, $linkB);
}
}
echo "<!-- Agent $VLA_user[$k] has been emergency logged out, make sure they close their web browser<BR> -->\n";
$k++;
}
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='LOGOUT', record_id='$campaign_id', event_code='ADMIN LOGOUT CAMPAIGN AGENTS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>AGENT LOGOUT COMPLETED: $campaign_id</B>\n";
echo "<br><br>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD='31'; # go to campaign modification below
}
######################
# ADD=63 Emergency VDAC Jam Clear
######################
if ($ADD==63)
{
if ($LOGmodify_campaigns==1)
{
if (eregi('IN',$stage))
{$group_id=$campaign_id;}
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (strlen($campaign_id) < 2)
{
echo "<br>VDAC NOT CLEARED FOR CAMPAIGN - Please go back and look at the data you entered\n";
echo "<br>Campaign_id be at least 2 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_auto_calls where status='LIVE' and campaign_id='$campaign_id' order by call_time limit 1;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN JAM', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>LAST VDAC RECORD CLEARED FOR CAMPAIGN: $campaign_id</B>\n";
echo "<br><br>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
# go to campaign modification below
if (eregi('IN',$stage))
{$ADD='3111';}
else
{$ADD='31';}
}
######################
# ADD=65 delete campaign lead recycle in the system
######################
if ($ADD==65)
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) )
{
echo "<br>CAMPAIGN LEAD RECYCLE NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>status must be between 1 and 6 characters in length\n";
echo "<br>attempt delay must be at least 120 seconds\n";
echo "<br>maximum attempts must be from 1 to 10\n";
}
else
{
echo "<br><B>CAMPAIGN LEAD RECYCLE DELETED: $campaign_id - $status - $attempt_delay</B>\n";
$stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_RECYCLE', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN LEAD RECYCLE', event_sql=\"$SQL_log\", event_notes='Status: $status';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$SUB=25;
$ADD=31; # go to campaign modification form below
}
######################
# ADD=66 delete auto alt dial status from the campaign
######################
if ($ADD==66)
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial_statuses LIKE \"% $status %\";";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] < 1)
{echo "<br>AUTO ALT DIAL STATUS NOT DELETED - this auto alt dial status is not in this campaign\n";}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) )
{
echo "<br>AUTO ALT DIAL STATUS NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>status must be between 1 and 6 characters in length\n";
}
else
{
echo "<br><B>AUTO ALT DIAL STATUS DELETED: $campaign_id - $status</B>\n";
$stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auto_alt_dial_statuses = eregi_replace(" $status "," ",$row[0]);
$stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_ALTDIALS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN ALT DIAL', event_sql=\"$SQL_log\", event_notes='Status: $status';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$SUB=26;
$ADD=31; # go to campaign modification form below
}
######################
# ADD=67 delete agent pause code in the system
######################
if ($ADD==67)
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) )
{
echo "<br>CAMPAIGN PAUSE CODE NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>pause code must be between 1 and 6 characters in length\n";
}
else
{
echo "<br><B>CAMPAIGN PAUSE CODE DELETED: $campaign_id - $pause_code</B>\n";
$stmt="DELETE FROM vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_PAUSECODES', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN PAUSE CODE', event_sql=\"$SQL_log\", event_notes='Status: $pause_code';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$SUB=27;
$ADD=31; # go to campaign modification form below
}
######################
# ADD=68 remove campaign dial status
######################
if ($ADD==68)
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\";";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] < 1)
{echo "<br>CAMPAIGN DIAL STATUS NOT REMOVED - this dial status is not selected for this campaign\n";}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) )
{
echo "<br>CAMPAIGN DIAL STATUS NOT REMOVED - Please go back and look at the data you entered\n";
echo "<br>status must be between 1 and 6 characters in length\n";
}
else
{
echo "<br><B>CAMPAIGN DIAL STATUS REMOVED: $campaign_id - $status</B>\n";
$stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$dial_statuses = eregi_replace(" $status "," ",$row[0]);
$stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_DIALSTATUSES', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN DIAL STATUS', event_sql=\"$SQL_log\", event_notes='Status: $status';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
#$SUB=28;
$ADD=31; # go to campaign modification form below
}
######################
# ADD=601 delete preset in the system
######################
if ($ADD==601)
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) )
{
echo "<br>CAMPAIGN PRESET NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>preset name must be between 1 and 40 characters in length\n";
}
else
{
echo "<br><B>CAMPAIGN PRESET DELETED: $campaign_id - $preset_name</B>\n";
$stmt="DELETE FROM vicidial_xfer_presets where campaign_id='$campaign_id' and preset_name='$preset_name';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE FROM vicidial_xfer_stats where campaign_id='$campaign_id' and preset_name='$preset_name';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_PRESETS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$SUB=201;
$ADD=31; # go to campaign modification form below
}
######################
# ADD=611 delete list record and all leads within it
######################
if ($ADD==611)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( ( strlen($list_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_lists < 1) )
{
echo "<br>LIST NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>List_id be at least 2 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;";
$rslt=mysql_query($stmt, $link);
echo "<br>REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($list_id)\n";
$stmt="DELETE from vicidial_hopper where list_id='$list_id';";
$rslt=mysql_query($stmt, $link);
echo "<br>REMOVING LIST LEADS FROM VICIDIAL_LIST TABLE\n";
$stmt="DELETE from vicidial_list where list_id='$list_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE LIST', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>LIST DELETION COMPLETED: $list_id</B>\n";
echo "<br><br>\n";
}
$ADD='100'; # go to lists list
}
######################
# ADD=6111 delete in-group record
######################
if ($ADD==6111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($group_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_ingroups < 1) )
{
echo "<br>IN-GROUP NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Group_id be at least 2 characters in length\n";
}
else
{
$stmtA="DELETE from vicidial_inbound_groups where group_id='$group_id' and group_id NOT IN('AGENTDIRECT') limit 1;";
$rslt=mysql_query($stmtA, $link);
$stmt="DELETE from vicidial_inbound_group_agents where group_id='$group_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_live_inbound_agents where group_id='$group_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_campaign_stats where campaign_id='$group_id';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$group_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='DELETE', record_id='$group_id', event_code='ADMIN DELETE INGROUP', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>IN-GROUP DELETION COMPLETED: $group_id</B>\n";
echo "<br><br>\n";
}
$ADD='1000'; # go to in-group list
}
######################
# ADD=6311 delete did record
######################
if ($ADD==6311)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($did_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_dids < 1) )
{
echo "<br>DID NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>did_id be at least 1 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' limit 1;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='DIDS', event_type='DELETE', record_id='$did_id', event_code='ADMIN DELETE DID', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>DID DELETION COMPLETED: $did_id</B>\n";
echo "<br><br>\n";
}
$ADD='1300'; # go to did list
}
######################
# ADD=6511 delete call menu record
######################
if ($ADD==6511)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($menu_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_dids < 1) )
{
echo "<br>CALL MENU NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>menu_id be at least 1 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_call_menu where menu_id='$menu_id' limit 1;";
$rslt=mysql_query($stmt, $link);
$stmtA="DELETE from vicidial_call_menu_options where menu_id='$menu_id' limit 17;";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtA";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLMENUS', event_type='DELETE', record_id='$menu_id', event_code='ADMIN DELETE CALL MENU', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>CALL MENU DELETION COMPLETED: $menu_id</B>\n";
echo "<br><br>\n";
}
$ADD='1500'; # go to call menu list
}
######################
# ADD=6711 delete filter phone group record
######################
if ($ADD==6711)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($filter_phone_group_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_dids < 1) )
{
echo "<br>FILTER PHONE GROUP NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>filter_phone_group_id be at least 1 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id' limit 1;";
$rslt=mysql_query($stmt, $link);
$stmtA="DELETE from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtA";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERPHONEGROUPS', event_type='DELETE', record_id='$filter_phone_group_id', event_code='ADMIN DELETE FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>FILTER PHONE GROUP DELETION COMPLETED: $filter_phone_group_id</B>\n";
echo "<br><br>\n";
}
$ADD='1700'; # go to filter phone group list
}
######################
# ADD=61111 delete remote agent record
######################
if ($ADD==61111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($remote_agent_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) )
{
echo "<br>REMOTE AGENT NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Remote_agent_id be at least 2 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_remote_agents where remote_agent_id='$remote_agent_id' limit 1;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='REMOTEAGENTS', event_type='DELETE', record_id='$remote_agent_id', event_code='ADMIN DELETE REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>REMOTE AGENT DELETION COMPLETED: $remote_agent_id</B>\n";
echo "<br><br>\n";
}
$ADD='10000'; # go to remote agents list
}
######################
# ADD=62111 delete extension group record
######################
if ($ADD==62111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($extension_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) )
{
echo "<br>EXTENSION GROUP ENTRY NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>extension_id be at least 1 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_extension_groups where extension_id='$extension_id' limit 1;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='DELETE', record_id='$extension_id', event_code='ADMIN DELETE EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>EXTENSION GROUP ENTRY DELETION COMPLETED: $extension_id</B>\n";
echo "<br><br>\n";
}
$ADD='12000'; # go to extension group list
}
######################
# ADD=611111 delete user group record
######################
if ($ADD==611111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($user_group) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_user_groups < 1) )
{
echo "<br>USER GROUP NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>User_group be at least 2 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='DELETE', record_id='$user_group', event_code='ADMIN DELETE USER GROUP', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>USER GROUP DELETION COMPLETED: $user_group</B>\n";
echo "<br><br>\n";
}
$ADD='100000'; # go to user group list
}
######################
# ADD=6111111 delete script record
######################
if ($ADD==6111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($script_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_scripts < 1) )
{
echo "<br>SCRIPT NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Script_id be at least 2 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SCRIPTS', event_type='DELETE', record_id='$script_id', event_code='ADMIN DELETE SCRIPT', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>SCRIPT DELETION COMPLETED: $script_id</B>\n";
echo "<br><br>\n";
}
$ADD='1000000'; # go to script list
}
######################
# ADD=61111111 delete filter record
######################
if ($ADD==61111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) )
{
echo "<br>FILTER NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Filter ID must be at least 2 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='FILTERS', event_type='DELETE', record_id='$lead_filter_id', event_code='ADMIN DELETE FILTERS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>FILTER DELETION COMPLETED: $lead_filter_id</B>\n";
echo "<br><br>\n";
}
$ADD='10000000'; # go to filter list
}
######################
# ADD=611111111 delete call times record
######################
if ($ADD==611111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) )
{
echo "<br>CALL TIME NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Call Time ID must be at least 2 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLTIMES', event_type='DELETE', record_id='$call_time_id', event_code='ADMIN DELETE CALL TIME', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>CALL TIME DELETION COMPLETED: $call_time_id</B>\n";
echo "<br><br>\n";
}
$ADD='100000000'; # go to call times list
}
######################
# ADD=6111111111 delete state call times record
######################
if ($ADD==6111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) )
{
echo "<br>STATE CALL TIME NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Call Time ID must be at least 2 characters in length\n";
}
else
{
$stmtA="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;";
$rslt=mysql_query($stmtA, $link);
$stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;";
$rslt=mysql_query($stmt, $link);
$sct_to_print = mysql_num_rows($rslt);
$sct_list='';
$o=0;
while ($sct_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$sct_ids[$o] = "$rowx[0]";
$sct_states[$o] = "$rowx[1]";
$o++;
}
$o=0;
while ($sct_to_print > $o)
{
$sct_states[$o] = eregi_replace("\|$call_time_id\|",'|',$sct_states[$o]);
$stmt="UPDATE vicidial_call_times set ct_state_call_times='$sct_states[$o]' where call_time_id='$sct_ids[$o]';";
$rslt=mysql_query($stmt, $link);
echo "$stmt\n";
echo "State Rule Removed: $sct_ids[$o]<BR>\n";
$o++;
}
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLTIMES', event_type='DELETE', record_id='$call_time_id', event_code='ADMIN DELETE STATE CALL TIME', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>STATE CALL TIME DELETION COMPLETED: $call_time_id</B>\n";
echo "<br><br>\n";
}
$ADD='1000000000'; # go to call times list
}
######################
# ADD=631111111 delete shift record
######################
if ($ADD==631111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($shift_id) < 2) or ($LOGdelete_call_times < 1) )
{
echo "<br>SHIFT NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Shift ID must be at least 2 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_shifts where shift_id='$shift_id' limit 1;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SHIFTS', event_type='DELETE', record_id='$shift_id', event_code='ADMIN DELETE SHIFT', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>SHIFT DELETION COMPLETED: $shift_id</B>\n";
echo "<br><br>\n";
}
$ADD='130000000'; # go to shifts list
}
######################
# ADD=61111111111 delete phone record
######################
if ($ADD==61111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) )
{
echo "<br>PHONE NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Extension be at least 2 characters in length\n";
echo "<br>Server IP be at least 7 characters in length\n";
}
else
{
$stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONES', event_type='DELETE', record_id='$extension', event_code='ADMIN DELETE PHONE', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>PHONE DELETION COMPLETED: $extension - $server_ip</B>\n";
echo "<br><br>\n";
}
$ADD='10000000000'; # go to phone list
}
######################
# ADD=62111111111 delete phone alias record
######################
if ($ADD==62111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($alias_id) < 2) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) )
{
echo "<br>PHONE ALIAS NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Alias ID must be at least 2 characters in length\n";
}
else
{
$stmt="DELETE from phones_alias where alias_id='$alias_id' limit 1;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONEALIASES', event_type='DELETE', record_id='$alias_id', event_code='ADMIN DELETE PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>PHONE ALIAS DELETION COMPLETED: $alias_id</B>\n";
echo "<br><br>\n";
}
$ADD='12000000000'; # go to phone alias list
}
######################
# ADD=63111111111 delete group alias record
######################
if ($ADD==63111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($group_alias_id) < 2) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) )
{
echo "<br>GROUP ALIAS NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Group Alias ID must be at least 2 characters in length\n";
}
else
{
$stmt="DELETE from groups_alias where group_alias_id='$group_alias_id' limit 1;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='GROUPALIASES', event_type='DELETE', record_id='$group_alias_id', event_code='ADMIN DELETE GROUP ALIAS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>GROUP ALIAS DELETION COMPLETED: $group_alias_id</B>\n";
echo "<br><br>\n";
}
$ADD='13000000000'; # go to group alias list
}
######################
# ADD=611111111111 delete server record
######################
if ($ADD==611111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($server_id) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) )
{
echo "<br>SERVER NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Server ID be at least 2 characters in length\n";
echo "<br>Server IP be at least 7 characters in length\n";
}
else
{
$stmt="DELETE from servers where server_id='$server_id' and server_ip='$server_ip' limit 1;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SERVERS', event_type='DELETE', record_id='$server_id', event_code='ADMIN DELETE SERVER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>SERVER DELETION COMPLETED: $server_id - $server_ip</B>\n";
echo "<br><br>\n";
}
$ADD='100000000000'; # go to server list
}
######################
# ADD=621111111111 delete vicidial server trunk record in the system
######################
if ($ADD==621111111111)
{
if ($LOGmodify_servers==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) )
{
echo "<br>VICIDIAL SERVER TRUNK RECORD NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>campaign must be between 3 and 8 characters in length\n";
echo "<br>server_ip delay must be at least 7 characters\n";
}
else
{
echo "<br><B>VICIDIAL SERVER TRUNK RECORD DELETED: $campaign_id - $server_ip</B>\n";
$stmt="DELETE FROM vicidial_server_trunks where campaign_id='$campaign_id' and server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='SERVERTRUNKS', event_type='DELETE', record_id='$server_ip', event_code='ADMIN DELETE SERVER TRUNK', event_sql=\"$SQL_log\", event_notes='Campaign: $campaign_id';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=311111111111; # go to server modification form below
}
######################
# ADD=631111111111 delete conf template record
######################
if ($ADD==631111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($template_id) < 2) or ($CoNfIrM != 'YES') )
{
echo "<br>CONF TEMPLATE NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Template ID be at least 2 characters in length\n";
}
else
{
$stmt="UPDATE phones SET template_id='' where template_id='$template_id';";
$rslt=mysql_query($stmt, $link);
$stmt="UPDATE vicidial_server_carriers SET template_id='' where template_id='$template_id';";
$rslt=mysql_query($stmt, $link);
$stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';";
$rslt=mysql_query($stmt, $link);
$stmt="DELETE from vicidial_conf_templates where template_id='$template_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONFTEMPLATES', event_type='DELETE', record_id='$template_id', event_code='ADMIN DELETE CONF TEMPLATE', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>CONF TEMPLATE DELETION COMPLETED: $server_id - $server_ip</B>\n";
echo "<br><br>\n";
}
$ADD='130000000000'; # go to conf template list
}
######################
# ADD=641111111111 delete carrier record
######################
if ($ADD==641111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($carrier_id) < 2) or ($CoNfIrM != 'YES') )
{
echo "<br>CARRIER NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Carrier ID be at least 2 characters in length\n";
}
else
{
$stmt="SELECT server_ip from vicidial_server_carriers where carrier_id='$carrier_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$CARRIERserver_ip = $row[0];
$stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id';";
$rslt=mysql_query($stmt, $link);
$stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$CARRIERserver_ip';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CARRIERS', event_type='DELETE', record_id='$carrier_id', event_code='ADMIN DELETE CARRIER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>CARRIER DELETION COMPLETED: $carrier_id</B>\n";
echo "<br><br>\n";
}
$ADD='140000000000'; # go to carrier list
}
######################
# ADD=651111111111 delete tts record
######################
if ($ADD==651111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($tts_id) < 2) or ($CoNfIrM != 'YES') )
{
echo "<br>TTS ENTRY NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>TTS ID be at least 2 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_tts_prompts where tts_id='$tts_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TTS', event_type='DELETE', record_id='$tts_id', event_code='ADMIN DELETE TTS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>TTS DELETION COMPLETED: $tts_id</B>\n";
echo "<br><br>\n";
}
$ADD='150000000000'; # go to tts entry list
}
######################
# ADD=661111111111 delete music on hold record
######################
if ($ADD==661111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($moh_id) < 2) or ($CoNfIrM != 'YES') )
{
echo "<br>MUSIC ON HOLD ENTRY NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>MOH ID be at least 2 characters in length\n";
}
else
{
$stmt="UPDATE vicidial_music_on_hold SET remove='Y' where moh_id='$moh_id';";
$rslt=mysql_query($stmt, $link);
$stmtA="DELETE from vicidial_music_on_hold_files where moh_id='$moh_id';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='MOH', event_type='DELETE', record_id='$moh_id', event_code='ADMIN DELETE MOH', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>MUSIC ON HOLD DELETION COMPLETED: $moh_id</B>\n";
echo "<br><br>\n";
}
$ADD='160000000000'; # go to music on hold entry list
}
######################
# ADD=671111111111 delete voicemail record
######################
if ($ADD==671111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($voicemail_id) < 2) or ($CoNfIrM != 'YES') )
{
echo "<br>VOICEMAIL BOX NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Voicemail ID be at least 2 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_voicemail where voicemail_id='$voicemail_id';";
$rslt=mysql_query($stmt, $link);
$stmt="SELECT active_voicemail_server from system_settings;";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$active_voicemail_server = $row[0];
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$active_voicemail_server';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='VOICEMAIL', event_type='DELETE', record_id='$voicemail_id', event_code='ADMIN DELETE VOICEMAIL', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>VOICEMAIL BOX DELETION COMPLETED: $voicemail_id</B>\n";
echo "<br><br>\n";
}
$ADD='170000000000'; # go to voicemail entry list
}
######################
# ADD=681111111111 delete screen labels record
######################
if ($ADD==681111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($label_id) < 2) or ($CoNfIrM != 'YES') )
{
echo "<br>SCREEN LABEL NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Label ID be at least 2 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_screen_labels where label_id='$label_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LABEL', event_type='DELETE', record_id='$label_id', event_code='ADMIN DELETE LABEL', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>SCREEN LABEL DELETION COMPLETED: $label_id</B>\n";
echo "<br><br>\n";
}
$ADD='180000000000'; # go to screen labels entry list
}
######################
# ADD=6111111111111 delete conference record
######################
if ($ADD==6111111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) )
{
echo "<br>CONFERENCE NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Conference be at least 2 characters in length\n";
echo "<br>Server IP be at least 7 characters in length\n";
}
else
{
$stmt="DELETE from conferences where conf_exten='$conf_exten' and server_ip='$server_ip' limit 1;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONFERENCES', event_type='DELETE', record_id='$conf_exten', event_code='ADMIN DELETE CONFERENCE', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>CONFERENCE DELETION COMPLETED: $conf_exten - $server_ip</B>\n";
echo "<br><br>\n";
}
$ADD='1000000000000'; # go to conference list
}
######################
# ADD=61111111111111 delete vicidial conference record
######################
if ($ADD==61111111111111)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) )
{
echo "<br>VICIDIAL CONFERENCE NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>Conference be at least 2 characters in length\n";
echo "<br>Server IP be at least 7 characters in length\n";
}
else
{
$stmt="DELETE from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip' limit 1;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CONFERENCES', event_type='DELETE', record_id='$conf_exten', event_code='ADMIN DELETE CONFERENCE', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<br><B>VICIDIAL CONFERENCE DELETION COMPLETED: $conf_exten - $server_ip</B>\n";
echo "<br><br>\n";
}
$ADD='10000000000000'; # go to vicidial conference list
}
######################################################################################################
######################################################################################################
####### 3 series, record modification forms
######################################################################################################
######################################################################################################
######################
# ADD=3 modify user info in the system
######################
if ($ADD==3)
{
if ($LOGmodify_users==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=3&user=$user";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override from vicidial_users where user='$user';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$user_id = $row[0];
$user = $row[1];
$pass = $row[2];
$full_name = $row[3];
$user_level = $row[4];
$user_group = $row[5];
$phone_login = $row[6];
$phone_pass = $row[7];
$delete_users = $row[8];
$delete_user_groups = $row[9];
$delete_lists = $row[10];
$delete_campaigns = $row[11];
$delete_ingroups = $row[12];
$delete_remote_agents = $row[13];
$load_leads = $row[14];
$campaign_detail = $row[15];
$ast_admin_access = $row[16];
$ast_delete_phones = $row[17];
$delete_scripts = $row[18];
$modify_leads = $row[19];
$hotkeys_active = $row[20];
$change_agent_campaign =$row[21];
$agent_choose_ingroups =$row[22];
$scheduled_callbacks = $row[24];
$agentonly_callbacks = $row[25];
$agentcall_manual = $row[26];
$vicidial_recording = $row[27];
$vicidial_transfers = $row[28];
$delete_filters = $row[29];
$alter_agent_interface_options =$row[30];
$closer_default_blended = $row[31];
$delete_call_times = $row[32];
$modify_call_times = $row[33];
$modify_users = $row[34];
$modify_campaigns = $row[35];
$modify_lists = $row[36];
$modify_scripts = $row[37];
$modify_filters = $row[38];
$modify_ingroups = $row[39];
$modify_usergroups = $row[40];
$modify_remoteagents = $row[41];
$modify_servers = $row[42];
$view_reports = $row[43];
$vicidial_recording_override = $row[44];
$alter_custdata_override = $row[45];
$qc_enabled = $row[46];
$qc_user_level = $row[47];
$qc_pass = $row[48];
$qc_finish = $row[49];
$qc_commit = $row[50];
$add_timeclock_log = $row[51];
$modify_timeclock_log = $row[52];
$delete_timeclock_log = $row[53];
$alter_custphone_override = $row[54];
$vdc_agent_api_access = $row[55];
$modify_inbound_dids = $row[56];
$delete_inbound_dids = $row[57];
$active = $row[58];
$alert_enabled = $row[59];
$download_lists = $row[60];
$agent_shift_enforcement_override = $row[61];
$manager_shift_enforcement_override = $row[62];
$export_reports = $row[64];
$delete_from_dnc = $row[65];
$email = $row[66];
$user_code = $row[67];
$territory = $row[68];
$allow_alerts = $row[69];
$agent_choose_territories = $row[70];
$user_custom_one = $row[71];
$user_custom_two = $row[72];
$user_custom_three = $row[73];
$user_custom_four = $row[74];
$user_custom_five = $row[75];
$voicemail_id = $row[76];
$agent_call_log_view_override = $row[77];
$callcard_admin = $row[78];
$agent_choose_blended = $row[79];
$realtime_block_user_info = $row[80];
$custom_fields_modify = $row[81];
$force_change_password = $row[82];
$agent_lead_search_override = $row[83];
if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) )
{
echo "<br>You do not have permissions to modify this user: $user\n";
}
else
{
echo "<br>MODIFY A USERS RECORD: $user<form action=$PHP_SELF method=POST>\n";
if ($LOGuser_level > 8)
{echo "<input type=hidden name=ADD value=4A>\n";}
else
{
if ($LOGalter_agent_interface == "1")
{echo "<input type=hidden name=ADD value=4B>\n";}
else
{echo "<input type=hidden name=ADD value=4>\n";}
}
if ($SScustom_fields_enabled < 1)
{
echo "<input type=hidden name=custom_fields_modify value=\"$custom_fields_modify\">\n";
}
echo "<input type=hidden name=user value=\"$user\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>User Number: </td><td align=left><b>$user</b>$NWB#vicidial_users-user$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Password: </td><td align=left style=\"display:table-cell; vertical-align:middle;\"><input type=text id=reg_pass name=pass size=20 maxlength=20 value=\"$pass\" onkeyup=\"return pwdChanged('reg_pass','reg_pass_img');\">$NWB#vicidial_users-pass$NWE &nbsp; &nbsp; Strength: <IMG id=reg_pass_img src='images/pixel.gif' style=\"vertical-align:middle;\" onLoad=\"return pwdChanged('reg_pass','reg_pass_img');\"></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Force Change Password: </td><td align=left><select size=1 name=force_change_password><option>Y</option><option>N</option><option SELECTED>$force_change_password</option></select>$NWB#vicidial_users-force_change_password$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Full Name: </td><td align=left><input type=text name=full_name size=30 maxlength=30 value=\"$full_name\">$NWB#vicidial_users-full_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>User Level: </td><td align=left><select size=1 name=user_level>";
$h=1;
while ($h<=$LOGuser_level)
{
echo "<option>$h</option>";
$h++;
}
echo "<option SELECTED>$user_level</option></select>$NWB#vicidial_users-user_level$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><A HREF=\"$PHP_SELF?ADD=311111&user_group=$user_group\">User Group</A>: </td><td align=left><select size=1 name=user_group>\n";
$stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group";
$rslt=mysql_query($stmt, $link);
$Ugroups_to_print = mysql_num_rows($rslt);
$Ugroups_list='';
$o=0;
while ($Ugroups_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$Ugroups_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "$Ugroups_list";
echo "<option SELECTED>$user_group</option>\n";
echo "</select>$NWB#vicidial_users-user_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Login: </td><td align=left><input type=text name=phone_login size=20 maxlength=20 value=\"$phone_login\">$NWB#vicidial_users-phone_login$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Pass: </td><td align=left><input type=text name=phone_pass size=20 maxlength=20 value=\"$phone_pass\">$NWB#vicidial_users-phone_pass$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$active</option></select>$NWB#vicidial_users-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Voicemail ID: </td><td align=left><input type=text name=voicemail_id id=voicemail_id size=12 maxlength=10 value=\"$voicemail_id\"> <a href=\"javascript:launch_vm_chooser('voicemail_id','vm',100);\">voicemail chooser</a>$NWB#vicidial_users-voicemail_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email: </td><td align=left><input type=text name=email size=40 maxlength=100 value=\"$email\">$NWB#vicidial_users-optional$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>User Code: </td><td align=left><input type=text name=user_code size=40 maxlength=100 value=\"$user_code\">$NWB#vicidial_users-optional$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Main Territory: </td><td align=left><input type=text name=territory size=40 maxlength=100 value=\"$territory\">$NWB#vicidial_users-optional$NWE</td></tr>\n";
if ($SSuser_territories_active > 0)
{
$stmt="SELECT vut.territory,vt.territory_description from vicidial_user_territories vut,vicidial_territories vt where user='$user' and vut.territory=vt.territory;";
$rslt=mysql_query($stmt, $link);
$Uterrs_to_print = mysql_num_rows($rslt);
$Uterrs_list='';
$o=0;
while ($Uterrs_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$Uterrs_list .= "$rowx[0] - $rowx[1]<BR>\n";
$o++;
}
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"user_territories.php\">User Territories</a>: </td><td align=left>$Uterrs_list</tr>\n";
}
if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "1") )
{
echo "<tr bgcolor=#015B91><td colspan=2 align=center><font color=white><B>AGENT INTERFACE OPTIONS:</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Choose Ingroups: </td><td align=left><select size=1 name=agent_choose_ingroups><option>0</option><option>1</option><option SELECTED>$agent_choose_ingroups</option></select>$NWB#vicidial_users-agent_choose_ingroups$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Choose Blended: </td><td align=left><select size=1 name=agent_choose_blended><option>0</option><option>1</option><option SELECTED>$agent_choose_blended</option></select>$NWB#vicidial_users-agent_choose_blended$NWE</td></tr>\n";
if ($SSuser_territories_active > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Choose Territories: </td><td align=left><select size=1 name=agent_choose_territories><option>0</option><option>1</option><option SELECTED>$agent_choose_territories</option></select>$NWB#vicidial_users-agent_choose_territories$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Hot Keys Active: </td><td align=left><select size=1 name=hotkeys_active><option>0</option><option>1</option><option SELECTED>$hotkeys_active</option></select>$NWB#vicidial_users-hotkeys_active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Scheduled Callbacks: </td><td align=left><select size=1 name=scheduled_callbacks><option>0</option><option>1</option><option SELECTED>$scheduled_callbacks</option></select>$NWB#vicidial_users-scheduled_callbacks$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent-Only Callbacks: </td><td align=left><select size=1 name=agentonly_callbacks><option>0</option><option>1</option><option SELECTED>$agentonly_callbacks</option></select>$NWB#vicidial_users-agentonly_callbacks$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Call Manual: </td><td align=left><select size=1 name=agentcall_manual><option>0</option><option>1</option><option SELECTED>$agentcall_manual</option></select>$NWB#vicidial_users-agentcall_manual$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Vicidial Recording: </td><td align=left><select size=1 name=vicidial_recording><option>0</option><option>1</option><option SELECTED>$vicidial_recording</option></select>$NWB#vicidial_users-vicidial_recording$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Vicidial Transfers: </td><td align=left><select size=1 name=vicidial_transfers><option>0</option><option>1</option><option SELECTED>$vicidial_transfers</option></select>$NWB#vicidial_users-vicidial_transfers$NWE</td></tr>\n";
if ($SSoutbound_autodial_active > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Closer Default Blended: </td><td align=left><select size=1 name=closer_default_blended><option>0</option><option>1</option><option SELECTED>$closer_default_blended</option></select>$NWB#vicidial_users-closer_default_blended$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>VICIDIAL Recording Override: </td><td align=left><select size=1 name=vicidial_recording_override><option>DISABLED</option><option>NEVER</option><option>ONDEMAND</option><option>ALLCALLS</option><option>ALLFORCE</option><option SELECTED>$vicidial_recording_override</option></select>$NWB#vicidial_users-vicidial_recording_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Alter Customer Data Override: </td><td align=left><select size=1 name=alter_custdata_override><option>NOT_ACTIVE</option><option>ALLOW_ALTER</option><option SELECTED>$alter_custdata_override</option></select>$NWB#vicidial_users-alter_custdata_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Alter Customer Phone Override: </td><td align=left><select size=1 name=alter_custphone_override><option>NOT_ACTIVE</option><option>ALLOW_ALTER</option><option SELECTED>$alter_custphone_override</option></select>$NWB#vicidial_users-alter_custphone_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Shift Enforcement Override: </td><td align=left><select size=1 name=agent_shift_enforcement_override><option>DISABLED</option><option>OFF</option><option>START</option><option>ALL</option><option SELECTED>$agent_shift_enforcement_override</option></select>$NWB#vicidial_users-agent_shift_enforcement_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Call Log View Override: </td><td align=left><select size=1 name=agent_call_log_view_override><option>DISABLED</option><option>Y</option><option>N</option><option SELECTED>$agent_call_log_view_override</option></select>$NWB#vicidial_users-agent_call_log_view_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Lead Search Override: </td><td align=left><select size=1 name=agent_lead_search><option>DISABLED</option><option>ENABLED</option><option>NOT_ACTIVE</option><option SELECTED>$agent_lead_search_override</option></select>$NWB#vicidial_users-agent_lead_search_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Alert Enabled: </td><td align=left>$alert_enabled $NWB#vicidial_users-alert_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Allow Alerts: </td><td align=left><select size=1 name=allow_alerts><option>0</option><option>1</option><option SELECTED>$allow_alerts</option></select>$NWB#vicidial_users-allow_alerts$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>Campaign Ranks: $NWB#vicidial_users-campaign_ranks$NWE<BR>\n";
echo "<table border=0>\n";
echo "$RANKcampaigns_list";
echo "</table>\n";
echo "</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>Inbound Groups: $NWB#vicidial_users-closer_campaigns$NWE<BR>\n";
echo "<table border=0>\n";
echo "$RANKgroups_list";
echo "</table>\n";
echo "</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Custom 1: </td><td align=left><input type=text name=custom_one size=50 maxlength=100 value=\"$user_custom_one\">$NWB#vicidial_users-custom_one$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Custom 2: </td><td align=left><input type=text name=custom_two size=50 maxlength=100 value=\"$user_custom_two\">$NWB#vicidial_users-custom_two$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Custom 3: </td><td align=left><input type=text name=custom_three size=50 maxlength=100 value=\"$user_custom_three\">$NWB#vicidial_users-custom_three$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Custom 4: </td><td align=left><input type=text name=custom_four size=50 maxlength=100 value=\"$user_custom_four\">$NWB#vicidial_users-custom_four$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Custom 5: </td><td align=left><input type=text name=custom_five size=50 maxlength=100 value=\"$user_custom_five\">$NWB#vicidial_users-custom_five$NWE</td></tr>\n";
if ($SSqc_features_active > 0)
{
echo "<tr bgcolor=#9BB9FB><td align=right>QC Enabled: </td><td align=left><select size=1 name=qc_enabled><option>0</option><option>1</option><option SELECTED>$qc_enabled</option></select>$NWB#vicidial_users-qc_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>QC User Level: </td><td align=left><select size=1 name=qc_user_level><option value=1>1 - Modify Nothing</option><option value=2>2 - Modify Nothing Except Status</option><option value=3>3 - Modify All Fields</option><option value=4>4 - Verify First Round of QC</option><option value=5>5 - View QC Statistics</option><option value=6>6 - Ability to Modify FINISHed records</option><option value=7>7 - Manager Level</option><option SELECTED>$qc_user_level</option></select>$NWB#vicidial_users-qc_user_level$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>QC Pass: </td><td align=left><select size=1 name=qc_pass><option>0</option><option>1</option><option SELECTED>$qc_pass</option></select>$NWB#vicidial_users-qc_pass$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>QC Finish: </td><td align=left><select size=1 name=qc_finish><option>0</option><option>1</option><option SELECTED>$qc_finish</option></select>$NWB#vicidial_users-qc_finish$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>QC Commit: </td><td align=left><select size=1 name=qc_commit><option>0</option><option>1</option><option SELECTED>$qc_commit</option></select>$NWB#vicidial_users-qc_commit$NWE</td></tr>\n";
}
}
if ($LOGuser_level > 8)
{
echo "<tr bgcolor=#015B91><td colspan=2 align=center><font color=white><B>ADMIN REPORT OPTIONS:</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>Realtime Block User Info: </td><td align=left><select size=1 name=realtime_block_user_info><option>0</option><option>1</option><option SELECTED>$realtime_block_user_info</option></select>$NWB#vicidial_users-realtime_block_user_info$NWE</td></tr>\n";
echo "<tr bgcolor=#015B91><td colspan=2 align=center><font color=white><B>ADMIN INTERFACE OPTIONS:</td></tr>\n";
#9BB9FB
#B9CBFD
echo "<tr bgcolor=#9BB9FB><td align=right>View Reports: </td><td align=left><select size=1 name=view_reports><option>0</option><option>1</option><option SELECTED>$view_reports</option></select>$NWB#vicidial_users-view_reports$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Alter Agent Interface Options: </td><td align=left><select size=1 name=alter_agent_interface_options><option>0</option><option>1</option><option SELECTED>$alter_agent_interface_options</option></select>$NWB#vicidial_users-alter_agent_interface_options$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Modify Users: </td><td align=left><select size=1 name=modify_users><option>0</option><option>1</option><option SELECTED>$modify_users</option></select>$NWB#vicidial_users-modify_sections$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Change Agent Campaign: </td><td align=left><select size=1 name=change_agent_campaign><option>0</option><option>1</option><option SELECTED>$change_agent_campaign</option></select>$NWB#vicidial_users-change_agent_campaign$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Delete Users: </td><td align=left><select size=1 name=delete_users><option>0</option><option>1</option><option SELECTED>$delete_users</option></select>$NWB#vicidial_users-delete_users$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>Modify User Groups: </td><td align=left><select size=1 name=modify_usergroups><option>0</option><option>1</option><option SELECTED>$modify_usergroups</option></select>$NWB#vicidial_users-modify_sections$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>Delete User Groups: </td><td align=left><select size=1 name=delete_user_groups><option>0</option><option>1</option><option SELECTED>$delete_user_groups</option></select>$NWB#vicidial_users-delete_user_groups$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Modify Lists: </td><td align=left><select size=1 name=modify_lists><option>0</option><option>1</option><option SELECTED>$modify_lists</option></select>$NWB#vicidial_users-modify_sections$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Delete Lists: </td><td align=left><select size=1 name=delete_lists><option>0</option><option>1</option><option SELECTED>$delete_lists</option></select>$NWB#vicidial_users-delete_lists$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Load Leads: </td><td align=left><select size=1 name=load_leads><option>0</option><option>1</option><option SELECTED>$load_leads</option></select>$NWB#vicidial_users-load_leads$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Modify Leads: </td><td align=left><select size=1 name=modify_leads><option>0</option><option>1</option><option SELECTED>$modify_leads</option></select>$NWB#vicidial_users-modify_leads$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Download Lists: </td><td align=left><select size=1 name=download_lists><option>0</option><option>1</option><option SELECTED>$download_lists</option></select>$NWB#vicidial_users-modify_leads$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Export Reports: </td><td align=left><select size=1 name=export_reports><option>0</option><option>1</option><option SELECTED>$export_reports</option></select>$NWB#vicidial_users-export_reports$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Delete From DNC Lists: </td><td align=left><select size=1 name=delete_from_dnc><option>0</option><option>1</option><option SELECTED>$delete_from_dnc</option></select>$NWB#vicidial_users-delete_from_dnc$NWE</td></tr>\n";
if ($SScustom_fields_enabled > 0)
{
echo "<tr bgcolor=#B9CBFD><td align=right>Custom Fields Modify: </td><td align=left><select size=1 name=custom_fields_modify><option>0</option><option>1</option><option SELECTED>$custom_fields_modify</option></select>$NWB#vicidial_users-custom_fields_modify$NWE</td></tr>\n";
}
echo "<tr bgcolor=#9BB9FB><td align=right>Modify Campaigns: </td><td align=left><select size=1 name=modify_campaigns><option>0</option><option>1</option><option SELECTED>$modify_campaigns</option></select>$NWB#vicidial_users-modify_sections$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>Campaign Detail: </td><td align=left><select size=1 name=campaign_detail><option>0</option><option>1</option><option SELECTED>$campaign_detail</option></select>$NWB#vicidial_users-campaign_detail$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>Delete Campaigns: </td><td align=left><select size=1 name=delete_campaigns><option>0</option><option>1</option><option SELECTED>$delete_campaigns</option></select>$NWB#vicidial_users-delete_campaigns$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Modify In-Groups: </td><td align=left><select size=1 name=modify_ingroups><option>0</option><option>1</option><option SELECTED>$modify_ingroups</option></select>$NWB#vicidial_users-modify_sections$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Delete In-Groups: </td><td align=left><select size=1 name=delete_ingroups><option>0</option><option>1</option><option SELECTED>$delete_ingroups</option></select>$NWB#vicidial_users-delete_ingroups$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Modify DIDs: </td><td align=left><select size=1 name=modify_inbound_dids><option>0</option><option>1</option><option SELECTED>$modify_inbound_dids</option></select>$NWB#vicidial_users-modify_sections$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Delete DIDs: </td><td align=left><select size=1 name=delete_inbound_dids><option>0</option><option>1</option><option SELECTED>$delete_inbound_dids</option></select>$NWB#vicidial_users-delete_ingroups$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>Modify Remote Agents: </td><td align=left><select size=1 name=modify_remoteagents><option>0</option><option>1</option><option SELECTED>$modify_remoteagents</option></select>$NWB#vicidial_users-modify_sections$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>Delete Remote Agents: </td><td align=left><select size=1 name=delete_remote_agents><option>0</option><option>1</option><option SELECTED>$delete_remote_agents</option></select>$NWB#vicidial_users-delete_remote_agents$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Modify Scripts: </td><td align=left><select size=1 name=modify_scripts><option>0</option><option>1</option><option SELECTED>$modify_scripts</option></select>$NWB#vicidial_users-modify_sections$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Delete Scripts: </td><td align=left><select size=1 name=delete_scripts><option>0</option><option>1</option><option SELECTED>$delete_scripts</option></select>$NWB#vicidial_users-delete_scripts$NWE</td></tr>\n";
if ($SSoutbound_autodial_active > 0)
{
echo "<tr bgcolor=#9BB9FB><td align=right>Modify Filters: </td><td align=left><select size=1 name=modify_filters><option>0</option><option>1</option><option SELECTED>$modify_filters</option></select>$NWB#vicidial_users-modify_sections$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>Delete Filters: </td><td align=left><select size=1 name=delete_filters><option>0</option><option>1</option><option SELECTED>$delete_filters</option></select>$NWB#vicidial_users-delete_filters$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B9CBFD><td align=right>AGC Admin Access: </td><td align=left><select size=1 name=ast_admin_access><option>0</option><option>1</option><option SELECTED>$ast_admin_access</option></select>$NWB#vicidial_users-ast_admin_access$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>AGC Delete Phones: </td><td align=left><select size=1 name=ast_delete_phones><option>0</option><option>1</option><option SELECTED>$ast_delete_phones</option></select>$NWB#vicidial_users-ast_delete_phones$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Modify Call Times: </td><td align=left><select size=1 name=modify_call_times><option>0</option><option>1</option><option SELECTED>$modify_call_times</option></select>$NWB#vicidial_users-modify_call_times$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Delete Call Times: </td><td align=left><select size=1 name=delete_call_times><option>0</option><option>1</option><option SELECTED>$delete_call_times</option></select>$NWB#vicidial_users-delete_call_times$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Modify Servers: </td><td align=left><select size=1 name=modify_servers><option>0</option><option>1</option><option SELECTED>$modify_servers</option></select>$NWB#vicidial_users-modify_sections$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>CallCard Access: </td><td align=left><select size=1 name=callcard_admin><option>0</option><option>1</option><option SELECTED>$callcard_admin</option></select>$NWB#vicidial_users-modify_sections$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Agent API Access: </td><td align=left><select size=1 name=vdc_agent_api_access><option>0</option><option>1</option><option SELECTED>$vdc_agent_api_access</option></select>$NWB#vicidial_users-vdc_agent_api_access$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>Add Timeclock Log Record: </td><td align=left><select size=1 name=add_timeclock_log><option>0</option><option>1</option><option SELECTED>$add_timeclock_log</option></select>$NWB#vicidial_users-add_timeclock_log$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>Modify Timeclock Log Record: </td><td align=left><select size=1 name=modify_timeclock_log><option>0</option><option>1</option><option SELECTED>$modify_timeclock_log</option></select>$NWB#vicidial_users-modify_timeclock_log$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>Delete Timeclock Log Record: </td><td align=left><select size=1 name=delete_timeclock_log><option>0</option><option>1</option><option SELECTED>$delete_timeclock_log</option></select>$NWB#vicidial_users-delete_timeclock_log$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Manager Shift Enforcement Override: </td><td align=left><select size=1 name=manager_shift_enforcement_override><option>0</option><option>1</option><option SELECTED>$manager_shift_enforcement_override</option></select>$NWB#vicidial_users-manager_shift_enforcement_override$NWE</td></tr>\n";
}
echo "<tr bgcolor=#9BB9FB><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
if ($LOGdelete_users > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=5&user=$user\">DELETE THIS USER</a>\n";
}
echo "<br><br><a href=\"./AST_agent_time_sheet.php?agent=$user\">Click here for user time sheet</a>\n";
echo "<br><br><a href=\"./user_status.php?user=$user\">Click here for user status</a>\n";
echo "<br><br><a href=\"./user_stats.php?user=$user\">Click here for user stats</a>\n";
echo "<br><br><a href=\"./AST_agent_days_detail.php?user=$user&query_date=$REPORTdate&end_date=$REPORTdate&group[]=--ALL--&shift=ALL\">Click here for user multiple day status detail report</a>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=8&user=$user\">Click here for user CallBack Holds</a>\n";
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=USERS&stage=$user\">Click here to see Admin changes to this record</FONT>\n";
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=31 modify campaign info in the system - Detail view
######################
if ( ($LOGcampaign_detail < 1) and ($ADD==31) ) {$ADD=34;} # send to Basic if not allowed
if ( ($ADD==31) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) )
{$ADD=30;} # send to not allowed screen if not in vicidial_user_groups allowed_campaigns list
if ($ADD==31)
{
if ($LOGmodify_campaigns==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=31&campaign_id=$campaign_id&SUB=$SUB";
$modify_footer_refresh=1;
}
if ($stage=='show_dialable')
{
$stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
}
if ($stage=='hide_dialable')
{
$stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
}
if ($stage=='show_leadscount')
{
$stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
}
if ($stage=='hide_leadscount')
{
$stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
}
$stmt="SELECT enable_vtiger_integration,vtiger_url from system_settings;";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$enable_vtiger_integration_LU = $row[0];
$vtiger_url_LU = $row[1];
$stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields from vicidial_campaigns where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$campaign_name = $row[1];
$campaign_active = $row[2];
$dial_status_a = $row[3];
$dial_status_b = $row[4];
$dial_status_c = $row[5];
$dial_status_d = $row[6];
$dial_status_e = $row[7];
$lead_order = $row[8];
$web_form_address = stripslashes($row[11]);
$allow_closers = $row[12];
$hopper_level = $row[13];
$auto_dial_level = $row[14];
$next_agent_call = $row[15];
$local_call_time = $row[16];
$voicemail_ext = $row[17];
$dial_timeout = $row[18];
$dial_prefix = $row[19];
$campaign_cid = $row[20];
$campaign_vdad_exten = $row[21];
$campaign_rec_exten = $row[22];
$campaign_recording = $row[23];
$campaign_rec_filename = $row[24];
$script_id = $row[25];
$get_call_launch = $row[26];
$am_message_exten = $row[27];
$amd_send_to_vmx = $row[28];
$xferconf_a_dtmf = $row[29];
$xferconf_a_number = $row[30];
$xferconf_b_dtmf = $row[31];
$xferconf_b_number = $row[32];
$alt_number_dialing = $row[33];
$scheduled_callbacks = $row[34];
$lead_filter_id = $row[35];
if ($lead_filter_id=='') {$lead_filter_id='NONE';}
$drop_call_seconds = $row[36];
$drop_action = $row[37];
$safe_harbor_exten = $row[38];
$display_dialable_count = $row[39];
$wrapup_seconds = $row[40];
$wrapup_message = $row[41];
# $closer_campaigns = $row[42];
$use_internal_dnc = $row[43];
$allcalls_delay = $row[44];
$omit_phone_code = $row[45];
$dial_method = $row[46];
$available_only_ratio_tally = $row[47];
$adaptive_dropped_percentage = $row[48];
$adaptive_maximum_level = $row[49];
$adaptive_latest_server_time = $row[50];
$adaptive_intensity = $row[51];
$adaptive_dl_diff_target = $row[52];
$concurrent_transfers = $row[53];
$auto_alt_dial = $row[54];
$auto_alt_dial_statuses = $row[55];
$agent_pause_codes_active = $row[56];
$campaign_description = $row[57];
$campaign_changedate = $row[58];
$campaign_stats_refresh = $row[59];
$campaign_logindate = $row[60];
$dial_statuses = $row[61];
$disable_alter_custdata = $row[62];
$no_hopper_leads_logins = $row[63];
$list_order_mix = $row[64];
$campaign_allow_inbound = $row[65];
$manual_dial_list_id = $row[66];
$default_xfer_group = $row[67];
$queue_priority = $row[69];
$drop_inbound_group = $row[70];
$qc_enabled = $row[71];
$qc_statuses = $row[72];
$qc_lists = $row[73];
$qc_shift_id = $row[74];
$qc_get_record_launch = $row[75];
$qc_show_recording = $row[76];
$qc_web_form_address = stripslashes($row[77]);
$qc_script = $row[78];
$survey_first_audio_file = $row[79];
$survey_dtmf_digits = $row[80];
$survey_ni_digit = $row[81];
$survey_opt_in_audio_file = $row[82];
$survey_ni_audio_file = $row[83];
$survey_method = $row[84];
$survey_no_response_action = $row[85];
$survey_ni_status = $row[86];
$survey_response_digit_map = $row[87];
$survey_xfer_exten = $row[88];
$survey_camp_record_dir = $row[89];
$disable_alter_custphone = $row[90];
$display_queue_count = $row[91];
$manual_dial_filter = $row[92];
$agent_clipboard_copy = $row[93];
$agent_extended_alt_dial = $row[94];
$use_campaign_dnc = $row[95];
$three_way_call_cid = $row[96];
$three_way_dial_prefix = $row[97];
$web_form_target = $row[98];
$vtiger_search_category = $row[99];
$vtiger_create_call_record = $row[100];
$vtiger_create_lead_record = $row[101];
$vtiger_screen_login = $row[102];
$cpd_amd_action = $row[103];
$agent_allow_group_alias = $row[104];
$default_group_alias = $row[105];
$vtiger_search_dead = $row[106];
$vtiger_status_call = $row[107];
$survey_third_digit = $row[108];
$survey_third_audio_file = $row[109];
$survey_third_status = $row[110];
$survey_third_exten = $row[111];
$survey_fourth_digit = $row[112];
$survey_fourth_audio_file = $row[113];
$survey_fourth_status = $row[114];
$survey_fourth_exten = $row[115];
$drop_lockout_time = $row[116];
$quick_transfer_button = $row[117];
$prepopulate_transfer_preset = $row[118];
$drop_rate_group = $row[119];
$view_calls_in_queue = $row[120];
$view_calls_in_queue_launch = $row[121];
$grab_calls_in_queue = $row[122];
$call_requeue_button = $row[123];
$pause_after_each_call = $row[124];
$no_hopper_dialing = $row[125];
$agent_dial_owner_only = $row[126];
$agent_display_dialable_leads = $row[127];
$web_form_address_two = $row[128];
$waitforsilence_options = $row[129];
$agent_select_territories = $row[130];
$campaign_calldate = $row[131];
$crm_popup_login = $row[132];
$crm_login_address = $row[133];
$timer_action = $row[134];
$timer_action_message = $row[135];
$timer_action_seconds = $row[136];
$start_call_url = $row[137];
$dispo_call_url = $row[138];
$xferconf_c_number = $row[139];
$xferconf_d_number = $row[140];
$xferconf_e_number = $row[141];
$use_custom_cid = $row[142];
$scheduled_callbacks_alert = $row[143];
$queuemetrics_callstatus = $row[144];
$extension_appended_cidname = $row[145];
$scheduled_callbacks_count = $row[146];
$manual_dial_override = $row[147];
$blind_monitor_warning = $row[148];
$blind_monitor_message = $row[149];
$blind_monitor_filename = $row[150];
$inbound_queue_no_dial = $row[151];
$timer_action_destination = $row[152];
$enable_xfer_presets = $row[153];
$hide_xfer_number_to_dial = $row[154];
$manual_dial_prefix = $row[155];
$customer_3way_hangup_logging = $row[156];
$customer_3way_hangup_seconds = $row[157];
$customer_3way_hangup_action = $row[158];
$ivr_park_call = $row[159];
$ivr_park_call_agi = $row[160];
$manual_preview_dial = $row[161];
$realtime_agent_time_stats = $row[162];
$use_auto_hopper = $row[163];
$auto_hopper_multi = $row[164];
$auto_trim_hopper = $row[165];
$api_manual_dial = $row[166];
$manual_dial_call_time_check = $row[167];
$display_leads_count = $row[168];
$lead_order_randomize = $row[169];
$lead_order_secondary = $row[170];
$per_call_notes = $row[171];
$my_callback_option = $row[172];
$agent_lead_search = $row[173];
$agent_lead_search_method = $row[174];
$queuemetrics_phone_environment = $row[175];
$auto_pause_precall = $row[176];
$auto_resume_precall = $row[177];
$auto_pause_precall_code = $row[178];
$manual_dial_cid = $row[179];
$post_phone_time_diff_alert = $row[180];
$custom_3way_button_transfer = $row[181];
$available_only_tally_threshold = $row[182];
$available_only_tally_threshold_agents = $row[183];
$dial_level_threshold = $row[184];
$dial_level_threshold_agents = $row[185];
$safe_harbor_audio = $row[186];
$safe_harbor_menu_id = $row[187];
$survey_menu_id = $row[188];
$callback_days_limit = $row[189];
$dl_diff_target_method = $row[190];
$disable_dispo_screen = $row[191];
$disable_dispo_status = $row[192];
$screen_labels = $row[193];
$status_display_fields = $row[194];
if (ereg("DISABLED",$list_order_mix))
{$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;}
else
{$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;}
if ($auto_alt_dial == 'MULTI_LEAD')
{$ALTmultiDISABLE=1; $ALTmultiLINK="<a href=\"./admin_campaign_multi_alt.php?campaign_id=$campaign_id\">Multi-Alt-Settings</a>";}
else
{$ALTmultiDISABLE=0; $ALTmultiLINK='';}
$stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE'";
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
if ($rowx[0] < 1)
{
$mixes_list="<option SELECTED value=\"DISABLED\">DISABLED</option>\n";
$mixname_list["DISABLED"] = "DISABLED";
}
else
{
##### get list_mix listings for dynamic pulldown
$stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1";
$rslt=mysql_query($stmt, $link);
$mixes_to_print = mysql_num_rows($rslt);
$mixes_list="<option value=\"DISABLED\">DISABLED</option>\n";
$o=0;
while ($mixes_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$mixes_list .= "<option value=\"ACTIVE\">ACTIVE ($rowx[0] - $rowx[1])</option>\n";
$mixname_list["ACTIVE"] = "$rowx[0] - $rowx[1]";
$o++;
}
}
$dial_statuses = preg_replace("/ -$/","",$dial_statuses);
$Dstatuses = explode(" ", $dial_statuses);
$Ds_to_print = (count($Dstatuses) -1);
$qc_statuses = preg_replace("/^ | -$/","",$qc_statuses);
$QCstatuses = explode(" ", $qc_statuses);
$QCs_to_print = (count($QCstatuses) -0);
$qc_lists = preg_replace("/^ | -$/","",$qc_lists);
$QClists = explode(" ", $qc_lists);
$QCL_to_print = (count($QClists) -0);
##### get status listings for dynamic pulldown
$stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_statuses order by status";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$statuses_list='';
$dial_statuses_list='';
$qc_statuses_list='';
$survey_ni_status_list='';
$o=0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
if ($rowx[0] != 'CBHOLD')
{
$dial_statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
if ($survey_ni_status == $rowx[0])
{
$survey_ni_status_list .= "<option value=\"$rowx[0]\" SELECTED>$rowx[0] - $rowx[1]</option>\n";
}
else
{
$survey_ni_status_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
}
}
$statname_list["$rowx[0]"] = "$rowx[1]";
$LRstatuses_list .= "<option value=\"$rowx[0]-----$rowx[1]\">$rowx[0] - $rowx[1]</option>\n";
if (eregi("Y",$rowx[2]))
{$HKstatuses_list .= "<option value=\"$rowx[0]-----$rowx[1]\">$rowx[0] - $rowx[1]</option>\n";}
$qc_statuses_list .= "<input type=\"checkbox\" name=\"qc_statuses[]\" value=\"$rowx[0]\"";
$p=0;
while ($p < $QCs_to_print)
{
if ($rowx[0] == $QCstatuses[$p])
{
$qc_statuses_list .= " CHECKED";
}
$p++;
}
$qc_statuses_list .= "> $rowx[0] - $rowx[1]<BR>\n";
$o++;
}
$stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status";
$rslt=mysql_query($stmt, $link);
$Cstatuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($Cstatuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
if ($rowx[0] != 'CBHOLD') {$dial_statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
$statname_list["$rowx[0]"] = "$rowx[1]";
$LRstatuses_list .= "<option value=\"$rowx[0]-----$rowx[1]\">$rowx[0] - $rowx[1]</option>\n";
if (eregi("Y",$rowx[2]))
{$HKstatuses_list .= "<option value=\"$rowx[0]-----$rowx[1]\">$rowx[0] - $rowx[1]</option>\n";}
$qc_statuses_list .= "<input type=\"checkbox\" name=\"qc_statuses[]\" value=\"$rowx[0]\"";
$p=0;
while ($p < $QCs_to_print)
{
if ($rowx[0] == $QCstatuses[$p])
{
$qc_statuses_list .= " CHECKED";
}
$p++;
}
$qc_statuses_list .= "> $rowx[0] - $rowx[1]<BR>\n";
$o++;
}
##### get in-groups listings for dynamic drop in-group pulldown
$stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id";
# $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id";
$rslt=mysql_query($stmt, $link);
$Dgroups_to_print = mysql_num_rows($rslt);
$Dgroups_menu='';
$Dgroups_selected=0;
$o=0;
while ($Dgroups_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$Dgroups_menu .= "<option ";
if ($drop_inbound_group == "$rowx[0]")
{
$Dgroups_menu .= "SELECTED ";
$Dgroups_selected++;
}
$Dgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
if ($Dgroups_selected < 1)
{$Dgroups_menu .= "<option SELECTED value=\"---NONE---\">---NONE---</option>\n";}
else
{$Dgroups_menu .= "<option value=\"---NONE---\">---NONE---</option>\n";}
##### get in-groups listings for dynamic transfer group pulldown list menu
$stmt="SELECT group_id,group_name from vicidial_inbound_groups $xfer_groupsSQL order by group_id";
$rslt=mysql_query($stmt, $link);
$Xgroups_to_print = mysql_num_rows($rslt);
$Xgroups_menu='';
$Xgroups_selected=0;
$o=0;
while ($Xgroups_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$Xgroups_menu .= "<option ";
if ($default_xfer_group == "$rowx[0]")
{
$Xgroups_menu .= "SELECTED ";
$Xgroups_selected++;
}
$Xgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
if ($Xgroups_selected < 1)
{$Xgroups_menu .= "<option SELECTED value=\"---NONE---\">---NONE---</option>\n";}
else
{$Xgroups_menu .= "<option value=\"---NONE---\">---NONE---</option>\n";}
##### get agent screen label listings for dynamic pulldown list menu
$stmt="SELECT label_id,label_name from vicidial_screen_labels where active='Y' order by label_id;";
$rslt=mysql_query($stmt, $link);
$labels_to_print = mysql_num_rows($rslt);
$labels_menu='';
$o=0;
while ($labels_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$labels_menu .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
if ($SUB<1) {$camp_detail_color=$subcamp_color;}
else {$camp_detail_color=$campaigns_color;}
if ($SUB==22) {$camp_statuses_color=$subcamp_color;}
else {$camp_statuses_color=$campaigns_color;}
if ($SUB==23) {$camp_hotkeys_color=$subcamp_color;}
else {$camp_hotkeys_color=$campaigns_color;}
if ($SUB==25) {$camp_recycle_color=$subcamp_color;}
else {$camp_recycle_color=$campaigns_color;}
if ($SUB==26) {$camp_autoalt_color=$subcamp_color;}
else {$camp_autoalt_color=$campaigns_color;}
if ($SUB==27) {$camp_pause_color=$subcamp_color;}
else {$camp_pause_color=$campaigns_color;}
if ($SUB==28) {$camp_qc_color=$subcamp_color;}
else {$camp_qc_color=$campaigns_color;}
if ($SUB==29) {$camp_listmix_color=$subcamp_color;}
else {$camp_listmix_color=$campaigns_color;}
if ($SUB=='20A') {$camp_survey_color=$subcamp_color;}
else {$camp_survey_color=$campaigns_color;}
if ($SUB==201) {$camp_preset_color=$subcamp_color;}
else {$camp_preset_color=$campaigns_color;}
echo "<TABLE WIDTH=$page_width CELLPADDING=2 CELLSPACING=0><TR BGCOLOR=\"$campaigns_color\">\n";
echo "<TD><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\"> <B>$row[0]</B>: </font></TD>";
echo "<TD><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">Basic </font></a></TD>";
echo "<TD BGCOLOR=\"$camp_detail_color\"> <a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">Detail </font></a> </TD>";
echo "<TD BGCOLOR=\"$camp_statuses_color\"><a href=\"$PHP_SELF?ADD=31&SUB=22&campaign_id=$campaign_id\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">Statuses</font></a></TD>";
echo "<TD BGCOLOR=\"$camp_hotkeys_color\"><a href=\"$PHP_SELF?ADD=31&SUB=23&campaign_id=$campaign_id\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">HotKeys</font></a></TD>";
if ($SSoutbound_autodial_active > 0)
{
echo "<TD BGCOLOR=\"$camp_recycle_color\"><a href=\"$PHP_SELF?ADD=31&SUB=25&campaign_id=$campaign_id\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">Lead Recycling</font></a></TD>";
echo "<TD BGCOLOR=\"$camp_autoalt_color\"><a href=\"$PHP_SELF?ADD=31&SUB=26&campaign_id=$campaign_id\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">Auto Alt Dial</font></a></TD>";
echo "<TD BGCOLOR=\"$camp_listmix_color\"><a href=\"$PHP_SELF?ADD=31&SUB=29&campaign_id=$campaign_id\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">List Mix</font></a></TD>";
echo "<TD BGCOLOR=\"$camp_survey_color\"><a href=\"$PHP_SELF?ADD=31&SUB=20A&campaign_id=$campaign_id\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">Survey</font></a></TD>";
}
echo "<TD BGCOLOR=\"$camp_pause_color\"><a href=\"$PHP_SELF?ADD=31&SUB=27&campaign_id=$campaign_id\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">Pause Codes</font></a></TD>";
if ($enable_xfer_presets == 'ENABLED')
{
echo "<TD BGCOLOR=\"$camp_preset_color\"><a href=\"$PHP_SELF?ADD=31&SUB=201&campaign_id=$campaign_id\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">Presets</font></a></TD>";
}
if ($SSqc_features_active > 0)
{
echo "<TD BGCOLOR=\"$camp_qc_color\"><a href=\"$PHP_SELF?ADD=31&SUB=28&campaign_id=$campaign_id\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">QC</font></a></TD>";
}
if ($SSoutbound_autodial_active < 1)
{
echo "<TD></TD><TD></TD><TD></TD><TD></TD>\n";
}
echo "<TD> <a href=\"./realtime_report.php?RR=4&DB=0&group=$row[0]\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">Real-Time</font></a></TD>\n";
echo "</TR></TABLE>\n";
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<center>\n";
if ($SUB < 1)
{
echo "<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=41>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<input type=hidden name=park_ext value=\"$row[9]\">\n";
echo "<input type=hidden name=old_campaign_allow_inbound value=\"$campaign_allow_inbound\">\n";
echo "<TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign ID: </td><td align=left><b>$row[0]</b>$NWB#vicidial_campaigns-campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Name: </td><td align=left><input type=text name=campaign_name size=40 maxlength=40 value=\"$campaign_name\">$NWB#vicidial_campaigns-campaign_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Description: </td><td align=left><input type=text name=campaign_description size=40 maxlength=255 value=\"$campaign_description\">$NWB#vicidial_campaigns-campaign_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Change Date: </td><td align=left>$campaign_changedate &nbsp; $NWB#vicidial_campaigns-campaign_changedate$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Login Date: </td><td align=left>$campaign_logindate &nbsp; $NWB#vicidial_campaigns-campaign_logindate$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Call Date: </td><td align=left>$campaign_calldate &nbsp; $NWB#vicidial_campaigns-campaign_calldate$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$campaign_active</option></select>$NWB#vicidial_campaigns-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Park Music-on-Hold: </td><td align=left><input type=text name=park_file_name id=park_file_name size=20 maxlength=100 value=\"$row[10]\"> <a href=\"javascript:launch_moh_chooser('park_file_name','moh',200);\">moh chooser</a> $NWB#vicidial_campaigns-park_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Web Form: </td><td align=left><input type=text name=web_form_address size=70 maxlength=1055 value=\"$web_form_address\">$NWB#vicidial_campaigns-web_form_address$NWE</td></tr>\n";
if ($SSenable_second_webform > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Web Form Two: </td><td align=left><input type=text name=web_form_address_two size=70 maxlength=1055 value=\"$web_form_address_two\">$NWB#vicidial_campaigns-web_form_address$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Web Form Target: </td><td align=left><input type=text name=web_form_target size=25 maxlength=255 value=\"$web_form_target\">$NWB#vicidial_campaigns-web_form_target$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Allow Closers: </td><td align=left><select size=1 name=allow_closers><option>Y</option><option>N</option><option SELECTED>$allow_closers</option></select>$NWB#vicidial_campaigns-allow_closers$NWE</td></tr>\n";
if ($SSoutbound_autodial_active > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Allow Inbound and Blended: </td><td align=left><select size=1 name=campaign_allow_inbound><option>Y</option><option>N</option><option SELECTED>$campaign_allow_inbound</option></select>$NWB#vicidial_campaigns-campaign_allow_inbound$NWE</td></tr>\n";
$o=0;
while ($Ds_to_print > $o)
{
$o++;
$Dstatus = $Dstatuses[$o];
echo "<tr bgcolor=#8EBCFD><td align=right>Dial Status $o: </td><td align=left> \n";
if ($DEFstatusDISABLED > 0)
{
echo "<font color=grey><DEL><b>$Dstatus</b> - $statname_list[$Dstatus] &nbsp; &nbsp; &nbsp; &nbsp; <font size=2>\n";
echo "REMOVE</DEL></td></tr>\n";
}
else
{
echo "<b>$Dstatus</b> - $statname_list[$Dstatus] &nbsp; &nbsp; &nbsp; &nbsp; <font size=2>\n";
echo "<a href=\"$PHP_SELF?ADD=68&campaign_id=$campaign_id&status=$Dstatuses[$o]\">REMOVE</a></td></tr>\n";
}
}
echo "<tr bgcolor=#8EBCFD><td align=right>Add A Dial Status to Call: </td><td align=left><select size=1 name=dial_status $DEFlistDISABLE>\n";
echo "<option value=\"\"> - NONE - </option>\n";
echo "$dial_statuses_list";
echo "</select> &nbsp; \n";
echo "<input type=submit name=submit value=ADD> &nbsp; &nbsp; $NWB#vicidial_campaigns-dial_status$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List Order: </td><td align=left>";
if ($ALTmultiDISABLE > 0)
{
echo "<input type=hidden name=lead_order value=\"$lead_order\"> $ALTmultiLINK";
}
else
{
echo "<select size=1 name=lead_order>
<option SELECTED>$lead_order</option>
<option>DOWN</option>
<option>UP</option>
<option>DOWN PHONE</option>
<option>UP PHONE</option>
<option>DOWN LAST NAME</option>
<option>UP LAST NAME</option>
<option>DOWN COUNT</option>
<option>UP COUNT</option>
<option>RANDOM</option>
<option>DOWN LAST CALL TIME</option>
<option>UP LAST CALL TIME</option>
<option>DOWN RANK</option>
<option>UP RANK</option>
<option>DOWN OWNER</option>
<option>UP OWNER</option>
<option>DOWN TIMEZONE</option>
<option>UP TIMEZONE</option>
<option>DOWN 2nd NEW</option>
<option>DOWN 3rd NEW</option>
<option>DOWN 4th NEW</option>
<option>DOWN 5th NEW</option>
<option>DOWN 6th NEW</option>
<option>UP 2nd NEW</option>
<option>UP 3rd NEW</option>
<option>UP 4th NEW</option>
<option>UP 5th NEW</option>
<option>UP 6th NEW</option>
<option>DOWN PHONE 2nd NEW</option>
<option>DOWN PHONE 3rd NEW</option>
<option>DOWN PHONE 4th NEW</option>
<option>DOWN PHONE 5th NEW</option>
<option>DOWN PHONE 6th NEW</option>
<option>UP PHONE 2nd NEW</option>
<option>UP PHONE 3rd NEW</option>
<option>UP PHONE 4th NEW</option>
<option>UP PHONE 5th NEW</option>
<option>UP PHONE 6th NEW</option>
<option>DOWN LAST NAME 2nd NEW</option>
<option>DOWN LAST NAME 3rd NEW</option>
<option>DOWN LAST NAME 4th NEW</option>
<option>DOWN LAST NAME 5th NEW</option>
<option>DOWN LAST NAME 6th NEW</option>
<option>UP LAST NAME 2nd NEW</option>
<option>UP LAST NAME 3rd NEW</option>
<option>UP LAST NAME 4th NEW</option>
<option>UP LAST NAME 5th NEW</option>
<option>UP LAST NAME 6th NEW</option>
<option>DOWN COUNT 2nd NEW</option>
<option>DOWN COUNT 3rd NEW</option>
<option>DOWN COUNT 4th NEW</option>
<option>DOWN COUNT 5th NEW</option>
<option>DOWN COUNT 6th NEW</option>
<option>UP COUNT 2nd NEW</option>
<option>UP COUNT 3rd NEW</option>
<option>UP COUNT 4th NEW</option>
<option>UP COUNT 5th NEW</option>
<option>UP COUNT 6th NEW</option>
<option>RANDOM 2nd NEW</option>
<option>RANDOM 3rd NEW</option>
<option>RANDOM 4th NEW</option>
<option>RANDOM 5th NEW</option>
<option>RANDOM 6th NEW</option>
<option>DOWN LAST CALL TIME 2nd NEW</option>
<option>DOWN LAST CALL TIME 3rd NEW</option>
<option>DOWN LAST CALL TIME 4th NEW</option>
<option>DOWN LAST CALL TIME 5th NEW</option>
<option>DOWN LAST CALL TIME 6th NEW</option>
<option>UP LAST CALL TIME 2nd NEW</option>
<option>UP LAST CALL TIME 3rd NEW</option>
<option>UP LAST CALL TIME 4th NEW</option>
<option>UP LAST CALL TIME 5th NEW</option>
<option>UP LAST CALL TIME 6th NEW</option>
<option>DOWN RANK 2nd NEW</option>
<option>DOWN RANK 3rd NEW</option>
<option>DOWN RANK 4th NEW</option>
<option>DOWN RANK 5th NEW</option>
<option>DOWN RANK 6th NEW</option>
<option>UP RANK 2nd NEW</option>
<option>UP RANK 3rd NEW</option>
<option>UP RANK 4th NEW</option>
<option>UP RANK 5th NEW</option>
<option>UP RANK 6th NEW</option>
<option>DOWN OWNER 2nd NEW</option>
<option>DOWN OWNER 3rd NEW</option>
<option>DOWN OWNER 4th NEW</option>
<option>DOWN OWNER 5th NEW</option>
<option>DOWN OWNER 6th NEW</option>
<option>UP OWNER 2nd NEW</option>
<option>UP OWNER 3rd NEW</option>
<option>UP OWNER 4th NEW</option>
<option>UP OWNER 5th NEW</option>
<option>UP OWNER 6th NEW</option>
<option>DOWN TIMEZONE 2nd NEW</option>
<option>DOWN TIMEZONE 3rd NEW</option>
<option>DOWN TIMEZONE 4th NEW</option>
<option>DOWN TIMEZONE 5th NEW</option>
<option>DOWN TIMEZONE 6th NEW</option>
<option>UP TIMEZONE 2nd NEW</option>
<option>UP TIMEZONE 3rd NEW</option>
<option>UP TIMEZONE 4th NEW</option>
<option>UP TIMEZONE 5th NEW</option>
<option>UP TIMEZONE 6th NEW</option>
</select>$NWB#vicidial_campaigns-lead_order$NWE\n";
}
echo "</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List Order Randomize: </td><td align=left>";
if ($ALTmultiDISABLE > 0)
{
echo "<input type=hidden name=lead_order_randomize value=\"$lead_order_randomize\"> $ALTmultiLINK";
}
else
{
echo "<select size=1 name=lead_order_randomize><option>Y</option><option>N</option><option SELECTED>$lead_order_randomize</option></select>$NWB#vicidial_campaigns-lead_order_randomize$NWE";
}
echo "</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List Order Secondary: </td><td align=left>";
if ($ALTmultiDISABLE > 0)
{
echo "<input type=hidden name=lead_order_secondary value=\"$lead_order_secondary\"> $ALTmultiLINK";
}
else
{
echo "<select size=1 name=lead_order_secondary><option>LEAD_ASCEND</option><option>LEAD_DESCEND</option><option>CALLTIME_ASCEND</option><option>CALLTIME_DESCEND</option><option SELECTED>$lead_order_secondary</option></select>$NWB#vicidial_campaigns-lead_order_secondary$NWE";
}
echo "</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=31&SUB=29&campaign_id=$campaign_id&vcl_id=$list_order_mix\">List Mix</a>: </td><td align=left>";
if ($ALTmultiDISABLE > 0)
{
echo "<input type=hidden name=list_order_mix value=\"$list_order_mix\"> $ALTmultiLINK";
}
else
{
echo "<select size=1 name=list_order_mix>\n";
echo "$mixes_list";
if (ereg("DISABLED",$list_order_mix))
{echo "<option selected value=\"$list_order_mix\">$list_order_mix - $mixname_list[$list_order_mix]</option>\n";}
else
{echo "<option selected value=\"ACTIVE\">ACTIVE ($mixname_list[ACTIVE])</option>\n";}
echo "</select>$NWB#vicidial_campaigns-list_order_mix$NWE";
}
echo "</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=31111111&lead_filter_id=$lead_filter_id\">Lead Filter</a>: </td><td align=left>";
if ($ALTmultiDISABLE > 0)
{
echo "<input type=hidden name=lead_filter_id value=\"$lead_filter_id\"> $ALTmultiLINK";
}
else
{
echo "<select size=1 name=lead_filter_id>\n";
echo "$filters_list";
echo "<option selected value=\"$lead_filter_id\">$lead_filter_id - $filtername_list[$lead_filter_id]</option>\n";
echo "</select>$NWB#vicidial_campaigns-lead_filter_id$NWE";
}
echo "</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Drop Lockout Time: </td><td align=left><input type=text name=drop_lockout_time size=6 maxlength=6 value=\"$drop_lockout_time\"> $NWB#vicidial_campaigns-drop_lockout_time$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Minimum Hopper Level: </td><td align=left><select size=1 name=hopper_level><option>1</option><option>5</option><option>10</option><option>20</option><option>50</option><option>100</option><option>200</option><option>500</option><option>700</option><option>1000</option><option>2000</option><option SELECTED>$hopper_level</option></select>$NWB#vicidial_campaigns-hopper_level$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Automatic Hopper Level: </td><td align=left><select size=1 name=use_auto_hopper><option>Y</option><option>N</option><option SELECTED>$use_auto_hopper</option></select>$NWB#vicidial_campaigns-use_auto_hopper$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Automatic Hopper Multiplier: </td><td align=left><select size=1 name=auto_hopper_multi><option>0.1</option><option>0.2</option><option>0.3</option><option>0.4</option><option>0.5</option><option>0.6</option><option>0.7</option><option>0.8</option><option>0.9</option><option>1.0</option><option>1.1</option><option>1.2</option><option>1.3</option><option>1.4</option><option>1.5</option><option>1.6</option><option>1.7</option><option>1.8</option><option>1.9</option><option>2.0</option><option SELECTED>$auto_hopper_multi</option></select>$NWB#vicidial_campaigns-hopper_level$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Auto Trim Hopper: </td><td align=left><select size=1 name=auto_trim_hopper><option>Y</option><option>N</option><option SELECTED>$auto_trim_hopper</option></select>$NWB#vicidial_campaigns-auto_trim_hopper$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Force Reset of Hopper: </td><td align=left><select size=1 name=reset_hopper><option>Y</option><option SELECTED>N</option></select>$NWB#vicidial_campaigns-force_reset_hopper$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Dial Method: </td><td align=left><select size=1 name=dial_method><option >MANUAL</option><option>RATIO</option><option>ADAPT_HARD_LIMIT</option><option>ADAPT_TAPERED</option><option>ADAPT_AVERAGE</option><option>INBOUND_MAN</option><option SELECTED>$dial_method</option></select>$NWB#vicidial_campaigns-dial_method$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Auto Dial Level: </td><td align=left><select size=1 name=auto_dial_level><option selected>$auto_dial_level</option>\n";
$adl=0;
while($adl <= $SSauto_dial_limit)
{
echo "<option>$adl</option>\n";
if ($adl < 1)
{$adl = ($adl + 1);}
else
{
if ($adl < 3)
{$adl = ($adl + 0.1);}
else
{
if ($adl < 4)
{$adl = ($adl + 0.25);}
else
{
if ($adl < 5)
{$adl = ($adl + 0.5);}
else
{
if ($adl < 10)
{$adl = ($adl + 1);}
else
{
if ($adl < 20)
{$adl = ($adl + 2);}
else
{
if ($adl < 40)
{$adl = ($adl + 5);}
else
{
if ($adl < 200)
{$adl = ($adl + 10);}
else
{
if ($adl < 400)
{$adl = ($adl + 50);}
else
{
if ($adl < 1000)
{$adl = ($adl + 100);}
else
{$adl = ($adl + 1);}
}
}
}
}
}
}
}
}
}
}
echo "<option>$adl</option></select>(0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE &nbsp; &nbsp; &nbsp; <input type=checkbox name=dial_level_override value=\"1\">ADAPT OVERRIDE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Auto Dial Level Threshold: </td><td align=left><select size=1 name=dial_level_threshold><option >DISABLED</option><option>LOGGED-IN_AGENTS</option><option>NON-PAUSED_AGENTS</option><option>WAITING_AGENTS</option><option SELECTED>$dial_level_threshold</option></select>$NWB#vicidial_campaigns-dial_level_threshold$NWE &nbsp; &nbsp; &nbsp; agents: <select size=1 name=dial_level_threshold_agents><option SELECTED>$dial_level_threshold_agents</option><option>0</option><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</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>25</option><option>30</option><option>35</option><option>40</option><option>50</option></select></td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Available Only Tally: </td><td align=left><select size=1 name=available_only_ratio_tally><option>Y</option><option>N</option><option SELECTED>$available_only_ratio_tally</option></select>$NWB#vicidial_campaigns-available_only_ratio_tally$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Available Only Tally Threshold: </td><td align=left><select size=1 name=available_only_tally_threshold><option >DISABLED</option><option>LOGGED-IN_AGENTS</option><option>NON-PAUSED_AGENTS</option><option>WAITING_AGENTS</option><option SELECTED>$available_only_tally_threshold</option></select>$NWB#vicidial_campaigns-available_only_tally_threshold$NWE &nbsp; &nbsp; &nbsp; agents: <select size=1 name=available_only_tally_threshold_agents><option SELECTED>$available_only_tally_threshold_agents</option><option>0</option><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</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>25</option><option>30</option><option>35</option><option>40</option><option>50</option></select></td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Drop Percentage Limit: </td><td align=left><select size=1 name=adaptive_dropped_percentage>\n";
$n=101;
while ($n>=0.1)
{
if ($n <= 3)
{$n = ($n - 0.1);}
else
{$n--;}
echo "<option>$n</option>\n";
}
echo "<option SELECTED>$adaptive_dropped_percentage</option></select>% $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Maximum Adapt Dial Level: </td><td align=left><input type=text name=adaptive_maximum_level size=6 maxlength=6 value=\"$adaptive_maximum_level\"><i>number only</i> $NWB#vicidial_campaigns-adaptive_maximum_level$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Latest Server Time: </td><td align=left><input type=text name=adaptive_latest_server_time size=6 maxlength=4 value=\"$adaptive_latest_server_time\"><i>4 digits only</i> $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Adapt Intensity Modifier: </td><td align=left><select size=1 name=adaptive_intensity>\n";
$n=40;
while ($n>=-40)
{
$dtl = 'Balanced';
if ($n<0) {$dtl = 'Less Intense';}
if ($n>0) {$dtl = 'More Intense';}
if ($n == $adaptive_intensity)
{echo "<option SELECTED value=\"$n\">$n - $dtl</option>\n";}
else
{echo "<option value=\"$n\">$n - $dtl</option>\n";}
$n--;
}
echo "</select> $NWB#vicidial_campaigns-adaptive_intensity$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Dial Level Difference Target: </td><td align=left><select size=1 name=adaptive_dl_diff_target>\n";
$n=40;
while ($n>=-40)
{
$nabs = abs($n);
$dtl = 'Balanced';
if ($n<0) {$dtl = 'Agents Waiting for Calls';}
if ($n>0) {$dtl = 'Calls Waiting for Agents';}
if ($n == $adaptive_dl_diff_target)
{echo "<option SELECTED value=\"$n\">$n --- $nabs $dtl</option>\n";}
else
{echo "<option value=\"$n\">$n --- $nabs $dtl</option>\n";}
$n--;
}
echo "</select> $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Dial Level Difference Target Method: </td><td align=left><select size=1 name=dl_diff_target_method><option>ADAPT_CALC_ONLY</option><option>CALLS_PLACED</option><option SELECTED>$dl_diff_target_method</option></select>$NWB#vicidial_campaigns-dl_diff_target_method$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Concurrent Transfers: </td><td align=left><select size=1 name=concurrent_transfers><option >AUTO</option><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option><option>15</option><option>20</option><option>25</option><option>30</option><option>40</option><option>50</option><option>60</option><option>80</option><option>100</option><option SELECTED>$concurrent_transfers</option></select>$NWB#vicidial_campaigns-concurrent_transfers$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Queue Priority: </td><td align=left><select size=1 name=queue_priority>\n";
$n=99;
while ($n>=-99)
{
$dtl = 'Even';
if ($n<0) {$dtl = 'Lower';}
if ($n>0) {$dtl = 'Higher';}
if ($n == $queue_priority)
{echo "<option SELECTED value=\"$n\">$n - $dtl</option>\n";}
else
{echo "<option value=\"$n\">$n - $dtl</option>\n";}
$n--;
}
echo "</select> $NWB#vicidial_campaigns-queue_priority$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Multiple Campaign Drop Rate Group: </td><td align=left><select size=1 name=drop_rate_group>";
##### get list_mix listings for dynamic pulldown
$stmt="SELECT group_id from vicidial_drop_rate_groups;";
$rslt=mysql_query($stmt, $link);
$DRgroups_to_print = mysql_num_rows($rslt);
$DRgroups_list="<option value=\"DISABLED\">DISABLED</option>\n";
$o=0;
while ($DRgroups_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$DRgroups[$o] = "$rowx[0]";
$o++;
}
$o=0;
while ($DRgroups_to_print > $o)
{
$DRcampaigns='';
$stmt="SELECT campaign_id from vicidial_campaigns where drop_rate_group='$DRgroups[$o]' $LOGallowed_campaignsSQL;";
$rslt=mysql_query($stmt, $link);
$DRcampaigns_to_print = mysql_num_rows($rslt);
$p=0;
while ($DRcampaigns_to_print > $p)
{
$rowx=mysql_fetch_row($rslt);
$DRcampaigns .= "$rowx[0] ";
$p++;
}
if (strlen($DRcampaigns)<2)
{$DRcampaigns='-EMPTY- ';}
while(strlen($DRcampaigns) > 45) {$DRcampaigns = substr("$DRcampaigns", 0, -1);}
if(strlen($DRcampaigns) > 42) {$DRcampaigns = "$DRcampaigns...";}
$DRgroups_list .= "<option value=\"$DRgroups[$o]\">$DRgroups[$o] ( $DRcampaigns)</option>\n";
$o++;
}
echo "$DRgroups_list<option SELECTED>$drop_rate_group</option></select>$NWB#vicidial_campaigns-drop_rate_group$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Inbound Queue No Dial: </td><td align=left><select size=1 name=inbound_queue_no_dial><option >DISABLED</option><option>ENABLED</option><option>ALL_SERVERS</option><option SELECTED>$inbound_queue_no_dial</option></select>$NWB#vicidial_campaigns-inbound_queue_no_dial$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Auto Alt-Number Dialing: </td><td align=left><select size=1 name=auto_alt_dial><option >NONE</option><option>ALT_ONLY</option><option>ADDR3_ONLY</option><option>ALT_AND_ADDR3</option><option>ALT_AND_EXTENDED</option><option>ALT_AND_ADDR3_AND_EXTENDED</option><option>EXTENDED_ONLY</option><option>MULTI_LEAD</option><option SELECTED>$auto_alt_dial</option></select>$NWB#vicidial_campaigns-auto_alt_dial$NWE $ALTmultiLINK</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>overall_user_level</option><option>campaign_rank</option><option>fewest_calls</option><option>longest_wait_time</option><option SELECTED>$next_agent_call</option></select>$NWB#vicidial_campaigns-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=311111111&call_time_id=$local_call_time\">Local Call Time: </a></td><td align=left><select size=1 name=local_call_time>\n";
echo "$call_times_list";
echo "<option selected value=\"$local_call_time\">$local_call_time - $call_timename_list[$local_call_time]</option>\n";
echo "</select>$NWB#vicidial_campaigns-local_call_time$NWE</td></tr>\n";
if ($SSoutbound_autodial_active > 0)
{
echo "<tr bgcolor=#8EBCFD><td align=right>Dial Timeout: </td><td align=left><input type=text name=dial_timeout size=3 maxlength=3 value=\"$dial_timeout\"> <i>in seconds</i>$NWB#vicidial_campaigns-dial_timeout$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Dial Prefix: </td><td align=left><input type=text name=dial_prefix size=20 maxlength=20 value=\"$dial_prefix\"> <font size=1>for 91NXXNXXXXXX value would be 9, for no dial prefix use X</font>$NWB#vicidial_campaigns-dial_prefix$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Manual Dial Prefix: </td><td align=left><input type=text name=manual_dial_prefix size=20 maxlength=20 value=\"$manual_dial_prefix\"> $NWB#vicidial_campaigns-manual_dial_prefix$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Omit Phone Code: </td><td align=left><select size=1 name=omit_phone_code><option>Y</option><option>N</option><option SELECTED>$omit_phone_code</option></select>$NWB#vicidial_campaigns-omit_phone_code$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Campaign CallerID: </td><td align=left><input type=text name=campaign_cid size=20 maxlength=20 value=\"$campaign_cid\">$NWB#vicidial_campaigns-campaign_cid$NWE\n";
$stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and campaign_cid_override != '' and active='Y';";
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
if ($rowx[0] > 0)
{echo " <font color=red>LIST OVERRIDE ACTIVE</font>";}
echo "</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Custom CallerID: </td><td align=left><select size=1 name=use_custom_cid><option>Y</option><option>N</option><option SELECTED>$use_custom_cid</option></select>$NWB#vicidial_campaigns-use_custom_cid$NWE</td></tr>\n";
if ($SSoutbound_autodial_active > 0)
{
echo "<tr bgcolor=#8EBCFD><td align=right>Routing Extension: </td><td align=left><input type=text name=campaign_vdad_exten size=10 maxlength=20 value=\"$campaign_vdad_exten\">$NWB#vicidial_campaigns-campaign_vdad_exten$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Rec exten: </td><td align=left><input type=text name=campaign_rec_exten size=10 maxlength=10 value=\"$campaign_rec_exten\">$NWB#vicidial_campaigns-campaign_rec_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Recording: </td><td align=left><select size=1 name=campaign_recording><option>NEVER</option><option>ONDEMAND</option><option>ALLCALLS</option><option>ALLFORCE</option><option SELECTED>$campaign_recording</option></select>$NWB#vicidial_campaigns-campaign_recording$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Rec Filename: </td><td align=left><input type=text name=campaign_rec_filename size=50 maxlength=50 value=\"$campaign_rec_filename\">$NWB#vicidial_campaigns-campaign_rec_filename$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Recording Delay: </td><td align=left><input type=text name=allcalls_delay size=3 maxlength=3 value=\"$allcalls_delay\"> <i>in seconds</i>$NWB#vicidial_campaigns-allcalls_delay$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Call Notes Per Call: </td><td align=left><select size=1 name=per_call_notes><option>ENABLED</option><option>DISABLED</option><option SELECTED>$per_call_notes</option></select>$NWB#vicidial_campaigns-per_call_notes$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Lead Search: </td><td align=left><select size=1 name=agent_lead_search><option>ENABLED</option><option>DISABLED</option><option SELECTED>$agent_lead_search</option></select>$NWB#vicidial_campaigns-agent_lead_search$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Lead Search Method: </td><td align=left><select size=1 name=agent_lead_search_method><option>SYSTEM</option><option>CAMPAIGNLISTS</option><option>CAMPLISTS_ALL</option><option>LIST</option>USER_CAMPAIGNLISTS</option><option>USER_CAMPLISTS_ALL</option><option>USER_LIST</option><option>GROUP_SYSTEM</option><option>GROUP_CAMPAIGNLISTS</option><option>GROUP_CAMPLISTS_ALL</option><option>GROUP_LIST</option><option>TERRITORY_SYSTEM</option><option>TERRITORY_CAMPAIGNLISTS</option><option>TERRITORY_CAMPLISTS_ALL</option><option>TERRITORY_LIST<option SELECTED>$agent_lead_search_method</option></select>$NWB#vicidial_campaigns-agent_lead_search_method$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=3111111&script_id=$script_id\">Script</a>: </td><td align=left><select size=1 name=script_id>\n";
echo "$scripts_list";
echo "<option selected value=\"$script_id\">$script_id - $scriptname_list[$script_id]</option>\n";
echo "</select>$NWB#vicidial_campaigns-campaign_script$NWE\n";
$stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and agent_script_override != '' and active='Y';";
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
if ($rowx[0] > 0)
{echo " <font color=red>LIST OVERRIDE ACTIVE</font>";}
echo "</td></tr>\n";
$eswHTML=''; $cfwHTML='';
if ($SSenable_second_webform > 0)
{$eswHTML = '<option>WEBFORMTWO</option>';}
if ($SScustom_fields_enabled > 0)
{$cfwHTML = '<option>FORM</option>';}
echo "<tr bgcolor=#B6D3FC><td align=right>Get Call Launch: </td><td align=left><select size=1 name=get_call_launch><option selected>NONE</option><option>SCRIPT</option><option>WEBFORM</option>$eswHTML$cfwHTML<option selected>$get_call_launch</option></select>$NWB#vicidial_campaigns-get_call_launch$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Answering Machine Message: </td><td><input type=text size=50 maxlength=100 name=am_message_exten id=am_message_exten value=\"$am_message_exten\"> <a href=\"javascript:launch_chooser('am_message_exten','date',1200);\">audio chooser</a> $NWB#vicidial_campaigns-am_message_exten$NWE\n";
$stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y';";
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
if ($rowx[0] > 0)
{echo " <font color=red>LIST OVERRIDE ACTIVE</font>";}
echo "</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>WaitForSilence Options: </td><td align=left><input type=text name=waitforsilence_options size=20 maxlength=25 value=\"$waitforsilence_options\">$NWB#vicidial_campaigns-waitforsilence_options$NWE</td></tr>\n";
if ($SSoutbound_autodial_active > 0)
{
echo "<tr bgcolor=#8EBCFD><td align=right>AMD Send to VM exten: </td><td align=left><select size=1 name=amd_send_to_vmx><option>Y</option><option>N</option><option SELECTED>$amd_send_to_vmx</option></select>$NWB#vicidial_campaigns-amd_send_to_vmx$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>CPD AMD Action: </td><td align=left><select size=1 name=cpd_amd_action><option>DISABLED</option><option>DISPO</option><option>MESSAGE</option><option SELECTED>$cpd_amd_action</option></select>$NWB#vicidial_campaigns-cpd_amd_action$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Transfer-Conf DTMF 1: </td><td align=left><input type=text name=xferconf_a_dtmf size=20 maxlength=50 value=\"$xferconf_a_dtmf\">$NWB#vicidial_campaigns-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Transfer-Conf Number 1: </td><td align=left><input type=text name=xferconf_a_number size=20 maxlength=50 value=\"$xferconf_a_number\">$NWB#vicidial_campaigns-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Transfer-Conf DTMF 2: </td><td align=left><input type=text name=xferconf_b_dtmf size=20 maxlength=50 value=\"$xferconf_b_dtmf\">$NWB#vicidial_campaigns-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Transfer-Conf Number 2: </td><td align=left><input type=text name=xferconf_b_number size=20 maxlength=50 value=\"$xferconf_b_number\">$NWB#vicidial_campaigns-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Transfer-Conf Number 3: </td><td align=left><input type=text name=xferconf_c_number size=20 maxlength=50 value=\"$xferconf_c_number\">$NWB#vicidial_campaigns-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Transfer-Conf Number 4: </td><td align=left><input type=text name=xferconf_d_number size=20 maxlength=50 value=\"$xferconf_d_number\">$NWB#vicidial_campaigns-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Transfer-Conf Number 5: </td><td align=left><input type=text name=xferconf_e_number size=20 maxlength=50 value=\"$xferconf_e_number\">$NWB#vicidial_campaigns-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Enable Transfer Presets: </td><td align=left><select size=1 name=enable_xfer_presets><option>DISABLED</option><option>ENABLED</option><option SELECTED>$enable_xfer_presets</option></select>$NWB#vicidial_campaigns-enable_xfer_presets$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Hide Transfer Number to Dial: </td><td align=left><select size=1 name=hide_xfer_number_to_dial><option>DISABLED</option><option>ENABLED</option><option SELECTED>$hide_xfer_number_to_dial</option></select>$NWB#vicidial_campaigns-hide_xfer_number_to_dial$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Quick Transfer Button: </td><td align=left><select size=1 name=quick_transfer_button><option>N</option><option>IN_GROUP</option><option>PRESET_1</option><option>PRESET_2</option><option>PRESET_3</option><option>PRESET_4</option><option>PRESET_5</option><option SELECTED>$quick_transfer_button</option><option>LOCKED_IN_GROUP</option><option>LOCKED_PRESET_1</option><option>LOCKED_PRESET_2</option><option>LOCKED_PRESET_3</option><option>LOCKED_PRESET_4</option><option>LOCKED_PRESET_5</option></select>$NWB#vicidial_campaigns-quick_transfer_button$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Custom 3-Way Button Transfer: </td><td align=left><select size=1 name=custom_3way_button_transfer><option>DISABLED</option><option>PRESET_1</option><option>PRESET_2</option><option>PRESET_3</option><option>PRESET_4</option><option>PRESET_5</option><option>FIELD_address3</option><option>FIELD_province</option><option>FIELD_security_phrase</option><option>FIELD_vendor_lead_code</option><option>FIELD_email</option><option>FIELD_owner</option><option>PARK_PRESET_1</option><option>PARK_PRESET_2</option><option>PARK_PRESET_3</option><option>PARK_PRESET_4</option><option>PARK_PRESET_5</option><option>PARK_FIELD_address3</option><option>PARK_FIELD_province</option><option>PARK_FIELD_security_phrase</option><option>PARK_FIELD_vendor_lead_code</option><option>PARK_FIELD_email</option><option>PARK_FIELD_owner</option><option SELECTED>$custom_3way_button_transfer</option></select>$NWB#vicidial_campaigns-custom_3way_button_transfer$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>PrePopulate Transfer Preset: </td><td align=left><select size=1 name=prepopulate_transfer_preset><option>N</option><option>PRESET_1</option><option>PRESET_2</option><option>PRESET_3</option><option>PRESET_4</option><option>PRESET_5</option><option SELECTED>$prepopulate_transfer_preset</option></select>$NWB#vicidial_campaigns-prepopulate_transfer_preset$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Park Call IVR: </td><td align=left><select size=1 name=ivr_park_call><option>DISABLED</option><option>ENABLED</option><option>ENABLED_PARK_ONLY</option><option>ENABLED_BUTTON_HIDDEN</option><option SELECTED>$ivr_park_call</option></select>$NWB#vicidial_campaigns-ivr_park_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Park Call IVR AGI: </td><td align=left><input type=text name=ivr_park_call_agi size=80 maxlength=1000 value=\"$ivr_park_call_agi\">$NWB#vicidial_campaigns-ivr_park_call_agi$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Timer Action: </td><td align=left><select size=1 name=timer_action><option selected>NONE</option><option>D1_DIAL</option><option>D2_DIAL</option><option>D3_DIAL</option><option>D4_DIAL</option><option>D5_DIAL</option><option>MESSAGE_ONLY</option><option>WEBFORM</option>$eswHTML<option>HANGUP</option><option>CALLMENU</option><option>EXTENSION</option><option>IN_GROUP</option><option selected>$timer_action</option></select>$NWB#vicidial_campaigns-timer_action$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Timer Action Message: </td><td align=left><input type=text name=timer_action_message size=50 maxlength=255 value=\"$timer_action_message\">$NWB#vicidial_campaigns-timer_action_message$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Timer Action Seconds: </td><td align=left><input type=text name=timer_action_seconds size=10 maxlength=10 value=\"$timer_action_seconds\">$NWB#vicidial_campaigns-timer_action_seconds$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Timer Action Destination: </td><td align=left><input type=text name=timer_action_destination size=25 maxlength=30 value=\"$timer_action_destination\">$NWB#vicidial_campaigns-timer_action_destination$NWE</td></tr>\n";
if ($SSoutbound_autodial_active > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Alt Number Dialing: </td><td align=left><select size=1 name=alt_number_dialing><option>Y</option><option>N</option><option SELECTED>$alt_number_dialing</option></select>$NWB#vicidial_campaigns-alt_number_dialing$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Scheduled Callbacks: </td><td align=left><select size=1 name=scheduled_callbacks><option>Y</option><option>N</option><option SELECTED>$scheduled_callbacks</option></select>$NWB#vicidial_campaigns-scheduled_callbacks$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Scheduled Callbacks Alert: </td><td align=left><select size=1 name=scheduled_callbacks_alert><option>NONE</option><option>BLINK</option><option>RED</option><option>BLINK_RED</option><option>BLINK_DEFER</option><option>RED_DEFER</option><option>BLINK_RED_DEFER</option><option SELECTED>$scheduled_callbacks_alert</option></select>$NWB#vicidial_campaigns-scheduled_callbacks_alert$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Scheduled Callbacks Count: </td><td align=left><select size=1 name=scheduled_callbacks_count><option>LIVE</option><option>ALL_ACTIVE</option><option SELECTED>$scheduled_callbacks_count</option></select>$NWB#vicidial_campaigns-scheduled_callbacks_count$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Scheduled Callbacks Days Limit: </td><td align=left><input type=text name=callback_days_limit size=4 maxlength=3 value=\"$callback_days_limit\">$NWB#vicidial_campaigns-callback_days_limit$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>My Callbacks Checkbox Default: </td><td align=left><select size=1 name=my_callback_option><option>CHECKED</option><option>UNCHECKED</option><option SELECTED>$my_callback_option</option></select>$NWB#vicidial_campaigns-my_callback_option$NWE</td></tr>\n";
if ($SSoutbound_autodial_active > 0)
{
echo "<tr bgcolor=#8EBCFD><td align=right>Drop Call Seconds: </td><td align=left><input type=text name=drop_call_seconds size=5 maxlength=2 value=\"$drop_call_seconds\">$NWB#vicidial_campaigns-drop_call_seconds$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Drop Action: </td><td align=left><select size=1 name=drop_action><option>AUDIO</option><option>HANGUP</option><option>MESSAGE</option><option>VOICEMAIL</option><option>IN_GROUP</option><option>CALLMENU</option><option SELECTED>$drop_action</option></select>$NWB#vicidial_campaigns-drop_action$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Safe Harbor Exten: </td><td align=left><input type=text name=safe_harbor_exten size=10 maxlength=20 value=\"$safe_harbor_exten\">$NWB#vicidial_campaigns-safe_harbor_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Safe Harbor Audio: </td><td align=left><input type=text name=safe_harbor_audio id=safe_harbor_audio size=40 maxlength=100 value=\"$safe_harbor_audio\"> <a href=\"javascript:launch_chooser('safe_harbor_audio','date',2200);\">audio chooser</a> $NWB#vicidial_campaigns-safe_harbor_audio$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Safe Harbor Call Menu: </td><td align=left><select size=1 name=safe_harbor_menu_id id=safe_harbor_menu_id>$call_menu_list<option SELECTED>$safe_harbor_menu_id</option></select>$NWB#vicidial_campaigns-safe_harbor_menu_id$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Voicemail: </td><td align=left><input type=text name=voicemail_ext id=voicemail_ext size=12 maxlength=10 value=\"$voicemail_ext\"> <a href=\"javascript:launch_vm_chooser('voicemail_ext','vm',2200);\">voicemail chooser</a>$NWB#vicidial_campaigns-voicemail_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Drop Transfer Group: </td><td align=left><select size=1 name=drop_inbound_group>";
echo "$Dgroups_menu";
echo "</select>$NWB#vicidial_campaigns-drop_inbound_group$NWE\n";
$stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and drop_inbound_group_override != '' and active='Y';";
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
if ($rowx[0] > 0)
{echo " <font color=red>LIST OVERRIDE ACTIVE</font>";}
echo "</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Disable Dispo Screen: </td><td align=left><select size=1 name=disable_dispo_screen><option>DISPO_ENABLED</option><option>DISPO_DISABLED</option><option>DISPO_SELECT_DISABLED</option><option SELECTED>$disable_dispo_screen</option></select>$NWB#vicidial_campaigns-disable_dispo_screen$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Disable Dispo Status: </td><td align=left><input type=text name=disable_dispo_status size=7 maxlength=6 value=\"$disable_dispo_status\">$NWB#vicidial_campaigns-disable_dispo_status$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Wrap Up Seconds: </td><td align=left><input type=text name=wrapup_seconds size=5 maxlength=3 value=\"$wrapup_seconds\">$NWB#vicidial_campaigns-wrapup_seconds$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Wrap Up Message: </td><td align=left><input type=text name=wrapup_message size=40 maxlength=255 value=\"$wrapup_message\">$NWB#vicidial_campaigns-wrapup_message$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Use Internal DNC List: </td><td align=left><select size=1 name=use_internal_dnc><option>Y</option><option>N</option><option>AREACODE</option><option SELECTED>$use_internal_dnc</option></select>$NWB#vicidial_campaigns-use_internal_dnc$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Use Campaign DNC List: </td><td align=left><select size=1 name=use_campaign_dnc><option>Y</option><option>N</option><option>AREACODE</option><option SELECTED>$use_campaign_dnc</option></select>$NWB#vicidial_campaigns-use_campaign_dnc$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Pause Codes Active: </td><td align=left><select size=1 name=agent_pause_codes_active><option>FORCE</option><option>Y</option><option>N</option><option SELECTED>$agent_pause_codes_active</option></select>$NWB#vicidial_campaigns-agent_pause_codes_active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Auto Pause Pre-Call Work: </td><td align=left><select size=1 name=auto_pause_precall><option>Y</option><option>N</option><option SELECTED>$auto_pause_precall</option></select>$NWB#vicidial_campaigns-auto_pause_precall$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Auto Resume Pre-Call Work: </td><td align=left><select size=1 name=auto_resume_precall><option>Y</option><option>N</option><option SELECTED>$auto_resume_precall</option></select>$NWB#vicidial_campaigns-auto_resume_precall$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Auto Pause Pre-Call Code: </td><td align=left><input type=text name=auto_pause_precall_code size=7 maxlength=6 value=\"$auto_pause_precall_code\">$NWB#vicidial_campaigns-auto_pause_precall_code$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Stats Refresh: </td><td align=left><select size=1 name=campaign_stats_refresh><option>Y</option><option>N</option><option SELECTED>$campaign_stats_refresh</option></select>$NWB#vicidial_campaigns-campaign_stats_refresh$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Real-Time Agent Time Stats: </td><td align=left><select size=1 name=realtime_agent_time_stats><option>DISABLED</option><option>WAIT_CUST_ACW</option><option>WAIT_CUST_ACW_PAUSE</option><option>CALLS_WAIT_CUST_ACW_PAUSE</option><option SELECTED>$realtime_agent_time_stats</option></select>$NWB#vicidial_campaigns-realtime_agent_time_stats$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Disable Alter Customer Data: </td><td align=left><select size=1 name=disable_alter_custdata><option>Y</option><option>N</option><option SELECTED>$disable_alter_custdata</option></select>$NWB#vicidial_campaigns-disable_alter_custdata$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Disable Alter Customer Phone: </td><td align=left><select size=1 name=disable_alter_custphone><option>Y</option><option>N</option><option>HIDE</option><option SELECTED>$disable_alter_custphone</option></select>$NWB#vicidial_campaigns-disable_alter_custphone$NWE</td></tr>\n";
if ($SSoutbound_autodial_active > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Allow No-Hopper-Leads Logins: </td><td align=left><select size=1 name=no_hopper_leads_logins><option>Y</option><option>N</option><option SELECTED>$no_hopper_leads_logins</option></select>$NWB#vicidial_campaigns-no_hopper_leads_logins$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>No Hopper Dialing: </td><td align=left><select size=1 name=no_hopper_dialing><option>Y</option><option>N</option><option SELECTED>$no_hopper_dialing</option></select>$NWB#vicidial_campaigns-no_hopper_dialing$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Owner Only Dialing: </td><td align=left><select size=1 name=agent_dial_owner_only><option>NONE</option><option>USER</option><option>TERRITORY</option><option>USER_GROUP</option><option SELECTED>$agent_dial_owner_only</option></select>$NWB#vicidial_campaigns-agent_dial_owner_only$NWE</td></tr>\n";
if ($SSuser_territories_active > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Select Territories: </td><td align=left><select size=1 name=agent_select_territories><option>Y</option><option>N</option><option SELECTED>$agent_select_territories</option></select>$NWB#vicidial_campaigns-agent_select_territories$NWE</td></tr>\n";
}
echo "<tr bgcolor=#8EBCFD><td align=right>Agent Display Dialable Leads: </td><td align=left><select size=1 name=agent_display_dialable_leads><option>Y</option><option>N</option><option SELECTED>$agent_display_dialable_leads</option></select>$NWB#vicidial_campaigns-agent_display_dialable_leads$NWE</td></tr>\n";
}
if ( ($screen_labels=='--SYSTEM-SETTINGS--') or (strlen($screen_labels)<2) ) {$ASLlink = "$PHP_SELF?ADD=311111111111111";}
else {$ASLlink = "$PHP_SELF?ADD=381111111111&label_id=$screen_labels";}
echo "<tr bgcolor=#8EBCFD><td align=right><a href=\"$ASLlink\">Agent Screen Labels</a>: </td><td align=left><select size=1 name=screen_labels>$labels_menu<option value=\"--SYSTEM-SETTINGS--\">--SYSTEM-SETTINGS-- - Default</option><option SELECTED>$screen_labels</option></select>$NWB#vicidial_campaigns-screen_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Status Display Fields: </td><td align=left><select size=1 name=status_display_fields><option>CALLID</option><option>CALLID_LEADID</option><option>CALLID_LEADID_LISTID</option><option>---NONE---</option><option SELECTED>$status_display_fields</option></select>$NWB#vicidial_campaigns-status_display_fields$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Agent Display Queue Count: </td><td align=left><select size=1 name=display_queue_count><option>Y</option><option>N</option><option SELECTED>$display_queue_count</option></select>$NWB#vicidial_campaigns-display_queue_count$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Agent View Calls in Queue: </td><td align=left><select size=1 name=view_calls_in_queue><option>NONE</option><option>ALL</option><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option SELECTED>$view_calls_in_queue</option></select>$NWB#vicidial_campaigns-view_calls_in_queue$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>View Calls in Queue Launch: </td><td align=left><select size=1 name=view_calls_in_queue_launch><option>AUTO</option><option>MANUAL</option><option SELECTED>$view_calls_in_queue_launch</option></select>$NWB#vicidial_campaigns-view_calls_in_queue_launch$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Agent Grab Calls in Queue: </td><td align=left><select size=1 name=grab_calls_in_queue><option>Y</option><option>N</option><option SELECTED>$grab_calls_in_queue</option></select>$NWB#vicidial_campaigns-grab_calls_in_queue$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Call Re-Queue Button: </td><td align=left><select size=1 name=call_requeue_button><option>Y</option><option>N</option><option SELECTED>$call_requeue_button</option></select>$NWB#vicidial_campaigns-call_requeue_button$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Pause After Each Call: </td><td align=left><select size=1 name=pause_after_each_call><option>Y</option><option>N</option><option SELECTED>$pause_after_each_call</option></select>$NWB#vicidial_campaigns-pause_after_each_call$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Manual Dial Override: </td><td align=left><select size=1 name=manual_dial_override><option>NONE</option><option>ALLOW_ALL</option><option>DISABLE_ALL</option><option SELECTED>$manual_dial_override</option></select>$NWB#vicidial_campaigns-manual_dial_override$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Manual Dial List ID: </td><td align=left><input type=text name=manual_dial_list_id size=15 maxlength=12 value=\"$manual_dial_list_id\">$NWB#vicidial_campaigns-manual_dial_list_id$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Manual Dial Filter: </td><td align=left><select size=1 name=manual_dial_filter><option>NONE</option><option>DNC_ONLY</option><option>CAMPLISTS_ONLY</option><option>CAMPLISTS_ALL</option><option>DNC_AND_CAMPLISTS</option><option>DNC_AND_CAMPLISTS_ALL</option><option SELECTED>$manual_dial_filter</option></select>$NWB#vicidial_campaigns-manual_dial_filter$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Manual Preview Dial: </td><td align=left><select size=1 name=manual_preview_dial><option>DISABLED</option><option>PREVIEW_AND_SKIP</option><option>PREVIEW_ONLY</option><option SELECTED>$manual_preview_dial</option></select>$NWB#vicidial_campaigns-manual_preview_dial$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Manual Call Time Check: </td><td align=left><select size=1 name=manual_dial_call_time_check><option>DISABLED</option><option>ENABLED</option><option SELECTED>$manual_dial_call_time_check</option></select>$NWB#vicidial_campaigns-manual_dial_call_time_check$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Manual Dial API: </td><td align=left><select size=1 name=api_manual_dial><option>STANDARD</option><option>QUEUE</option><option>QUEUE_AND_AUTOCALL</option><option SELECTED>$api_manual_dial</option></select>$NWB#vicidial_campaigns-api_manual_dial$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Manual Dial CID: </td><td align=left><select size=1 name=manual_dial_cid><option>CAMPAIGN</option><option>AGENT_PHONE</option><option SELECTED>$manual_dial_cid</option></select>$NWB#vicidial_campaigns-manual_dial_cid$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Phone Post Time Difference Alert: </td><td align=left><select size=1 name=post_phone_time_diff_alert><option>ENABLED</option><option>OUTSIDE_CALLTIME_ONLY</option><option>OUTSIDE_CALLTIME_PHONE</option><option>OUTSIDE_CALLTIME_POSTAL</option><option>OUTSIDE_CALLTIME_BOTH</option><option>DISABLED</option><option SELECTED>$post_phone_time_diff_alert</option></select>$NWB#vicidial_campaigns-post_phone_time_diff_alert$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Screen Clipboard Copy: </td><td align=left><select size=1 name=agent_clipboard_copy><option>NONE</option><option>lead_id</option><option>list_id</option><option>title</option><option>first_name</option><option>middle_initial</option><option>last_name</option><option>phone_code</option><option>phone_number</option><option>address1</option><option>address2</option><option>address3</option><option>city</option><option>state</option><option>province</option><option>postal_code</option><option>country_code</option><option>alt_phone</option><option>comments</option><option>date_of_birth</option><option>email</option><option>gender</option><option>gmt_offset_now</option><option>security_phrase</option><option>vendor_lead_code</option><option SELECTED>$agent_clipboard_copy</option></select>$NWB#vicidial_campaigns-agent_clipboard_copy$NWE</td></tr>\n";
if ($SSoutbound_autodial_active > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Screen Extended Alt Dial: </td><td align=left><select size=1 name=agent_extended_alt_dial><option>Y</option><option>N</option><option SELECTED>$agent_extended_alt_dial</option></select>$NWB#vicidial_campaigns-agent_extended_alt_dial$NWE</td></tr>\n";
}
echo "<tr bgcolor=#8EBCFD><td align=right>3-Way Call Outbound CallerID: </td><td align=left><select size=1 name=three_way_call_cid><option>CAMPAIGN</option><option>CUSTOMER</option><option>AGENT_PHONE</option><option>AGENT_CHOOSE</option><option>CUSTOM_CID</option><option SELECTED>$three_way_call_cid</option></select>$NWB#vicidial_campaigns-three_way_call_cid$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>3-Way Call Dial Prefix: </td><td align=left><input type=text name=three_way_dial_prefix size=15 maxlength=20 value=\"$three_way_dial_prefix\">$NWB#vicidial_campaigns-three_way_dial_prefix$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Customer 3-Way Hangup Logging: </td><td align=left><select size=1 name=customer_3way_hangup_logging><option>DISABLED</option><option>ENABLED</option><option SELECTED>$customer_3way_hangup_logging</option></select>$NWB#vicidial_campaigns-customer_3way_hangup_logging$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Customer 3-Way Hangup Seconds: </td><td align=left><input type=text name=customer_3way_hangup_seconds size=5 maxlength=5 value=\"$customer_3way_hangup_seconds\">$NWB#vicidial_campaigns-customer_3way_hangup_seconds$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Customer 3-Way Hangup Action: </td><td align=left><select size=1 name=customer_3way_hangup_action><option>NONE</option><option>DISPO</option><option SELECTED>$customer_3way_hangup_action</option></select>$NWB#vicidial_campaigns-customer_3way_hangup_action$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Group Alias Allowed: </td><td align=left><select size=1 name=agent_allow_group_alias><option>Y</option><option>N</option><option SELECTED>$agent_allow_group_alias</option></select>$NWB#vicidial_campaigns-agent_allow_group_alias$NWE</td></tr>\n";
if ($agent_allow_group_alias == 'Y')
{
##### get groups_alias listings for dynamic default group alias pulldown list menu
$stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' order by group_alias_id";
$rslt=mysql_query($stmt, $link);
$group_alias_to_print = mysql_num_rows($rslt);
$group_alias_menu='';
$group_alias_selected=0;
$o=0;
while ($group_alias_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$group_alias_menu .= "<option ";
if ($default_group_alias == "$rowx[0]")
{
$group_alias_menu .= "SELECTED ";
$group_alias_selected++;
}
$group_alias_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "<tr bgcolor=#B6D3FC><td align=right>Default Group Alias: </td><td align=left><select size=1 name=default_group_alias>";
echo "<option value=\"\">NONE</option>";
echo "$group_alias_menu";
echo "</select>$NWB#vicidial_campaigns-default_group_alias$NWE</td></tr>\n";
}
if ($SSenable_vtiger_integration > 0)
{
echo "<tr bgcolor=#8EBCFD><td align=right>Vtiger Search Category: </td><td align=left><select size=1 name=vtiger_search_category><option>LEAD</option><option>ACCOUNT</option><option>VENDOR</option><option>LEAD_ACCOUNT</option><option>LEAD_ACCOUNT_VENDOR</option><option>ACCTID</option><option>ACCTID_ACCOUNT</option><option>ACCTID_ACCOUNT_LEAD_VENDOR</option><option>UNIFIED_CONTACT</option><option SELECTED>$vtiger_search_category</option></select>$NWB#vicidial_campaigns-vtiger_search_category$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Vtiger Search Dead Accounts: </td><td align=left><select size=1 name=vtiger_search_dead><option>DISABLED</option><option>ASK</option><option>RESURRECT</option><option SELECTED>$vtiger_search_dead</option></select>$NWB#vicidial_campaigns-vtiger_search_dead$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Vtiger Create Call Record: </td><td align=left><select size=1 name=vtiger_create_call_record><option>Y</option><option>N</option><option>DISPO</option><option SELECTED>$vtiger_create_call_record</option></select>$NWB#vicidial_campaigns-vtiger_create_call_record$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Vtiger Create Lead Record: </td><td align=left><select size=1 name=vtiger_create_lead_record><option>Y</option><option>N</option><option SELECTED>$vtiger_create_lead_record</option></select>$NWB#vicidial_campaigns-vtiger_create_lead_record$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Vtiger Status Call: </td><td align=left><select size=1 name=vtiger_status_call><option>Y</option><option>N</option><option SELECTED>$vtiger_status_call</option></select>$NWB#vicidial_campaigns-vtiger_status_call$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Vtiger Screen Login: </td><td align=left><select size=1 name=vtiger_screen_login><option>Y</option><option>N</option><option>NEW_WINDOW</option><option SELECTED>$vtiger_screen_login</option></select>$NWB#vicidial_campaigns-vtiger_screen_login$NWE</td></tr>\n";
}
else
{
echo "<input type=hidden name=vtiger_search_category value=\"$vtiger_search_category\">\n";
echo "<input type=hidden name=vtiger_create_call_record value=\"$vtiger_create_call_record\">\n";
echo "<input type=hidden name=vtiger_create_lead_record value=\"$vtiger_create_lead_record\">\n";
echo "<input type=hidden name=vtiger_screen_login value=\"$vtiger_screen_login\">\n";
echo "<input type=hidden name=vtiger_search_dead value=\"$vtiger_search_dead\">\n";
echo "<input type=hidden name=vtiger_status_call value=\"$vtiger_status_call\">\n";
}
if ($SSenable_queuemetrics_logging > 0)
{
echo "<tr bgcolor=#8EBCFD><td align=right>QM CallStatus Override: </td><td align=left><select size=1 name=queuemetrics_callstatus><option>DISABLED</option><option>NO</option><option>YES</option><option SELECTED>$queuemetrics_callstatus</option></select>$NWB#vicidial_campaigns-queuemetrics_callstatus$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>QM Phone Environment: </td><td align=left><input type=text name=queuemetrics_phone_environment size=20 maxlength=20 value=\"$queuemetrics_phone_environment\">$NWB#vicidial_campaigns-queuemetrics_phone_environment$NWE</td></tr>\n";
}
else
{
echo "<input type=hidden name=queuemetrics_callstatus value=\"$queuemetrics_callstatus\">\n";
echo "<input type=hidden name=queuemetrics_phone_environment value=\"$queuemetrics_phone_environment\">\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>CRM Popup Login: </td><td align=left><select size=1 name=crm_popup_login><option>Y</option><option>N</option><option SELECTED>$crm_popup_login</option></select>$NWB#vicidial_campaigns-crm_popup_login$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>CRM Popup Address: </td><td align=left><input type=text name=crm_login_address size=70 maxlength=2000 value=\"$crm_login_address\">$NWB#vicidial_campaigns-crm_login_address$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Start Call URL: </td><td align=left><input type=text name=start_call_url size=70 maxlength=2000 value=\"$start_call_url\">$NWB#vicidial_campaigns-start_call_url$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Dispo Call URL: </td><td align=left><input type=text name=dispo_call_url size=70 maxlength=2000 value=\"$dispo_call_url\">$NWB#vicidial_campaigns-dispo_call_url$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Extension Append CID: </td><td align=left><select size=1 name=extension_appended_cidname><option>Y</option><option>N</option><option SELECTED>$extension_appended_cidname</option></select>$NWB#vicidial_campaigns-extension_appended_cidname$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Blind Monitor Warning: </td><td align=left><select size=1 name=blind_monitor_warning><option>DISABLED</option><option>ALERT</option><option>NOTICE</option><option>AUDIO</option><option>ALERT_NOTICE</option><option>ALERT_AUDIO</option><option>NOTICE_AUDIO</option><option>ALL</option><option SELECTED>$blind_monitor_warning</option></select>$NWB#vicidial_campaigns-blind_monitor_warning$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Blind Monitor Notice: </td><td align=left><input type=text name=blind_monitor_message size=70 maxlength=255 value=\"$blind_monitor_message\">$NWB#vicidial_campaigns-blind_monitor_message$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Blind Monitor Filename: </td><td align=left><input type=text name=blind_monitor_filename id=blind_monitor_filename size=40 maxlength=100 value=\"$blind_monitor_filename\"> <a href=\"javascript:launch_chooser('blind_monitor_filename','date',3200);\">audio chooser</a> $NWB#vicidial_campaigns-blind_monitor_filename$NWE</td></tr>\n";
if ($campaign_allow_inbound == 'Y')
{
echo "<tr bgcolor=#B6D3FC><td align=right>Allowed Inbound Groups: <BR>";
echo " $NWB#vicidial_campaigns-closer_campaigns$NWE</td><td align=left>\n";
echo "$groups_list";
echo "</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Default Transfer Group: </td><td align=left><select size=1 name=default_xfer_group>";
echo "$Xgroups_menu";
echo "</select>$NWB#vicidial_campaigns-default_xfer_group$NWE</td></tr>\n";
if ($allow_closers == 'Y')
{
echo "<tr bgcolor=#B6D3FC><td align=right>Allowed Transfer Groups: <BR>";
echo " $NWB#vicidial_campaigns-xfer_groups$NWE</td><td align=left>\n";
echo "$XFERgroups_list";
echo "</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center></FORM>\n";
echo "<center>\n";
echo "<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=41>\n";
echo "<input type=hidden name=DB value=$DB>\n";
echo "<input type=hidden name=stage value=list_activation>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
if ($SSoutbound_autodial_active > 0)
{
echo "<br><b>LISTS WITHIN THIS CAMPAIGN: &nbsp; $NWB#vicidial_campaign_lists$NWE</b>\n";
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$LISTlink='stage=LISTIDDOWN';
$NAMElink='stage=LISTNAMEDOWN';
$TALLYlink='stage=TALLYDOWN';
$ACTIVElink='stage=ACTIVEDOWN';
$CAMPAIGNlink='stage=CAMPAIGNDOWN';
$CALLDATElink='stage=CALLDATEDOWN';
$SQLorder='order by list_id';
if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';}
if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';}
if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';}
if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';}
if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';}
if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';}
if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';}
if (eregi("ACTIVEDOWN",$stage)) {$SQLorder='order by active desc'; $ACTIVElink='stage=ACTIVEUP';}
if (eregi("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';}
if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';}
if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';}
if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';}
$stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' group by list_id $SQLorder";
$rslt=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rslt);
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&$LISTlink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST ID</B></a></TD>";
echo "<TD><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&$NAMElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST NAME</B></a></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</B></TD>\n";
echo "<TD><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&$TALLYlink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LEADS COUNT</B></a></TD>\n";
echo "<TD COLSPAN=2><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&$ACTIVElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACTIVE</B></a></TD>";
echo "<TD><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&$CALLDATElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LAST CALL DATE</B></a></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>MODIFY</TD>\n";
echo "</TR>\n";
$o=0;
while ($lists_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=311&list_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td><font size=1> $row[3]</td>";
echo "<td><font size=1> $row[4]</td>";
echo "<td>";
if (ereg('Y',$row[4]))
{
$active_lists++;
$camp_lists .= "'$row[0]',";
echo "<input type=\"checkbox\" name=\"list_active_change[]\" value=\"$row[0]\" CHECKED>";
}
else
{
$inactive_lists++;
echo "<input type=\"checkbox\" name=\"list_active_change[]\" value=\"$row[0]\"";
}
echo "</td>";
echo "<td><font size=1> $row[5]</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=311&list_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "<TR><TD COLSPAN=7 ALIGN=CENTER><input type=submit value=\"SUBMIT ACTIVE LIST CHANGES\"></TD></TR>\n";
echo "</TABLE></center><BR></FORM>\n";
$filterSQL = $filtersql_list[$lead_filter_id];
$filterSQL = preg_replace("/\\\\/","",$filterSQL);
$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL);
if (strlen($filterSQL)>4)
{$fSQL = "and $filterSQL";}
else
{$fSQL = '';}
$camp_lists = eregi_replace(".$","",$camp_lists);
echo "<center><B>This campaign has $active_lists active lists and $inactive_lists inactive lists</B><br><br>\n";
if ( ($display_leads_count == 'Y') and (strlen($camp_lists) > 3) )
{
# grab names of global statuses and statuses in the selected campaign
$stmt="SELECT status,status_name from vicidial_statuses order by status;";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$statuses_name_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
$stmt="SELECT status,status_name from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status;";
$rslt=mysql_query($stmt, $link);
$Cstatuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($Cstatuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$statuses_name_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
# end grab status names
echo "<br><b>STATUSES WITHIN THE ACTIVE LISTS FOR THIS CAMPAIGN:</b>\n";
echo " - <font size=1><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&stage=hide_leadscount\">HIDE</a></font><BR>";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>STATUS</td><td>STATUS NAME</td><td>CALLED</td><td>NOT CALLED</td></tr>\n";
$leads_in_list = 0;
$leads_in_list_N = 0;
$leads_in_list_Y = 0;
$stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id IN($camp_lists) group by status,called_since_last_reset order by status,called_since_last_reset";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
$lead_list['count'] = 0;
$lead_list['Y_count'] = 0;
$lead_list['N_count'] = 0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$lead_list['count'] = ($lead_list['count'] + $rowx[2]);
if ($rowx[1] == 'N')
{
$since_reset = 'N';
$since_resetX = 'Y';
}
else
{
$since_reset = 'Y';
$since_resetX = 'N';
}
$lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]);
$lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]);
#If opposite side is not set, it may not in the future so give it a value of zero
if (!isset($lead_list[$since_resetX][$rowx[0]]))
{
$lead_list[$since_resetX][$rowx[0]]=0;
}
$o++;
}
$o=0;
if ($lead_list['count'] > 0)
{
while (list($dispo,) = each($lead_list[$since_reset]))
{
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
if ($dispo == 'CBHOLD')
{
$CLB="<a href=\"$PHP_SELF?ADD=811&list_id=$list_id\">";
$CLE="</a>";
}
else
{
$CLB='';
$CLE='';
}
echo "<tr $bgcolor><td><font size=1>$CLB$dispo$CLE</td><td><font size=1>$statuses_name_list[$dispo]</td><td><font size=1>".$lead_list['Y'][$dispo]."</td><td><font size=1>".$lead_list['N'][$dispo]." </td></tr>\n";
$o++;
}
}
echo "<tr><td colspan=2><font size=1>SUBTOTALS</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n";
echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>TOTAL</td><td colspan=3 align=center><font size=1>$lead_list[count]</td></tr>\n";
echo "</table></center><br>\n";
unset($lead_list);
}
else
{
echo "<font size=1><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&stage=show_leadscount\">SHOW LEAD STATUSES IN THIS CAMPAIGN</a></font><BR><BR>";
}
echo "<center><b>\n";
if ($display_dialable_count == 'Y')
{
### call function to calculate and print dialable leads
dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL);
echo " - <font size=1><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&stage=hide_dialable\">HIDE</a></font><BR><BR>";
}
else
{
echo "<a href=\"$PHP_SELF?ADD=73&campaign_id=$campaign_id\" target=\"_blank\">Popup Dialable Leads Count</a>";
echo " - <font size=1><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&stage=show_dialable\">SHOW</a></font><BR><BR>";
}
$stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
$hopper_leads = "$rowx[0]";
echo "This campaign has $hopper_leads leads in the dial hopper<br><br>\n";
echo "<a href=\"./AST_VICIDIAL_hopperlist.php?group=$campaign_id\">Click here to see what leads are in the hopper right now</a><br><br>\n";
echo "<a href=\"./AST_VDADstats.php?group=$campaign_id\">Click here to see a VDAD report for this campaign</a><BR><BR>\n";
}
echo "<a href=\"$PHP_SELF?ADD=81&campaign_id=$campaign_id\">Click here to see all CallBack Holds in this campaign</a><BR><BR>\n";
if ($SSoutbound_autodial_active > 0)
{
if ( ($SStest_campaign_calls > 0) and ($campaign_active == 'Y') )
{
echo "<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=41>\n";
echo "<input type=hidden name=DB value=$DB>\n";
echo "<input type=hidden name=stage value=test_call>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<input type=hidden name=manual_dial_list_id value=\"$manual_dial_list_id\">\n";
echo "<input type=hidden name=dial_timeout value=\"$dial_timeout\">\n";
echo "<input type=hidden name=dial_prefix value=\"$dial_prefix\">\n";
echo "<input type=hidden name=campaign_cid value=\"$campaign_cid\">\n";
echo "<input type=hidden name=campaign_vdad_exten value=\"$campaign_vdad_exten\">\n";
echo "<input type=hidden name=omit_phone_code value=\"$omit_phone_code\">\n";
echo "Test Outbound Call: ";
echo "code: <input type=text name=phone_code id=phone_code size=4 maxlength=10 value=\"\"> &nbsp; ";
echo "number: <input type=text name=phone_number id=phone_number size=14 maxlength=20 value=\"\"> &nbsp; ";
echo "<input type=submit value=\"PLACE TEST CALL\"> &nbsp; $NWB#settings-test_campaign_calls$NWE</form><br><br>\n";
}
else
{
echo "Test calling disabled<br><br>\n";
}
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=CAMPAIGNS&stage=$campaign_id\">Click here to see Admin changes to this campaign</a></FONT>\n";
}
echo "</b></center>\n";
}
##### CAMPAIGN CUSTOM STATUSES #####
if ($SUB==22)
{
##### get status category listings for dynamic pulldown
$stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc";
$rslt=mysql_query($stmt, $link);
$cats_to_print = mysql_num_rows($rslt);
$cats_list="";
$o=0;
while ($cats_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$cats_list .= "<option value=\"$rowx[0]\">$rowx[0] - " . substr($rowx[1],0,20) . "</option>\n";
$catsname_list["$rowx[0]"] = substr($rowx[1],0,20);
$o++;
}
echo "<center>\n";
echo "<br><b>CUSTOM STATUSES WITHIN THIS CAMPAIGN: &nbsp; $NWB#vicidial_campaign_statuses$NWE</b><br>\n";
echo "<TABLE width=700 cellspacing=3>\n";
echo "<tr><td align=center valign=bottom><font size=2><b>S<br>T<br>A<br>T<br>U<br>S</td>\n";
echo "<td align=center valign=bottom><font size=2><b>DESCRIPTION</td>\n";
echo "<td align=center valign=bottom><font size=2><b>CATEGORY</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#ccffff\"><font size=2><b><br>A<br>G<br>E<br>N<br>T<br>&nbsp;<BR>S<br>E<br>L<br>E<br>C<br>T<br>A<br>B<br>L<br>E</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#99ffcc\"><font size=2><b>H<br>U<br>M<br>A<br>N<br>&nbsp;<BR>A<br>N<br>S<br>W<br>E<br>R</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#ccffff\"><font size=2><b>S<br>A<br>L<br>E</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#99ffcc\"><font size=2><b>D<br>N<br>C</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#ccffff\"><font size=2><b>C<br>U<br>S<br>T<br>O<br>M<br>E<br>R<br>&nbsp;<br>C<br>O<br>N<br>T<br>A<br>C<br>T</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#99ffcc\"><font size=2><b>N<br>O<br>T<br>&nbsp;<br>I<br>N<br>T<br>E<br>R<br>E<br>S<br>T<br>E<br>D</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#ccffff\"><font size=2><b>U<br>N<br>W<br>O<br>R<br>K<br>A<br>B<br>L<br>E</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#99ffcc\"><font size=2><b>S<br>C<br>H<br>E<br>D<br>U<br>L<br>E<br>D<br>&nbsp;<br>C<br>A<br>L<br>L<br>B<br>A<br>C<br>K</td>\n";
echo "<td align=center valign=bottom><font size=2><b>MODIFY/DELETE</td></tr>\n";
##### get status category listings for dynamic pulldown
$stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc";
$rslt=mysql_query($stmt, $link);
$cats_to_print = mysql_num_rows($rslt);
$cats_list="";
$o=0;
while ($cats_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$cats_list .= "<option value=\"$rowx[0]\">$rowx[0] - " . substr($rowx[1],0,20) . "</option>\n";
$catsname_list["$rowx[0]"] = substr($rowx[1],0,20);
$o++;
}
$stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status;";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$AScategory = $rowx[4];
$o++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=42>\n";
echo "<input type=hidden name=stage value=modify>\n";
echo "<input type=hidden name=status value=\"$rowx[0]\">\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<font size=2><B>$rowx[0]</B></td>\n";
echo "<td><input type=text name=status_name size=20 maxlength=30 value=\"$rowx[1]\"></td>\n";
echo "<td>\n";
echo "<select size=1 name=category>\n";
echo "$cats_list";
echo "<option selected value=\"$AScategory\">$AScategory - $catsname_list[$AScategory]</option>\n";
echo "</select>\n";
echo "\n";
echo "</td><td bgcolor=\"#ccffff\"><select size=1 name=selectable><option>Y</option><option>N</option><option selected>$rowx[2]</option></select>\n";
echo "</td><td bgcolor=\"#99ffcc\"><select size=1 name=human_answered><option>Y</option><option>N</option><option selected>$rowx[3]</option></select>\n";
echo "</td><td bgcolor=\"#ccffff\"><select size=1 name=sale><option>Y</option><option>N</option><option selected>$rowx[5]</option></select>\n";
echo "</td><td bgcolor=\"#99ffcc\"><select size=1 name=dnc><option>Y</option><option>N</option><option selected>$rowx[6]</option></select>\n";
echo "</td><td bgcolor=\"#ccffff\"><select size=1 name=customer_contact><option>Y</option><option>N</option><option selected>$rowx[7]</option></select>\n";
echo "</td><td bgcolor=\"#99ffcc\"><select size=1 name=not_interested><option>Y</option><option>N</option><option selected>$rowx[8]</option></select>\n";
echo "</td><td bgcolor=\"#ccffff\"><select size=1 name=unworkable><option>Y</option><option>N</option><option selected>$rowx[9]</option></select>\n";
echo "</td><td bgcolor=\"#99ffcc\"><select size=1 name=scheduled_callbacks><option>Y</option><option>N</option><option selected>$rowx[10]</option></select>\n";
echo "</td><td align=center nowrap><font size=1><input type=submit name=submit value=MODIFY> &nbsp; &nbsp; &nbsp; &nbsp; \n";
echo " &nbsp; \n";
if (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$rowx[0]))
{
echo "<DEL>DELETE</DEL>\n";
}
else
{
echo "<a href=\"$PHP_SELF?ADD=42&campaign_id=$campaign_id&status=$rowx[0]&stage=delete\">DELETE</a>\n";
}
echo "</form></td></tr>\n";
}
echo "</table>\n";
echo "<br>ADD NEW CUSTOM CAMPAIGN STATUS<BR><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=22>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "Status: <input type=text name=status_id size=8 maxlength=6> &nbsp; \n";
echo "Description: <input type=text name=status_name size=20 maxlength=30> &nbsp; \n";
echo "Selectable: <select size=1 name=selectable><option>Y</option><option>N</option></select> &nbsp; <BR>\n";
echo "Human Answer: <select size=1 name=human_answered><option>Y</option><option SELECTED>N</option></select> &nbsp; \n";
echo "Sale: <select size=1 name=sale><option>Y</option><option SELECTED>N</option></select> &nbsp; \n";
echo "DNC: <select size=1 name=dnc><option>Y</option><option SELECTED>N</option></select> &nbsp; \n";
echo "Customer Contact: <select size=1 name=customer_contact><option>Y</option><option SELECTED>N</option></select> &nbsp; <BR>\n";
echo "Not Interested: <select size=1 name=not_interested><option>Y</option><option SELECTED>N</option></select> &nbsp; \n";
echo "Unworkable: <select size=1 name=unworkable><option>Y</option><option SELECTED>N</option></select> &nbsp; \n";
echo "Callback: <select size=1 name=scheduled_callbacks><option>Y</option><option SELECTED>N</option></select> &nbsp; \n";
echo "Category: \n";
echo "<select size=1 name=category>\n";
echo "$cats_list";
echo "<option selected value=\"$AScategory\">$AScategory - $catsname_list[$AScategory]</option>\n";
echo "</select> &nbsp; <BR>\n";
echo "<input type=submit name=submit value=ADD><BR>\n";
echo "</FORM><br>\n";
}
##### CAMPAIGN HOTKEYS #####
if ($SUB==23)
{
echo "<br><b>CUSTOM HOT KEYS WITHIN THIS CAMPAIGN: &nbsp; $NWB#vicidial_campaign_hotkeys$NWE</b><br>\n";
echo "<TABLE width=400 cellspacing=3>\n";
echo "<tr><td>HOT KEY</td><td>STATUS</td><td>DESCRIPTION</td><td>DELETE</td></tr>\n";
$stmt="SELECT status,hotkey,status_name,selectable,campaign_id from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$o++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1>$rowx[1]</td><td><font size=1>$rowx[0]</td><td><font size=1>$rowx[2]</td><td><font size=1><a href=\"$PHP_SELF?ADD=43&campaign_id=$campaign_id&status=$rowx[0]&hotkey=$rowx[1]&action=DELETE\">DELETE</a></td></tr>\n";
}
echo "</table>\n";
echo "<br>ADD NEW CUSTOM CAMPAIGN HOT KEY<BR><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=23>\n";
echo "<input type=hidden name=selectable value=Y>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "Hotkey: <select size=1 name=hotkey>\n";
echo "<option>1</option>\n";
echo "<option>2</option>\n";
echo "<option>3</option>\n";
echo "<option>4</option>\n";
echo "<option>5</option>\n";
echo "<option>6</option>\n";
echo "<option>7</option>\n";
echo "<option>8</option>\n";
echo "<option>9</option>\n";
echo "</select> &nbsp; \n";
echo "Status: <select size=1 name=HKstatus>\n";
echo "$HKstatuses_list\n";
echo "<option value=\"ALTPH2-----Alternate Phone Hot Dial\">ALTPH2 - Alternate Phone Hot Dial</option>\n";
echo "<option value=\"ADDR3-----Address3 Hot Dial\">ADDR3 - Address3 Hot Dial</option>\n";
echo "</select> &nbsp; \n";
echo "<input type=submit name=submit value=ADD><BR>\n";
echo "</form><BR>\n";
}
##### CAMPAIGN LEAD RECYCLING #####
if ($SUB==25)
{
### display counts on leads that have hit the limit in this campaign
$stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'";
$rslt=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rslt);
$camp_lists='';
$o=0;
while ($lists_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
if (ereg("Y", $rowx[1])) {$camp_lists .= "'$rowx[0]',";}
$o++;
}
$camp_lists = eregi_replace(".$","",$camp_lists);
$stmt="SELECT recycle_id,campaign_id,status,attempt_delay,attempt_maximum,active from vicidial_lead_recycle where campaign_id='$campaign_id' order by status";
$rslt=mysql_query($stmt, $link);
$recycle_to_print = mysql_num_rows($rslt);
$o=0;
while ($recycle_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$RECYCLE_status[$o] = $rowx[2];
$RECYCLE_delay[$o] = $rowx[3];
$RECYCLE_attempt[$o] = $rowx[4];
$RECYCLE_active[$o] = $rowx[5];
$RECYCLE_count[$o] = "'Y','Y1','Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10'";
if ($RECYCLE_attempt[$o]==1) {$RECYCLE_count[$o] = "'Y1','Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==2) {$RECYCLE_count[$o] = "'Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==3) {$RECYCLE_count[$o] = "'Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==4) {$RECYCLE_count[$o] = "'Y4','Y5','Y6','Y7','Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==5) {$RECYCLE_count[$o] = "'Y5','Y6','Y7','Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==6) {$RECYCLE_count[$o] = "'Y6','Y7','Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==7) {$RECYCLE_count[$o] = "'Y7','Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==8) {$RECYCLE_count[$o] = "'Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==9) {$RECYCLE_count[$o] = "'Y9','Y10'";}
if ($RECYCLE_attempt[$o]>9) {$RECYCLE_count[$o] = "'Y10'";}
$o++;
}
$o=0;
echo "<br><br><b>LEAD RECYCLING WITHIN THIS CAMPAIGN: &nbsp; $NWB#vicidial_lead_recycle$NWE</b><br>\n";
echo "<TABLE width=700 cellspacing=3>\n";
echo "<tr><td>STATUS</td><td>ATTEMPT DELAY</td><td>ATTEMPT MAXIMUM</td><td>LEADS AT LIMIT</td><td>ACTIVE</td><td> </td><td>DELETE</td></tr>\n";
while ($recycle_to_print > $o)
{
$recycle_limit=0;
if (strlen($camp_lists) > 2)
{
$stmt="SELECT count(*) from vicidial_list where status='$RECYCLE_status[$o]' and list_id IN($camp_lists) and called_since_last_reset IN($RECYCLE_count[$o]);";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$counts_to_print = mysql_num_rows($rslt);
if ($counts_to_print > 0)
{
$rowx=mysql_fetch_row($rslt);
$recycle_limit = $rowx[0];
}
}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=2> &nbsp; $RECYCLE_status[$o]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=status value=\"$RECYCLE_status[$o]\">\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<input type=hidden name=ADD value=45></td>\n";
echo "<td><font size=1><input type=text size=7 maxlength=5 name=attempt_delay value=\"$RECYCLE_delay[$o]\"></td>\n";
echo "<td><font size=1><input type=text size=5 maxlength=3 name=attempt_maximum value=\"$RECYCLE_attempt[$o]\"></td>\n";
echo "<td align=right><font size=2>$recycle_limit &nbsp; </td>\n";
echo "<td><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$RECYCLE_active[$o]</option></select></td>\n";
echo "<td><font size=1><input type=submit name=submit value=MODIFY></form></td>\n";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=65&campaign_id=$campaign_id&status=$RECYCLE_status[$o]\">DELETE</a></td></tr>\n";
$o++;
}
echo "</table>\n";
echo "<br>ADD NEW CAMPAIGN LEAD RECYCLE<BR><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=25>\n";
echo "<input type=hidden name=active value=\"N\">\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "Status: <select size=1 name=status>\n";
echo "$LRstatuses_list\n";
echo "</select> &nbsp; \n";
echo "Attempt Delay: <input type=text size=7 maxlength=5 name=attempt_delay>\n";
echo "Attempt Maximum: <input type=text size=5 maxlength=3 name=attempt_maximum>\n";
echo "<input type=submit name=submit value=ADD><BR>\n";
echo "</FORM><br>\n";
echo "<br>\n";
echo "* Lead counts taken from active lists in the campaign only.\n";
}
##### CAMPAIGN AUTO-ALT-NUMBER DIALING #####
if ($SUB==26)
{
echo "<br><br><b>AUTO ALT NUMBER DIALING FOR THIS CAMPAIGN: &nbsp; $NWB#vicidial_auto_alt_dial_statuses$NWE</b><br>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>STATUSES</td><td>DELETE</td></tr>\n";
$auto_alt_dial_statuses = preg_replace("/ -$/","",$auto_alt_dial_statuses);
$AADstatuses = explode(" ", $auto_alt_dial_statuses);
$AADs_to_print = (count($AADstatuses) -1);
$o=0;
while ($AADs_to_print > $o)
{
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
$o++;
echo "<tr $bgcolor><td><font size=1>$AADstatuses[$o]</td>\n";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=66&campaign_id=$campaign_id&status=$AADstatuses[$o]\">DELETE</a></td></tr>\n";
}
echo "</table>\n";
echo "<br>ADD NEW AUTO ALT NUMBER DIALING STATUS<BR><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=26>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "Status: <select size=1 name=status>\n";
echo "$LRstatuses_list\n";
echo "</select> &nbsp; \n";
echo "<input type=submit name=submit value=ADD><BR>\n";
echo "</FORM><br>\n";
}
##### CAMPAIGN PAUSE CODES #####
if ($SUB==27)
{
echo "<br><br><b>AGENT PAUSE CODES FOR THIS CAMPAIGN: &nbsp; $NWB#vicidial_pause_codes$NWE</b><br>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>PAUSE CODES</td><td>BILLABLE</td><td>MODIFY</td><td>DELETE</td></tr>\n";
$stmt="SELECT pause_code,pause_code_name,billable,campaign_id from vicidial_pause_codes where campaign_id='$campaign_id' order by pause_code";
$rslt=mysql_query($stmt, $link);
$pause_codes_to_print = mysql_num_rows($rslt);
$o=0;
while ($pause_codes_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$o++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><form action=$PHP_SELF method=POST><font size=1>$rowx[0]\n";
echo "<input type=hidden name=ADD value=47>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<input type=hidden name=pause_code value=\"$rowx[0]\"> &nbsp;\n";
echo "<input type=text size=20 maxlength=30 name=pause_code_name value=\"$rowx[1]\"></td>\n";
echo "<td><select size=1 name=billable><option>YES</option><option>NO</option><option>HALF</option><option SELECTED>$rowx[2]</option></select></td>\n";
echo "<td><font size=1><input type=submit name=submit value=MODIFY></form></td>\n";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=67&campaign_id=$campaign_id&pause_code=$rowx[0]\">DELETE</a></td></tr>\n";
}
echo "</table>\n";
echo "<br>ADD NEW AGENT PAUSE CODE<BR><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=27>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "Pause Code: <input type=text size=8 maxlength=6 name=pause_code>\n";
echo "Pause Code Name: <input type=text size=20 maxlength=30 name=pause_code_name>\n";
echo " &nbsp; Billable: <select size=1 name=billable><option>YES</option><option>NO</option><option>HALF</option></select>\n";
echo "<input type=submit name=submit value=ADD><BR>\n";
echo "</center></FORM><br>\n";
}
##### CAMPAIGN QC SETTINGS #####
if ( ($SUB==28) and ($SSqc_features_active > 0) )
{
$stmt="SELECT list_id,list_name,active from vicidial_lists where campaign_id='$campaign_id'";
$rslt=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rslt);
$qc_lists_list='';
$p=0;
while ($lists_to_print > $p)
{
$rowx=mysql_fetch_row($rslt);
$qc_lists_list .= "<input type=\"checkbox\" name=\"qc_lists[]\" value=\"$rowx[0]\"";
$r=0;
while ($r < $QCL_to_print)
{
if ($rowx[0] == $QClists[$r])
{
$qc_lists_list .= " CHECKED";
}
$r++;
}
$qc_lists_list .= "> $rowx[0] - $rowx[1] - $rowx[2]<BR>\n";
$p++;
}
##### get scripts listings for pulldown
$stmt="SELECT script_id,script_name from vicidial_scripts order by script_id";
$rslt=mysql_query($stmt, $link);
$scripts_to_print = mysql_num_rows($rslt);
$QCscripts_list="";
$o=0;
while ($scripts_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$QCscripts_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$scriptname_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
##### get shifts listings for pulldown
$stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id";
$rslt=mysql_query($stmt, $link);
$shifts_to_print = mysql_num_rows($rslt);
$QCshifts_list="";
$o=0;
while ($shifts_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$QCshifts_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$shiftname_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
echo "<br><br><b>QC SETTINGS FOR THIS CAMPAIGN:</b><br>\n";
echo "<form action=$PHP_SELF method=POST><center><TABLE width=700 cellspacing=3>\n";
echo "<tr bgcolor=#B9CBFD><td align=right><input type=hidden name=ADD value=48>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "QC Enabled: </td><td><select size=1 name=qc_enabled><option>Y</option><option>N</option><option SELECTED>$qc_enabled</option></select> $NWB#vicidial_campaigns-qc_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>QC Statuses: <BR> $NWB#vicidial_campaigns-qc_statuses$NWE</td><td>$qc_statuses_list</td></tr>\n";
# echo "<tr bgcolor=#B9CBFD><td align=right>QC Lists: <BR> $NWB#vicidial_campaigns-qc_lists$NWE</td><td>$qc_lists_list</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>QC WebForm: </td><td align=left><input type=text name=qc_web_form_address size=70 maxlength=255 value=\"$qc_web_form_address\">$NWB#vicidial_campaigns-qc_web_form_address$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right><a href=\"$PHP_SELF?ADD=3111111&script_id=$script_id\">QC Script</a>: </td><td align=left><select size=1 name=qc_script>\n";
echo "$QCscripts_list";
echo "<option selected value=\"$qc_script\">$qc_script - $scriptname_list[$qc_script]</option>\n";
echo "</select>$NWB#vicidial_campaigns-qc_script$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right><a href=\"$PHP_SELF?ADD=331111111&shift_id=$qc_shift_id\">QC Shift</a>: </td><td align=left><select size=1 name=qc_shift_id>\n";
echo "$QCshifts_list";
echo "<option selected value=\"$qc_shift_id\">$qc_shift_id - $shiftname_list[$qc_shift_id]</option>\n";
echo "</select>$NWB#vicidial_campaigns-qc_shift_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>QC Get Record Launch: </td><td><select size=1 name=qc_get_record_launch><option>NONE</option><option>SCRIPT</option><option>WEBFORM</option><option>QCSCRIPT</option><option>QCWEBFORM</option><option SELECTED>$qc_get_record_launch</option></select> $NWB#vicidial_campaigns-qc_get_record_launch$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>QC Show Recording: </td><td><select size=1 name=qc_show_recording><option>Y</option><option>N</option><option SELECTED>$qc_show_recording</option></select> $NWB#vicidial_campaigns-qc_show_recording$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=center colspan=2><input type=submit name=submit value=SUBMIT></td></tr>\n";
echo "</table>\n";
echo "<BR></center></FORM><br>\n";
}
##### CAMPAIGN SURVEY SETTINGS #####
if ($SUB=='20A')
{
echo "<center><br><b>SURVEY SETTINGS FOR THIS CAMPAIGN:</b><br>\n";
echo "<form action=$PHP_SELF method=POST name=admin_form id=admin_form><center><TABLE width=750 cellspacing=3>\n";
echo "<tr bgcolor=#B9CBFD><td align=right><input type=hidden name=ADD value=40A>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey First Audio File: </td><td><input type=text size=50 maxlength=50 name=survey_first_audio_file id=survey_first_audio_file value=\"$survey_first_audio_file\"> <a href=\"javascript:launch_chooser('survey_first_audio_file','date',30);\">audio chooser</a> $NWB#vicidial_campaigns-survey_first_audio_file$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey DTMF Digits: </td><td><input type=text size=16 maxlength=16 name=survey_dtmf_digits value=\"$survey_dtmf_digits\"> $NWB#vicidial_campaigns-survey_dtmf_digits$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Not Interested Digit: </td><td><input type=text size=5 maxlength=1 name=survey_ni_digit value=\"$survey_ni_digit\"> $NWB#vicidial_campaigns-survey_ni_digit$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Opt-in Audio File: </td><td><input type=text size=50 maxlength=50 name=survey_opt_in_audio_file id=survey_opt_in_audio_file value=\"$survey_opt_in_audio_file\"> <a href=\"javascript:launch_chooser('survey_opt_in_audio_file','date',30);\">audio chooser</a> $NWB#vicidial_campaigns-survey_opt_in_audio_file$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Not Interested Audio File: </td><td><input type=text size=50 maxlength=50 name=survey_ni_audio_file id=survey_ni_audio_file value=\"$survey_ni_audio_file\"> <a href=\"javascript:launch_chooser('survey_ni_audio_file','date',30);\">audio chooser</a> $NWB#vicidial_campaigns-survey_ni_audio_file$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Method: </td><td><select size=1 name=survey_method><option>AGENT_XFER</option><option>VOICEMAIL</option><option>EXTENSION</option><option>HANGUP</option><option>CAMPREC_60_WAV</option><option>CALLMENU</option><option SELECTED>$survey_method</option></select> $NWB#vicidial_campaigns-survey_method$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey No-Response Action: </td><td><select size=1 name=survey_no_response_action><option>OPTIN</option><option>OPTOUT</option><option SELECTED>$survey_no_response_action</option></select> $NWB#vicidial_campaigns-survey_no_response_action$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Not Interested Status: </td><td><select name=survey_ni_status>$survey_ni_status_list</select> $NWB#vicidial_campaigns-survey_ni_status$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Third Digit: </td><td><input type=text size=5 maxlength=1 name=survey_third_digit id=survey_third_digit value=\"$survey_third_digit\"> $NWB#vicidial_campaigns-survey_third_digit$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Third Audio File: </td><td><input type=text size=50 maxlength=50 name=survey_third_audio_file id=survey_third_audio_file value=\"$survey_third_audio_file\"> <a href=\"javascript:launch_chooser('survey_third_audio_file','date',30);\">audio chooser</a> $NWB#vicidial_campaigns-survey_third_audio_file$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Third Status: </td><td><input type=text size=10 maxlength=6 name=survey_third_status value=\"$survey_third_status\"> $NWB#vicidial_campaigns-survey_third_status$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Third Extension: </td><td><input type=text size=20 maxlength=20 name=survey_third_exten value=\"$survey_third_exten\"> $NWB#vicidial_campaigns-survey_third_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Fourth Digit: </td><td><input type=text size=5 maxlength=1 name=survey_fourth_digit value=\"$survey_fourth_digit\"> $NWB#vicidial_campaigns-survey_fourth_digit$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Fourth Audio File: </td><td><input type=text size=50 maxlength=50 name=survey_fourth_audio_file id=survey_fourth_audio_file value=\"$survey_fourth_audio_file\"> <a href=\"javascript:launch_chooser('survey_fourth_audio_file','date',30);\">audio chooser</a> $NWB#vicidial_campaigns-survey_fourth_audio_file$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Fourth Status: </td><td><input type=text size=10 maxlength=6 name=survey_fourth_status value=\"$survey_fourth_status\"> $NWB#vicidial_campaigns-survey_fourth_status$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Fourth Extension: </td><td><input type=text size=20 maxlength=20 name=survey_fourth_exten value=\"$survey_fourth_exten\"> $NWB#vicidial_campaigns-survey_fourth_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Response Digit Map: </td><td><input type=text size=70 maxlength=100 name=survey_response_digit_map value=\"$survey_response_digit_map\"> $NWB#vicidial_campaigns-survey_response_digit_map$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Survey Xfer Extension: </td><td><input type=text size=12 maxlength=20 name=survey_xfer_exten value=\"$survey_xfer_exten\"> $NWB#vicidial_campaigns-survey_xfer_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Campaign Recording Directory: </td><td><input type=text size=70 maxlength=255 name=survey_camp_record_dir value=\"$survey_camp_record_dir\"> $NWB#vicidial_campaigns-survey_camp_record_dir$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Voicemail: </td><td><input type=text size=12 maxlength=10 name=voicemail_ext id=voicemail_ext value=\"$voicemail_ext\"> <a href=\"javascript:launch_vm_chooser('voicemail_ext','vm',300);\">voicemail chooser</a> $NWB#vicidial_campaigns-voicemail_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Call Menu: </td><td align=left><select size=1 name=survey_menu_id id=survey_menu_id>$call_menu_list<option SELECTED>$survey_menu_id</option></select>$NWB#vicidial_campaigns-survey_menu_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=center colspan=2><input type=submit name=submit value=SUBMIT></td></tr>\n";
echo "</table>\n";
echo "<BR></center></FORM><br>\n";
}
##### CAMPAIGN PRESETS #####
if ($SUB==201)
{
echo "<br><br><b>PRESETS FOR THIS CAMPAIGN: &nbsp; $NWB#vicidial_xfer_presets$NWE</b><br>\n";
echo "<center><TABLE width=700 cellspacing=3>\n";
echo "<tr><td>PRESET NAME</td><td>NUMBER</td><td>DTMF</td><td>HIDE</td><td>MODIFY</td><td>DELETE</td></tr>\n";
$stmt="SELECT preset_name,preset_number,preset_dtmf,preset_hide_number from vicidial_xfer_presets where campaign_id='$campaign_id' order by preset_name";
$rslt=mysql_query($stmt, $link);
$presets_to_print = mysql_num_rows($rslt);
$o=0;
while ($presets_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$o++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><form action=$PHP_SELF method=POST><font size=2>$rowx[0]\n";
echo "<input type=hidden name=ADD value=401>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<input type=hidden name=preset_name value=\"$rowx[0]\"> &nbsp;</td>\n";
echo "<td><input type=text size=20 maxlength=50 name=preset_number value=\"$rowx[1]\"></td>\n";
echo "<td><input type=text size=20 maxlength=50 name=preset_dtmf value=\"$rowx[2]\"></td>\n";
echo "<td><select size=1 name=preset_hide_number><option>Y</option><option>N</option><option SELECTED>$rowx[3]</option></select></td>\n";
echo "<td><font size=1><input type=submit name=submit value=MODIFY></form></td>\n";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=601&campaign_id=$campaign_id&preset_name=$rowx[0]\">DELETE</a></td></tr>\n";
}
echo "</table>\n";
echo "<br>ADD NEW PRESET<BR><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=201>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "Preset Name: <input type=text size=20 maxlength=40 name=preset_name>\n";
echo "Preset Number: <input type=text size=20 maxlength=50 name=preset_number><BR>\n";
echo "Preset DTMF: <input type=text size=20 maxlength=50 name=preset_dtmf>\n";
echo " &nbsp; Hide Number: <select size=1 name=preset_hide_number><option>Y</option><option SELECTED>N</option></select>\n";
echo "<input type=submit name=submit value=ADD><BR>\n";
echo "</center></FORM><br>\n";
}
if ($SUB < 1)
{
echo "<BR><BR>\n";
echo "<a href=\"$PHP_SELF?ADD=52&campaign_id=$campaign_id&DB=$DB\">LOG ALL AGENTS OUT OF THIS CAMPAIGN</a><BR><BR>\n";
# echo "<a href=\"$PHP_SELF?ADD=53&campaign_id=$campaign_id&DB=$DB\">EMERGENCY VDAC CLEAR FOR THIS CAMPAIGN</a><BR><BR>\n";
if ($LOGdelete_campaigns > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=51&campaign_id=$campaign_id\">DELETE THIS CAMPAIGN</a>\n";
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=34 modify campaign info in the system - Basic View
######################
if ( ($ADD==34) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) )
{$ADD=30;} # send to not allowed screen if not in vicidial_user_groups allowed_campaigns list
if ($ADD==34)
{
if ($LOGmodify_campaigns==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=31&campaign_id=$campaign_id&SUB=$SUB";
$modify_footer_refresh=1;
}
if ($stage=='show_dialable')
{
$stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
}
if ($stage=='hide_dialable')
{
$stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
}
if ($stage=='show_leadscount')
{
$stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
}
if ($stage=='hide_leadscount')
{
$stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
}
$stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,display_leads_count from vicidial_campaigns where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$dial_status_a = $row[3];
$dial_status_b = $row[4];
$dial_status_c = $row[5];
$dial_status_d = $row[6];
$dial_status_e = $row[7];
$lead_order = $row[8];
$hopper_level = $row[13];
$auto_dial_level = $row[14];
$next_agent_call = $row[15];
$local_call_time = $row[16];
$voicemail_ext = $row[17];
$dial_timeout = $row[18];
$dial_prefix = $row[19];
$campaign_cid = $row[20];
$campaign_vdad_exten = $row[21];
$script_id = $row[25];
$get_call_launch = $row[26];
$lead_filter_id = $row[35];
if ($lead_filter_id=='') {$lead_filter_id='NONE';}
$display_dialable_count = $row[39];
$dial_method = $row[46];
$adaptive_intensity = $row[51];
$auto_alt_dial = $row[54];
$campaign_description = $row[57];
$campaign_changedate = $row[58];
$campaign_stats_refresh = $row[59];
$campaign_logindate = $row[60];
$dial_statuses = $row[61];
$list_order_mix = $row[64];
$default_xfer_group = $row[67];
$campaign_allow_inbound = $row[65];
$default_xfer_group = $row[67];
$drop_lockout_time = $row[116];
$display_leads_count = $row[130];
if (ereg("DISABLED",$list_order_mix))
{$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;}
else
{$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;}
if ($auto_alt_dial == 'MULTI_LEAD')
{$ALTmultiDISABLE=1; $ALTmultiLINK="<a href=\"./admin_campaign_multi_alt.php?campaign_id=$campaign_id\">Multi-Alt-Settings</a>";}
else
{$ALTmultiDISABLE=0; $ALTmultiLINK='';}
$stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_statuses order by status";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$statuses_list='';
$dial_statuses_list='';
$o=0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
if ($rowx[0] != 'CBHOLD') {$dial_statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
$statname_list["$rowx[0]"] = "$rowx[1]";
$LRstatuses_list .= "<option value=\"$rowx[0]-----$rowx[1]\">$rowx[0] - $rowx[1]</option>\n";
if (eregi("Y",$rowx[2]))
{$HKstatuses_list .= "<option value=\"$rowx[0]-----$rowx[1]\">$rowx[0] - $rowx[1]</option>\n";}
$o++;
}
$stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status";
$rslt=mysql_query($stmt, $link);
$Cstatuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($Cstatuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
if ($rowx[0] != 'CBHOLD') {$dial_statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
$statname_list["$rowx[0]"] = "$rowx[1]";
$LRstatuses_list .= "<option value=\"$rowx[0]-----$rowx[1]\">$rowx[0] - $rowx[1]</option>\n";
if (eregi("Y",$rowx[2]))
{$HKstatuses_list .= "<option value=\"$rowx[0]-----$rowx[1]\">$rowx[0] - $rowx[1]</option>\n";}
$o++;
}
$dial_statuses = preg_replace("/ -$/","",$dial_statuses);
$Dstatuses = explode(" ", $dial_statuses);
$Ds_to_print = (count($Dstatuses) -1);
$stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE'";
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
if ($rowx[0] < 1)
{
$mixes_list="<option SELECTED value=\"DISABLED\">DISABLED</option>\n";
$mixname_list["DISABLED"] = "DISABLED";
}
else
{
##### get list_mix listings for dynamic pulldown
$stmt="SELECT vcl_id,vcl_name from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' limit 1";
$rslt=mysql_query($stmt, $link);
$mixes_to_print = mysql_num_rows($rslt);
$mixes_list="<option value=\"DISABLED\">DISABLED</option>\n";
$o=0;
while ($mixes_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$mixes_list .= "<option value=\"ACTIVE\">ACTIVE ($rowx[0] - $rowx[1])</option>\n";
$mixname_list["ACTIVE"] = "$rowx[0] - $rowx[1]";
$o++;
}
}
if ($SUB<1) {$camp_detail_color=$subcamp_color;}
else {$camp_detail_color=$campaigns_color;}
if ($SUB==22) {$camp_statuses_color=$subcamp_color;}
else {$camp_statuses_color=$campaigns_color;}
if ($SUB==23) {$camp_hotkeys_color=$subcamp_color;}
else {$camp_hotkeys_color=$campaigns_color;}
if ($SUB==25) {$camp_recycle_color=$subcamp_color;}
else {$camp_recycle_color=$campaigns_color;}
if ($SUB==26) {$camp_autoalt_color=$subcamp_color;}
else {$camp_autoalt_color=$campaigns_color;}
if ($SUB==27) {$camp_pause_color=$subcamp_color;}
else {$camp_pause_color=$campaigns_color;}
if ($SUB==29) {$camp_listmix_color=$subcamp_color;}
else {$camp_listmix_color=$campaigns_color;}
echo "<TABLE WIDTH=$page_width CELLPADDING=2 CELLSPACING=0><TR BGCOLOR=\"$campaigns_color\">\n";
echo "<TD><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\"> <B>$row[0]</B>: </font></TD>";
echo "<TD BGCOLOR=\"$camp_detail_color\"><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">Basic View </font></a></TD>";
echo "<TD> <a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">Detail View</font></a> </TD>";
if ($SSoutbound_autodial_active > 0)
{
echo "<TD BGCOLOR=\"$camp_listmix_color\"> <a href=\"$PHP_SELF?ADD=34&SUB=29&campaign_id=$campaign_id\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">List Mix</font></a> </TD>";
}
echo "<TD> <a href=\"./realtime_report.php?RR=4&DB=0&group=$row[0]\"><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\">Real-Time Screen</font></a></TD>\n";
echo "<TD WIDTH=300><font size=2 color=$subcamp_font face=\"ARIAL,HELVETICA\"> &nbsp; </font></TD>\n";
if ($SSoutbound_autodial_active < 1)
{
echo "<TD></TD>";
}
echo "</TR></TABLE>\n";
if ($SUB < 1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=44>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<input type=hidden name=old_campaign_allow_inbound value=\"$campaign_allow_inbound\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign ID: </td><td align=left><b>$row[0]</b>$NWB#vicidial_campaigns-campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Name: </td><td align=left><input type=text name=campaign_name size=40 maxlength=40 value=\"$row[1]\">$NWB#vicidial_campaigns-campaign_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Description: </td><td align=left>$row[57]$NWB#vicidial_campaigns-campaign_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Change Date: </td><td align=left>$campaign_changedate &nbsp; $NWB#vicidial_campaigns-campaign_changedate$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Login Date: </td><td align=left>$campaign_logindate &nbsp; $NWB#vicidial_campaigns-campaign_logindate$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$row[2]</option></select>$NWB#vicidial_campaigns-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Park Music-on-Hold: </td><td align=left>$row[10] $NWB#vicidial_campaigns-park_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Web Form: </td><td align=left>$row[11]$NWB#vicidial_campaigns-web_form_address$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Allow Closers: </td><td align=left>$row[12] $NWB#vicidial_campaigns-allow_closers$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Transfer Group: </td><td align=left>$default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE</td></tr>\n";
if ($SSoutbound_autodial_active > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Allow Inbound and Blended: </td><td align=left>$campaign_allow_inbound $NWB#vicidial_campaigns-campaign_allow_inbound$NWE</td></tr>\n";
$o=0;
while ($Ds_to_print > $o)
{
$o++;
$Dstatus = $Dstatuses[$o];
echo "<tr bgcolor=#8EBCFD><td align=right>Dial Status $o: </td><td align=left> \n";
if ($DEFstatusDISABLED > 0)
{
echo "<font color=grey><DEL><b>$Dstatus</b> - $statname_list[$Dstatus] &nbsp; &nbsp; &nbsp; &nbsp; <font size=2>\n";
echo "REMOVE</DEL></td></tr>\n";
}
else
{
echo "<b>$Dstatus</b> - $statname_list[$Dstatus] &nbsp; &nbsp; &nbsp; &nbsp; <font size=2>\n";
echo "<a href=\"$PHP_SELF?ADD=68&campaign_id=$campaign_id&status=$Dstatuses[$o]\">REMOVE</a></td></tr>\n";
}
}
echo "<tr bgcolor=#8EBCFD><td align=right>Add A Dial Status to Call: </td><td align=left><select size=1 name=dial_status $DEFlistDISABLE>\n";
echo "<option value=\"\"> - NONE - </option>\n";
echo "$dial_statuses_list";
echo "</select> &nbsp; \n";
echo "<input type=submit name=submit value=ADD> &nbsp; &nbsp; $NWB#vicidial_campaigns-dial_status$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List Order: </td><td align=left>";
if ($ALTmultiDISABLE > 0)
{
echo "<input type=hidden name=lead_order value=\"$lead_order\"> $ALTmultiLINK";
}
else
{
echo "<select size=1 name=lead_order>
<option SELECTED>$lead_order</option>
<option>DOWN</option>
<option>UP</option>
<option>DOWN PHONE</option>
<option>UP PHONE</option>
<option>DOWN LAST NAME</option>
<option>UP LAST NAME</option>
<option>DOWN COUNT</option>
<option>UP COUNT</option>
<option>RANDOM</option>
<option>DOWN LAST CALL TIME</option>
<option>UP LAST CALL TIME</option>
<option>DOWN RANK</option>
<option>UP RANK</option>
<option>DOWN OWNER</option>
<option>UP OWNER</option>
<option>DOWN TIMEZONE</option>
<option>UP TIMEZONE</option>
<option>DOWN 2nd NEW</option>
<option>DOWN 3rd NEW</option>
<option>DOWN 4th NEW</option>
<option>DOWN 5th NEW</option>
<option>DOWN 6th NEW</option>
<option>UP 2nd NEW</option>
<option>UP 3rd NEW</option>
<option>UP 4th NEW</option>
<option>UP 5th NEW</option>
<option>UP 6th NEW</option>
<option>DOWN PHONE 2nd NEW</option>
<option>DOWN PHONE 3rd NEW</option>
<option>DOWN PHONE 4th NEW</option>
<option>DOWN PHONE 5th NEW</option>
<option>DOWN PHONE 6th NEW</option>
<option>UP PHONE 2nd NEW</option>
<option>UP PHONE 3rd NEW</option>
<option>UP PHONE 4th NEW</option>
<option>UP PHONE 5th NEW</option>
<option>UP PHONE 6th NEW</option>
<option>DOWN LAST NAME 2nd NEW</option>
<option>DOWN LAST NAME 3rd NEW</option>
<option>DOWN LAST NAME 4th NEW</option>
<option>DOWN LAST NAME 5th NEW</option>
<option>DOWN LAST NAME 6th NEW</option>
<option>UP LAST NAME 2nd NEW</option>
<option>UP LAST NAME 3rd NEW</option>
<option>UP LAST NAME 4th NEW</option>
<option>UP LAST NAME 5th NEW</option>
<option>UP LAST NAME 6th NEW</option>
<option>DOWN COUNT 2nd NEW</option>
<option>DOWN COUNT 3rd NEW</option>
<option>DOWN COUNT 4th NEW</option>
<option>DOWN COUNT 5th NEW</option>
<option>DOWN COUNT 6th NEW</option>
<option>UP COUNT 2nd NEW</option>
<option>UP COUNT 3rd NEW</option>
<option>UP COUNT 4th NEW</option>
<option>UP COUNT 5th NEW</option>
<option>UP COUNT 6th NEW</option>
<option>RANDOM 2nd NEW</option>
<option>RANDOM 3rd NEW</option>
<option>RANDOM 4th NEW</option>
<option>RANDOM 5th NEW</option>
<option>RANDOM 6th NEW</option>
<option>DOWN LAST CALL TIME 2nd NEW</option>
<option>DOWN LAST CALL TIME 3rd NEW</option>
<option>DOWN LAST CALL TIME 4th NEW</option>
<option>DOWN LAST CALL TIME 5th NEW</option>
<option>DOWN LAST CALL TIME 6th NEW</option>
<option>UP LAST CALL TIME 2nd NEW</option>
<option>UP LAST CALL TIME 3rd NEW</option>
<option>UP LAST CALL TIME 4th NEW</option>
<option>UP LAST CALL TIME 5th NEW</option>
<option>UP LAST CALL TIME 6th NEW</option>
<option>DOWN RANK 2nd NEW</option>
<option>DOWN RANK 3rd NEW</option>
<option>DOWN RANK 4th NEW</option>
<option>DOWN RANK 5th NEW</option>
<option>DOWN RANK 6th NEW</option>
<option>UP RANK 2nd NEW</option>
<option>UP RANK 3rd NEW</option>
<option>UP RANK 4th NEW</option>
<option>UP RANK 5th NEW</option>
<option>UP RANK 6th NEW</option>
<option>DOWN OWNER 2nd NEW</option>
<option>DOWN OWNER 3rd NEW</option>
<option>DOWN OWNER 4th NEW</option>
<option>DOWN OWNER 5th NEW</option>
<option>DOWN OWNER 6th NEW</option>
<option>UP OWNER 2nd NEW</option>
<option>UP OWNER 3rd NEW</option>
<option>UP OWNER 4th NEW</option>
<option>UP OWNER 5th NEW</option>
<option>UP OWNER 6th NEW</option>
<option>DOWN TIMEZONE 2nd NEW</option>
<option>DOWN TIMEZONE 3rd NEW</option>
<option>DOWN TIMEZONE 4th NEW</option>
<option>DOWN TIMEZONE 5th NEW</option>
<option>DOWN TIMEZONE 6th NEW</option>
<option>UP TIMEZONE 2nd NEW</option>
<option>UP TIMEZONE 3rd NEW</option>
<option>UP TIMEZONE 4th NEW</option>
<option>UP TIMEZONE 5th NEW</option>
<option>UP TIMEZONE 6th NEW</option>
</select>$NWB#vicidial_campaigns-lead_order$NWE";
}
echo "</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=31&SUB=29&campaign_id=$campaign_id&vcl_id=$list_order_mix\">List Mix</a>: </td><td align=left>";
if ($ALTmultiDISABLE > 0)
{
echo "<input type=hidden name=list_order_mix value=\"$list_order_mix\"> $ALTmultiLINK";
}
else
{
echo "<select size=1 name=list_order_mix>\n";
echo "$mixes_list";
if (ereg("DISABLED",$list_order_mix))
{echo "<option selected value=\"$list_order_mix\">$list_order_mix - $mixname_list[$list_order_mix]</option>\n";}
else
{echo "<option selected value=\"ACTIVE\">ACTIVE ($mixname_list[ACTIVE])</option>\n";}
echo "</select>$NWB#vicidial_campaigns-list_order_mix$NWE";
}
echo "</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=31111111&lead_filter_id=$lead_filter_id\">Lead Filter</a>: </td><td align=left>";
if ($ALTmultiDISABLE > 0)
{
echo "<input type=hidden name=lead_filter_id value=\"$lead_filter_id\"> $ALTmultiLINK";
}
else
{
echo "<select size=1 name=lead_filter_id>\n";
echo "$filters_list";
echo "<option selected value=\"$lead_filter_id\">$lead_filter_id - $filtername_list[$lead_filter_id]</option>\n";
echo "</select>$NWB#vicidial_campaigns-lead_filter_id$NWE";
}
echo "</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Minimum Hopper Level: </td><td align=left><select size=1 name=hopper_level><option>1</option><option>5</option><option>10</option><option>20</option><option>50</option><option>100</option><option>200</option><option>500</option><option>700</option><option>1000</option><option>2000</option><option SELECTED>$hopper_level</option></select>$NWB#vicidial_campaigns-hopper_level$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Force Reset of Hopper: </td><td align=left><select size=1 name=reset_hopper><option>Y</option><option SELECTED>N</option></select>$NWB#vicidial_campaigns-force_reset_hopper$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Dial Method: </td><td align=left><select size=1 name=dial_method><option >MANUAL</option><option>RATIO</option><option>ADAPT_HARD_LIMIT</option><option>ADAPT_TAPERED</option><option>ADAPT_AVERAGE</option><option>INBOUND_MAN</option><option SELECTED>$dial_method</option></select>$NWB#vicidial_campaigns-dial_method$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Auto Dial Level: </td><td align=left><select size=1 name=auto_dial_level><option selected>$auto_dial_level</option>\n";
$adl=0;
while($adl <= $SSauto_dial_limit)
{
echo "<option>$adl</option>\n";
if ($adl < 1)
{$adl = ($adl + 1);}
else
{
if ($adl < 3)
{$adl = ($adl + 0.1);}
else
{
if ($adl < 4)
{$adl = ($adl + 0.25);}
else
{
if ($adl < 5)
{$adl = ($adl + 0.5);}
else
{
if ($adl < 10)
{$adl = ($adl + 1);}
else
{
if ($adl < 20)
{$adl = ($adl + 2);}
else
{
if ($adl < 40)
{$adl = ($adl + 5);}
else
{
if ($adl < 200)
{$adl = ($adl + 10);}
else
{
if ($adl < 400)
{$adl = ($adl + 50);}
else
{
if ($adl < 1000)
{$adl = ($adl + 100);}
else
{$adl = ($adl + 1);}
}
}
}
}
}
}
}
}
}
}
echo "<option>$adl</option></select>(0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Adapt Intensity Modifier: </td><td align=left><select size=1 name=adaptive_intensity>\n";
$n=40;
while ($n>=-40)
{
$dtl = 'Balanced';
if ($n<0) {$dtl = 'Less Intense';}
if ($n>0) {$dtl = 'More Intense';}
if ($n == $adaptive_intensity)
{echo "<option SELECTED value=\"$n\">$n - $dtl</option>\n";}
else
{echo "<option value=\"$n\">$n - $dtl</option>\n";}
$n--;
}
echo "</select> $NWB#vicidial_campaigns-adaptive_intensity$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=3111111&script_id=$script_id\">Script</a>: </td><td align=left>$script_id</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Get Call Launch: </td><td align=left>$get_call_launch</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center></FORM>\n";
echo "<center>\n";
if ($SSoutbound_autodial_active > 0)
{
echo "<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=44>\n";
echo "<input type=hidden name=DB value=$DB>\n";
echo "<input type=hidden name=stage value=list_activation>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<br><b>LISTS WITHIN THIS CAMPAIGN: &nbsp; $NWB#vicidial_campaign_lists$NWE</b>\n";
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$LISTlink='stage=LISTIDDOWN';
$NAMElink='stage=LISTNAMEDOWN';
$TALLYlink='stage=TALLYDOWN';
$ACTIVElink='stage=ACTIVEDOWN';
$CAMPAIGNlink='stage=CAMPAIGNDOWN';
$CALLDATElink='stage=CALLDATEDOWN';
$SQLorder='order by list_id';
if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';}
if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';}
if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';}
if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';}
if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';}
if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';}
if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';}
if (eregi("ACTIVEDOWN",$stage)) {$SQLorder='order by active desc'; $ACTIVElink='stage=ACTIVEUP';}
if (eregi("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';}
if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';}
if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';}
if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';}
$stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' group by list_id $SQLorder";
$rslt=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rslt);
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&$LISTlink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST ID</B></a></TD>";
echo "<TD><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&$NAMElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST NAME</B></a></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</B></TD>\n";
echo "<TD><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&$TALLYlink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LEADS COUNT</B></a></TD>\n";
echo "<TD COLSPAN=2><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&$ACTIVElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACTIVE</B></a></TD>";
echo "<TD><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&$CALLDATElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LAST CALL DATE</B></a></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>MODIFY</TD>\n";
echo "</TR>\n";
$o=0;
while ($lists_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=311&list_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td><font size=1> $row[3]</td>";
echo "<td><font size=1> $row[4]</td>";
echo "<td>";
if (ereg('Y',$row[4]))
{
$active_lists++;
$camp_lists .= "'$row[0]',";
echo "<input type=\"checkbox\" name=\"list_active_change[]\" value=\"$row[0]\" CHECKED>";
}
else
{
$inactive_lists++;
echo "<input type=\"checkbox\" name=\"list_active_change[]\" value=\"$row[0]\"";
}
echo "</td>";
echo "<td><font size=1> $row[5]</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=311&list_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "<TR><TD COLSPAN=7 ALIGN=CENTER><input type=submit value=\"SUBMIT ACTIVE LIST CHANGES\"></TD></TR>\n";
echo "</TABLE></center><BR></FORM>\n";
echo "<center><b>\n";
$filterSQL = $filtersql_list[$lead_filter_id];
$filterSQL = preg_replace("/\\\\/","",$filterSQL);
$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL);
if (strlen($filterSQL)>4)
{$fSQL = "and $filterSQL";}
else
{$fSQL = '';}
$camp_lists = eregi_replace(".$","",$camp_lists);
echo "This campaign has $active_lists active lists and $inactive_lists inactive lists<br><br>\n";
if ( ($display_leads_count == 'Y') and (strlen($camp_lists) > 3) )
{
# grab names of global statuses and statuses in the selected campaign
$stmt="SELECT status,status_name from vicidial_statuses order by status;";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$statuses_name_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
$stmt="SELECT status,status_name from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status;";
$rslt=mysql_query($stmt, $link);
$Cstatuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($Cstatuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$statuses_name_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
# end grab status names
echo "<br><b>STATUSES WITHIN THE ACTIVE LISTS FOR THIS CAMPAIGN:</b>\n";
echo " - <font size=1><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&stage=hide_leadscount\">HIDE</a></font><BR>";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>STATUS</td><td>STATUS NAME</td><td>CALLED</td><td>NOT CALLED</td></tr>\n";
$leads_in_list = 0;
$leads_in_list_N = 0;
$leads_in_list_Y = 0;
$stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id IN($camp_lists) group by status,called_since_last_reset order by status,called_since_last_reset";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
$lead_list['count'] = 0;
$lead_list['Y_count'] = 0;
$lead_list['N_count'] = 0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$lead_list['count'] = ($lead_list['count'] + $rowx[2]);
if ($rowx[1] == 'N')
{
$since_reset = 'N';
$since_resetX = 'Y';
}
else
{
$since_reset = 'Y';
$since_resetX = 'N';
}
$lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]);
$lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]);
#If opposite side is not set, it may not in the future so give it a value of zero
if (!isset($lead_list[$since_resetX][$rowx[0]]))
{
$lead_list[$since_resetX][$rowx[0]]=0;
}
$o++;
}
$o=0;
if ($lead_list['count'] > 0)
{
while (list($dispo,) = each($lead_list[$since_reset]))
{
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
if ($dispo == 'CBHOLD')
{
$CLB="<a href=\"$PHP_SELF?ADD=811&list_id=$list_id\">";
$CLE="</a>";
}
else
{
$CLB='';
$CLE='';
}
echo "<tr $bgcolor><td><font size=1>$CLB$dispo$CLE</td><td><font size=1>$statuses_name_list[$dispo]</td><td><font size=1>".$lead_list['Y'][$dispo]."</td><td><font size=1>".$lead_list['N'][$dispo]." </td></tr>\n";
$o++;
}
}
echo "<tr><td colspan=2><font size=1>SUBTOTALS</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n";
echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>TOTAL</td><td colspan=3 align=center><font size=1>$lead_list[count]</td></tr>\n";
echo "</table></center><br>\n";
unset($lead_list);
}
else
{
echo "<font size=1><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&stage=show_leadscount\">SHOW LEAD STATUSES IN THIS CAMPAIGN</a></font><BR><BR>";
}
if ($display_dialable_count == 'Y')
{
### call function to calculate and print dialable leads
dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL);
echo " - <font size=1><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id&stage=hide_dialable\">HIDE</a></font><BR><BR>";
}
else
{
echo "<a href=\"$PHP_SELF?ADD=73&campaign_id=$campaign_id\" target=\"_blank\">Popup Dialable Leads Count</a>";
echo " - <font size=1><a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id&stage=show_dialable\">SHOW</a></font><BR><BR>";
}
$stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
$hopper_leads = "$rowx[0]";
echo "This campaign has $hopper_leads leads in the dial hopper<br><br>\n";
echo "<a href=\"./AST_VICIDIAL_hopperlist.php?group=$campaign_id\">Click here to see what leads are in the hopper right now</a><br><br>\n";
echo "<a href=\"./AST_VDADstats.php?group=$campaign_id\">Click here to see a VDAD report for this campaign</a><BR><BR>\n";
}
echo "<a href=\"$PHP_SELF?ADD=81&campaign_id=$campaign_id\">Click here to see all CallBack Holds in this campaign</a><BR><BR>\n";
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=CAMPAIGNS&stage=$campaign_id\">Click here to see Admin changes to this campaign</a></FONT>\n";
}
echo "</b></center>\n";
echo "<br>\n";
### list of agent rank or skill-level for this campaign
echo "<center>\n";
echo "<br><b>AGENT RANKS FOR THIS CAMPAIGN:</b><br>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>USER</td><td> &nbsp; &nbsp; RANK</td><td> &nbsp; &nbsp; CALLS TODAY</td></tr>\n";
$stmt="SELECT vu.user,vca.campaign_rank,vca.calls_today,full_name from vicidial_campaign_agents vca, vicidial_users vu where campaign_id='$campaign_id' and active='Y' and vu.user=vca.user;";
$rsltx=mysql_query($stmt, $link);
$users_to_print = mysql_num_rows($rsltx);
$o=0;
while ($users_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
$o++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3&user=$rowx[0]\">$rowx[0]</a> - $rowx[3]</td><td><font size=1>$rowx[1]</td><td><font size=1>$rowx[2]</td></tr>\n";
}
echo "</table></center><br>\n";
echo "<a href=\"$PHP_SELF?ADD=52&campaign_id=$campaign_id&DB=$DB\">LOG ALL AGENTS OUT OF THIS CAMPAIGN</a><BR><BR>\n";
if ($LOGdelete_campaigns > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=51&campaign_id=$campaign_id\">DELETE THIS CAMPAIGN</a>\n";
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=31 or 34 and SUB=29 for list mixes
######################
if ( ( ($ADD==34) or ($ADD==31) ) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) )
{$ADD=30;} # send to not allowed screen if not in vicidial_user_groups allowed_campaigns list
if ( ($ADD==34) or ($ADD==31) )
{
if ($LOGmodify_campaigns==1)
{
##### CAMPAIGN LIST MIX SETTINGS #####
if ($SUB==29)
{
##### get list_id listings for dynamic pulldown
$stmt="SELECT list_id,list_name from vicidial_lists where campaign_id='$campaign_id' order by list_id";
$rslt=mysql_query($stmt, $link);
$mixlists_to_print = mysql_num_rows($rslt);
$mixlists_list="";
$o=0;
while ($mixlists_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$mixlists_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$mixlistsname_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
echo "<br><br><b>LIST MIXES FOR THIS CAMPAIGN: &nbsp; $NWB#vicidial_campaigns-list_order_mix$NWE</b><br>\n";
echo "<br><b>WARNING, we only recommend List Mix for advanced users, Please read the ViciDial Manager Manual</b><br>\n";
$stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id'";
$rslt=mysql_query($stmt, $link);
$statuses = mysql_num_rows($rslt);
if ($statuses > 0)
{
$rowy=mysql_fetch_row($rslt);
$LMdial_statuses=$rowy[0];
}
$stmt="SELECT vcl_id,vcl_name,campaign_id,list_mix_container,mix_method,status from vicidial_campaigns_list_mix where campaign_id='$campaign_id' order by status, vcl_id";
$rslt=mysql_query($stmt, $link);
$listmixes = mysql_num_rows($rslt);
$o=0;
while ($listmixes > $o)
{
$rowx=mysql_fetch_row($rslt);
$vcl_id=$rowx[0];
$o++;
if ($o < 2)
{$tablecolor='bgcolor="#99FF99"'; $bgcolor='bgcolor="#CCFFCC"';}
else
{
if (eregi("1$|3$|5$|7$|9$", $o))
{$tablecolor='bgcolor="#B9CBFD"'; $bgcolor='bgcolor="#9BB9FB"';}
else
{$tablecolor='bgcolor="#9BB9FB"'; $bgcolor='bgcolor="#B9CBFD"';}
}
echo "<a name=\"LINK_$vcl_id\"><BR>\n";
echo "<span id=\"LISTMIX$US$vcl_id$US$o\">";
echo "<TABLE width=740 cellspacing=3 $tablecolor>\n";
echo "<tr><td colspan=6>\n";
echo "<form action=\"$PHP_SELF#LINK_$vcl_id\" method=POST name=$vcl_id id=$vcl_id>\n";
echo "<input type=hidden name=ADD value=49>\n";
echo "<input type=hidden name=SUB value=29>\n";
echo "<input type=hidden name=stage value=\"MODIFY\">\n";
echo "<input type=hidden name=vcl_id value=\"$vcl_id\">\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<input type=hidden name=list_mix_container$US$vcl_id id=list_mix_container$US$vcl_id value=\"\">\n";
echo "<B>$vcl_id:</B>\n";
echo "<input type=text size=40 maxlength=50 name=vcl_name$US$vcl_id id=vcl_name$US$vcl_id value=\"$rowx[1]\">\n";
echo " &nbsp; &nbsp; <a href=\"$PHP_SELF?ADD=49&SUB=29&stage=DELMIX&campaign_id=$campaign_id&vcl_id=$vcl_id\">DELETE LIST MIX</a></td></tr>\n";
echo "<tr><td colspan=3>Status: \n";
if ($rowx[5]=='INACTIVE')
{
echo "<B>$rowx[5]</B>\n";
echo "<a href=\"$PHP_SELF?ADD=49&SUB=29&stage=SETACTIVE&campaign_id=$campaign_id&vcl_id=$vcl_id\"><font size=1>SET TO ACTIVE</font></a></td>\n";
}
else
{echo "<B>$rowx[5]</B></td>\n";}
echo "<td colspan=3>Method:\n";
echo "<select size=1 name=mix_method$US$vcl_id id=method$US$vcl_id><option value=\"EVEN_MIX\">EVEN_MIX</option><option value=\"IN_ORDER\">IN_ORDER</option><option value=\"RANDOM\">RANDOM</option><option SELECTED value=\"$rowx[4]\">$rowx[4]</option></select></td></tr>\n";
echo "<tr><td>LIST ID</td><td>PRIORITY</td><td>% MIX</td><td>STATUSES</td><td></td></tr>\n";
# list_id|order|percent|statuses|:list_id|order|percent|statuses|:...
# 101|1|40| A B NA -|:102|2|25| NEW -|:103|3|30| DROP CALLBK -|:101|4|5| DROP -|
# INSERT INTO vicidial_campaigns_list_mix values('TESTMIX','TESTCAMP List Mix','TESTCAMP','101|1|40| A B NA -|:102|2|25| NEW -|:103|3|30| DROP CALLBK -|:101|4|5| DROP -|','IN_ORDER','ACTIVE');
# INSERT INTO vicidial_campaigns_list_mix values('TESTMIX2','TESTCAMP List Mix2','TESTCAMP','101|1|20| A B -|:102|2|45| NEW -|:103|3|30| DROP CALLBK -|:101|4|5| DROP -|','IN_ORDER','ACTIVE');
# INSERT INTO vicidial_campaigns_list_mix values('TESTMIX3','TESTCAMP List Mix3','TESTCAMP','101|1|30| A NA -|:102|2|35| NEW -|:103|3|30| DROP CALLBK -|:101|4|5| DROP -|','IN_ORDER','ACTIVE');
$MIXentries = $MT;
$MIXentries = explode(":", $rowx[3]);
$Ms_to_print = (count($MIXentries) - 0);
$q=0;
while ($Ms_to_print > $q)
{
$MIXdetails = explode('|', $MIXentries[$q]);
$MIXdetailsLIST = $MIXdetails[0];
$dial_statuses = preg_replace("/ -$/","",$dial_statuses);
$Dstatuses = explode(" ", $dial_statuses);
$Ds_to_print = (count($Dstatuses) - 0);
$Dsql = '';
$r=0;
while ($Ds_to_print > $r)
{
$r++;
$Dsql .= "'$Dstatuses[$r]',";
}
$Dsql = preg_replace("/,$/","",$Dsql);
echo "<tr $bgcolor><td NOWRAP><font size=3>\n";
echo "<input type=hidden name=list_id$US$q$US$vcl_id id=list_id$US$q$US$vcl_id value=$MIXdetailsLIST>\n";
echo "<a href=\"$PHP_SELF?ADD=311&list_id=$MIXdetailsLIST\">List</a>: $MIXdetailsLIST &nbsp; <font size=1><a href=\"$PHP_SELF?ADD=49&SUB=29&stage=REMOVE&campaign_id=$campaign_id&vcl_id=$vcl_id&mix_container_item=$q&list_id=$MIXdetailsLIST#LINK_$vcl_id\">REMOVE</a></font></td>\n";
echo "<td><select size=1 name=priority$US$q$US$vcl_id id=priority$US$q$US$vcl_id>\n";
$n=40;
while ($n>=1)
{
echo "<option value=\"$n\">$n</option>\n";
$n = ($n-1);
}
echo "<option SELECTED value=\"$MIXdetails[1]\">$MIXdetails[1]</option></select></td>\n";
echo "<td><select size=1 name=\"percentage$US$q$US$vcl_id\" id=\"percentage$US$q$US$vcl_id\" onChange=\"mod_mix_percent('$vcl_id','$Ms_to_print')\">\n";
$n=100;
while ($n>=0)
{
echo "<option value=\"$n\">$n</option>\n";
$n = ($n-1);
}
echo "<option SELECTED value=\"$MIXdetails[2]\">$MIXdetails[2]</option></select></td>\n";
echo "<td><input type=hidden name=status$US$q$US$vcl_id id=status$US$q$US$vcl_id value=\"$MIXdetails[3]\"><input type=text size=20 maxlength=255 name=ROstatus$US$q$US$vcl_id id=ROstatus$US$q$US$vcl_id value=\"$MIXdetails[3]\" READONLY></td>\n";
echo "<td NOWRAP>\n";
echo "<select size=1 name=dial_status$US$q$US$vcl_id id=dial_status$US$q$US$vcl_id>\n";
echo "<option value=\"\"> - Select A Status - </option>\n";
echo "$dial_statuses_list";
echo "</select> <font size=2><B>\n";
echo "<a href=\"#\" onclick=\"mod_mix_status('ADD','$vcl_id','$q');return false;\">ADD</a> &nbsp; \n";
echo "<a href=\"#\" onclick=\"mod_mix_status('REMOVE','$vcl_id','$q');return false;\">REMOVE</a>\n";
echo "</font></B></td></tr>\n";
echo "</td></tr>\n";
$q++;
}
echo "<tr $bgcolor><td colspan=3 align=right><font size=2>\n";
echo "Difference %: <input type=text size=4 name=PCT_DIFF_$vcl_id id=PCT_DIFF_$vcl_id value=0 readonly>\n";
echo "</td>\n";
echo "<td colspan=2><input type=button name=submit_$vcl_id id=submit_$vcl_id value=\"SUBMIT\" onClick=\"submit_mix('$vcl_id','$Ms_to_print')\"> &nbsp; \n";
echo "<span id=ERROR_$vcl_id></span>\n";
echo "</form></td></tr>\n";
echo "<tr $bgcolor><td colspan=3 align=center VALIGN=BOTTOM><font size=2>\n";
echo "<form action=\"$PHP_SELF#LINK_$vcl_id\" method=POST name=ADD_$vcl_id id=ADD_$vcl_id>\n";
echo "<input type=hidden name=ADD value=49>\n";
echo "<input type=hidden name=SUB value=29>\n";
echo "<input type=hidden name=stage value=\"ADD\">\n";
echo "<input type=hidden name=vcl_id value=\"$vcl_id\">\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "List: <select size=1 name=list_id>\n";
echo "$mixlists_list";
echo "<option selected value=\"\">ADD ANOTHER ENTRY</option>\n";
echo "</select>\n";
if ($q > 39) {$AE_disabled = 'DISABLED';}
else {$AE_disabled = '';}
echo "<input type=submit name=submit value=\"ADD ENTRY\" $AE_disabled>\n";
echo "</form></td>\n";
$X='X';
echo "<td NOWRAP VALIGN=BOTTOM>\n";
echo "<form action=\"$PHP_SELF#LINK_$vcl_id\" method=POST name=DEFAULT_$vcl_id id=DEFAULT_$vcl_id>\n";
echo "<input type=hidden name=status$US$X$US$vcl_id id=status$US$X$US$vcl_id value=\"\"><input type=text size=20 maxlength=255 name=ROstatus$US$X$US$vcl_id id=ROstatus$US$X$US$vcl_id value=\"$LMdial_statuses\" READONLY>\n";
echo "<BR><font size=2><B>CHANGE: \n";
echo "<a href=\"#\" onclick=\"mod_mix_status('ALL','$vcl_id','$q');return false;\">ALL</a> &nbsp; \n";
echo "<a href=\"#\" onclick=\"mod_mix_status('EMPTY','$vcl_id','$q');return false;\">EMPTY</a>\n";
echo "</td><td NOWRAP VALIGN=MIDDLE>\n";
echo "<select size=1 name=dial_status$US$X$US$vcl_id id=dial_status$US$X$US$vcl_id>\n";
echo "<option value=\"\"> - Select A Status - </option>\n";
echo "$dial_statuses_list";
echo "</select> <font size=2><B>\n";
echo "<a href=\"#\" onclick=\"mod_mix_status('ADD','$vcl_id','X');return false;\">ADD</a> &nbsp; \n";
echo "<a href=\"#\" onclick=\"mod_mix_status('REMOVE','$vcl_id','X');return false;\">REMOVE</a>\n";
echo "</form></td></tr>\n";
echo "</table></span>\n";
}
echo "<br><br><B>ADD NEW LIST MIX</B><BR><form action=$PHP_SELF method=POST>\n";
echo "<table border=0>\n";
echo "<tr $bgcolor><td><form action=\"$PHP_SELF#LINK_$vcl_id\" method=POST>\n";
echo "<input type=hidden name=ADD value=49>\n";
echo "<input type=hidden name=SUB value=29>\n";
echo "<input type=hidden name=stage value=\"NEWMIX\">\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "Mix ID: <input type=text size=20 maxlength=20 name=vcl_id value=\"\"></td>\n";
echo "<td>Mix Name: <input type=text size=30 maxlength=50 name=vcl_name value=\"\"></td>\n";
echo "<td>Mix Method: ";
echo "<select size=1 name=mix_method><option value=\"EVEN_MIX\">EVEN_MIX</option><option value=\"IN_ORDER\">IN_ORDER</option><option value=\"RANDOM\">RANDOM</option></select></td></tr>\n";
echo "<tr $bgcolor><td>List: <select size=1 name=list_id>\n";
echo "$mixlists_list";
echo "</select></td>\n";
echo "<td>Dial Status: <select size=1 name=status>\n";
echo "$dial_statuses_list";
echo "</select></td>\n";
echo "<td> &nbsp; <input type=submit name=submit value=SUBMIT></form></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<br>\n";
}
}
echo "</TD></TR></TABLE></center>\n";
}
######################
# ADD=30 campaign not allowed
######################
if ($ADD==30)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "You do not have permission to view campaign $campaign_id\n";
}
######################
# ADD=32 display all campaign statuses
######################
if ($ADD==32)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>CUSTOM CAMPAIGN STATUSES LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr>\n";
echo "<td><B>CAMPAIGN</B></td>\n";
echo "<td><B>NAME</B></td>\n";
echo "<td><B>STATUSES</B></td>\n";
echo "<td><B>MODIFY</B></td>\n";
echo "</tr>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$o=0;
while ($campaigns_to_print > $o)
{
$row=mysql_fetch_row($rslt);
$campaigns_id_list[$o] = $row[0];
$campaigns_name_list[$o] = $row[1];
$o++;
}
$o=0;
while ($campaigns_to_print > $o)
{
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=31&SUB=22&campaign_id=$campaigns_id_list[$o]\">$campaigns_id_list[$o]</a></td>";
echo "<td><font size=1> $campaigns_name_list[$o] </td>";
echo "<td><font size=1> ";
$stmt="SELECT status from vicidial_campaign_statuses where campaign_id='$campaigns_id_list[$o]' order by status";
$rslt=mysql_query($stmt, $link);
$campstatus_to_print = mysql_num_rows($rslt);
$p=0;
while ( ($campstatus_to_print > $p) and ($p < 10) )
{
$row=mysql_fetch_row($rslt);
echo "$row[0] ";
$p++;
}
if ($p<1)
{echo "<font color=grey><DEL>NONE</DEL></font>";}
echo "</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=31&SUB=22&campaign_id=$campaigns_id_list[$o]\">MODIFY STATUSES</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=33 display all campaign hotkeys
######################
if ($ADD==33)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>CAMPAIGN HOTKEYS LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr>\n";
echo "<td><B>CAMPAIGN</B></td>\n";
echo "<td><B>NAME</B></td>\n";
echo "<td><B>HOTKEYS</B></td>\n";
echo "<td><B>MODIFY</B></td>\n";
echo "</tr>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$o=0;
while ($campaigns_to_print > $o)
{
$row=mysql_fetch_row($rslt);
$campaigns_id_list[$o] = $row[0];
$campaigns_name_list[$o] = $row[1];
$o++;
}
$o=0;
while ($campaigns_to_print > $o)
{
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=31&SUB=23&campaign_id=$campaigns_id_list[$o]\">$campaigns_id_list[$o]</a></td>";
echo "<td><font size=1> $campaigns_name_list[$o] </td>";
echo "<td><font size=1> ";
$stmt="SELECT status from vicidial_campaign_hotkeys where campaign_id='$campaigns_id_list[$o]' order by hotkey";
$rslt=mysql_query($stmt, $link);
$campstatus_to_print = mysql_num_rows($rslt);
$p=0;
while ( ($campstatus_to_print > $p) and ($p < 10) )
{
$row=mysql_fetch_row($rslt);
echo "$row[0] ";
$p++;
}
if ($p<1)
{echo "<font color=grey><DEL>NONE</DEL></font>";}
echo "</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=31&SUB=23&campaign_id=$campaigns_id_list[$o]\">MODIFY HOTKEYS</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=35 display all campaign lead recycle entries
######################
if ($ADD==35)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>CAMPAIGN LEAD RECYCLE LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr>\n";
echo "<td><B>CAMPAIGN</B></td>\n";
echo "<td><B>NAME</B></td>\n";
echo "<td><B>LEAD RECYCLES</B></td>\n";
echo "<td><B>MODIFY</B></td>\n";
echo "</tr>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$o=0;
while ($campaigns_to_print > $o)
{
$row=mysql_fetch_row($rslt);
$campaigns_id_list[$o] = $row[0];
$campaigns_name_list[$o] = $row[1];
$o++;
}
$o=0;
while ($campaigns_to_print > $o)
{
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=31&SUB=25&campaign_id=$campaigns_id_list[$o]\">$campaigns_id_list[$o]</a></td>";
echo "<td><font size=1> $campaigns_name_list[$o] </td>";
echo "<td><font size=1> ";
$stmt="SELECT status from vicidial_lead_recycle where campaign_id='$campaigns_id_list[$o]' order by status";
$rslt=mysql_query($stmt, $link);
$campstatus_to_print = mysql_num_rows($rslt);
$p=0;
while ( ($campstatus_to_print > $p) and ($p < 10) )
{
$row=mysql_fetch_row($rslt);
echo "$row[0] ";
$p++;
}
if ($p<1)
{echo "<font color=grey><DEL>NONE</DEL></font>";}
echo "</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=31&SUB=25&campaign_id=$campaigns_id_list[$o]\">MODIFY LEAD RECYCLES</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=36 display all campaign auto-alt dial entries
######################
if ($ADD==36)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>CAMPAIGN LEAD AUTO-ALT DIAL LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr>\n";
echo "<td><B>CAMPAIGN</B></td>\n";
echo "<td><B>NAME</B></td>\n";
echo "<td><B>AUTO-ALT DIAL</B></td>\n";
echo "<td><B>MODIFY</B></td>\n";
echo "</tr>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$o=0;
while ($campaigns_to_print > $o)
{
$row=mysql_fetch_row($rslt);
$campaigns_id_list[$o] = $row[0];
$campaigns_name_list[$o] = $row[1];
$o++;
}
$o=0;
while ($campaigns_to_print > $o)
{
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=31&SUB=26&campaign_id=$campaigns_id_list[$o]\">$campaigns_id_list[$o]</a></td>";
echo "<td><font size=1> $campaigns_name_list[$o] </td>";
echo "<td><font size=1> ";
$stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaigns_id_list[$o]';";
$rslt=mysql_query($stmt, $link);
$campstatus_to_print = mysql_num_rows($rslt);
$p=0;
while ( ($campstatus_to_print > $p) and ($p < 10) )
{
$row=mysql_fetch_row($rslt);
echo "$row[0] ";
$p++;
}
if (strlen($row[0])<3)
{echo "<font color=grey><DEL>NONE</DEL></font>";}
echo "</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=31&SUB=26&campaign_id=$campaigns_id_list[$o]\">MODIFY AUTO-ALT DIAL</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=37 display all campaign agent pause codes
######################
if ($ADD==37)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>CAMPAIGN AGENT PAUSE CODE LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr>\n";
echo "<td><B>CAMPAIGN</B></td>\n";
echo "<td><B>NAME</B></td>\n";
echo "<td><B>PAUSE CODES</B></td>\n";
echo "<td><B>MODIFY</B></td>\n";
echo "</tr>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$o=0;
while ($campaigns_to_print > $o)
{
$row=mysql_fetch_row($rslt);
$campaigns_id_list[$o] = $row[0];
$campaigns_name_list[$o] = $row[1];
$o++;
}
$o=0;
while ($campaigns_to_print > $o)
{
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=31&SUB=27&campaign_id=$campaigns_id_list[$o]\">$campaigns_id_list[$o]</a></td>";
echo "<td><font size=1> $campaigns_name_list[$o] </td>";
echo "<td><font size=1> ";
$stmt="SELECT pause_code from vicidial_pause_codes where campaign_id='$campaigns_id_list[$o]' order by pause_code;";
$rslt=mysql_query($stmt, $link);
$campstatus_to_print = mysql_num_rows($rslt);
$p=0;
while ( ($campstatus_to_print > $p) and ($p < 10) )
{
$row=mysql_fetch_row($rslt);
echo "$row[0] ";
$p++;
}
if ($p<1)
{echo "<font color=grey><DEL>NONE</DEL></font>";}
echo "</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=31&SUB=27&campaign_id=$campaigns_id_list[$o]\">MODIFY PAUSE CODES</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=39 display all campaign list mixes
######################
if ($ADD==39)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>CAMPAIGN LIST MIX LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr>\n";
echo "<td><B>CAMPAIGN</B></td>\n";
echo "<td><B>NAME</B></td>\n";
echo "<td><B>LIST MIX</B></td>\n";
echo "<td><B>MODIFY</B></td>\n";
echo "</tr>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$o=0;
while ($campaigns_to_print > $o)
{
$row=mysql_fetch_row($rslt);
$campaigns_id_list[$o] = $row[0];
$campaigns_name_list[$o] = $row[1];
$o++;
}
$o=0;
while ($campaigns_to_print > $o)
{
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=31&SUB=29&campaign_id=$campaigns_id_list[$o]\">$campaigns_id_list[$o]</a></td>";
echo "<td><font size=1> $campaigns_name_list[$o] </td>";
echo "<td><font size=1> ";
$stmt="SELECT vcl_id from vicidial_campaigns_list_mix where campaign_id='$campaigns_id_list[$o]' order by status,vcl_id;";
$rslt=mysql_query($stmt, $link);
$campstatus_to_print = mysql_num_rows($rslt);
$p=0;
while ( ($campstatus_to_print > $p) and ($p < 10) )
{
$row=mysql_fetch_row($rslt);
echo "$row[0] ";
$p++;
}
if ($p<1)
{echo "<font color=grey><DEL>NONE</DEL></font>";}
echo "</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=31&SUB=29&campaign_id=$campaigns_id_list[$o]\">MODIFY LIST MIX</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=301 display all campaign presets
######################
if ($ADD==301)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>CAMPAIGN PRESET LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr>\n";
echo "<td><B>CAMPAIGN</B></td>\n";
echo "<td><B>NAME</B></td>\n";
echo "<td><B>PRESETS</B></td>\n";
echo "<td><B>MODIFY</B></td>\n";
echo "</tr>\n";
$stmt="SELECT campaign_id,campaign_name,enable_xfer_presets from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$o=0;
while ($campaigns_to_print > $o)
{
$row=mysql_fetch_row($rslt);
$campaigns_id_list[$o] = $row[0];
$campaigns_name_list[$o] = $row[1];
$enable_xfer_presets_list[$o] = $row[2];
$o++;
}
$o=0;
$k=0;
while ($campaigns_to_print > $o)
{
if ($enable_xfer_presets_list[$o] == 'ENABLED')
{
if (eregi("1$|3$|5$|7$|9$", $k))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=31&SUB=27&campaign_id=$campaigns_id_list[$o]\">$campaigns_id_list[$o]</a></td>";
echo "<td><font size=1> $campaigns_name_list[$o] </td>";
echo "<td><font size=1> ";
$stmt="SELECT preset_name from vicidial_xfer_presets where campaign_id='$campaigns_id_list[$o]' order by preset_name;";
$rslt=mysql_query($stmt, $link);
$campstatus_to_print = mysql_num_rows($rslt);
$p=0;
while ( ($campstatus_to_print > $p) and ($p < 10) )
{
$row=mysql_fetch_row($rslt);
echo "$row[0] ";
$p++;
}
if ($p<1)
{echo "<font color=grey><DEL>NONE</DEL></font>";}
echo "</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=31&SUB=201&campaign_id=$campaigns_id_list[$o]\">MODIFY PRESETS</a></td></tr>\n";
$k++;
}
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=311 modify list info in the system
######################
if ($ADD==311)
{
if ($LOGmodify_lists==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=311&list_id=$list_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,time_zone_setting from vicidial_lists where list_id='$list_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$list_name = $row[1];
$campaign_id = $row[2];
$active = $row[3];
$list_description = $row[4];
$list_changedate = $row[5];
$list_lastcalldate = $row[6];
$reset_time = $row[7];
$agent_script_override = $row[8];
$campaign_cid_override = $row[9];
$am_message_exten_override = $row[10];
$drop_inbound_group_override = $row[11];
$xferconf_a_number = $row[12];
$xferconf_b_number = $row[13];
$xferconf_c_number = $row[14];
$xferconf_d_number = $row[15];
$xferconf_e_number = $row[16];
$web_form_address = $row[17];
$web_form_address_two = $row[18];
$time_zone_setting = $row[19];
# grab names of global statuses and statuses in the selected campaign
$stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_statuses order by status";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$statuses_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
$stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status";
$rslt=mysql_query($stmt, $link);
$Cstatuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($Cstatuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$statuses_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
# end grab status names
##### get scripts listings for pulldown
$Lscripts_list = "<option value=\"\">NONE - INACTIVE</option>\n";
$stmt="SELECT script_id,script_name from vicidial_scripts order by script_id";
$rslt=mysql_query($stmt, $link);
$scripts_to_print = mysql_num_rows($rslt);
$o=0;
while ($scripts_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$Lscripts_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$scriptname_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
##### get in-groups listings for dynamic drop in-group pulldown
$stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id";
$rslt=mysql_query($stmt, $link);
$Dgroups_to_print = mysql_num_rows($rslt);
$Dgroups_menu='';
$Dgroups_selected=0;
$o=0;
while ($Dgroups_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$Dgroups_menu .= "<option ";
if ($drop_inbound_group_override == "$rowx[0]")
{
$Dgroups_menu .= "SELECTED ";
$Dgroups_selected++;
}
$Dgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
if ($Dgroups_selected < 1)
{$Dgroups_menu .= "<option SELECTED value=\"\">---NONE---</option>\n";}
else
{$Dgroups_menu .= "<option value=\"\">---NONE---</option>\n";}
echo "<br>MODIFY A LISTS RECORD: $list_id<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=411>\n";
echo "<input type=hidden name=list_id value=\"$list_id\">\n";
echo "<input type=hidden name=old_campaign_id value=\"$campaign_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List ID: </td><td align=left><b>$list_id</b>$NWB#vicidial_lists-list_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List Name: </td><td align=left><input type=text name=list_name size=20 maxlength=20 value=\"$list_name\">$NWB#vicidial_lists-list_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List Description: </td><td align=left><input type=text name=list_description size=30 maxlength=255 value=\"$list_description\">$NWB#vicidial_lists-list_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id\">Campaign</a>: </td><td align=left><select size=1 name=campaign_id>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$campaigns_list='';
$o=0;
while ($campaigns_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "$campaigns_list";
echo "<option SELECTED>$campaign_id</option>\n";
echo "</select>$NWB#vicidial_lists-campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$active</option></select>$NWB#vicidial_lists-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Reset Lead-Called-Status for this list: </td><td align=left><select size=1 name=reset_list><option>Y</option><option SELECTED>N</option></select>$NWB#vicidial_lists-reset_list$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Reset Times: </td><td align=left><input type=text name=reset_time size=30 maxlength=100 value=\"$reset_time\">$NWB#vicidial_lists-reset_time$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List Change Date: </td><td align=left>$list_changedate &nbsp; $NWB#vicidial_lists-list_changedate$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List Last Call Date: </td><td align=left>$list_lastcalldate &nbsp; $NWB#vicidial_lists-list_lastcalldate$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right><a href=\"$PHP_SELF?ADD=3111111&script_id=$agent_script_override\">Agent Script Override</a>: </td><td align=left><select size=1 name=agent_script_override>\n";
echo "$Lscripts_list";
echo "<option selected value=\"$agent_script_override\">$agent_script_override - $scriptname_list[$agent_script_override]</option>\n";
echo "</select>$NWB#vicidial_lists-agent_script_override$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Campaign CID Override: </td><td align=left><input type=text name=campaign_cid_override size=20 maxlength=20 value=\"$campaign_cid_override\">$NWB#vicidial_lists-campaign_cid_override$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Answering Machine Message Override: </td><td align=left><input type=text name=am_message_exten_override id=am_message_exten_override size=50 maxlength=100 value=\"$am_message_exten_override\"> <a href=\"javascript:launch_chooser('am_message_exten_override','date',300);\">audio chooser</a> $NWB#vicidial_lists-am_message_exten_override$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Drop Inbound Group Override: </td><td align=left><select size=1 name=drop_inbound_group_override>";
echo "$Dgroups_menu";
echo "</select>$NWB#vicidial_lists-drop_inbound_group_override$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Web Form: </td><td align=left><input type=text name=web_form_address size=70 maxlength=1055 value=\"$web_form_address\">$NWB#vicidial_lists-web_form_address$NWE</td></tr>\n";
if ($SSenable_second_webform > 0)
{
echo "<tr bgcolor=#8EBCFD><td align=right>Web Form Two: </td><td align=left><input type=text name=web_form_address_two size=70 maxlength=1055 value=\"$web_form_address_two\">$NWB#vicidial_lists-web_form_address$NWE</td></tr>\n";
}
echo "<tr bgcolor=#8EBCFD><td align=right>Transfer-Conf Number 1 Override: </td><td align=left><input type=text name=xferconf_a_number size=20 maxlength=50 value=\"$xferconf_a_number\">$NWB#vicidial_lists-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Transfer-Conf Number 2 Override: </td><td align=left><input type=text name=xferconf_b_number size=20 maxlength=50 value=\"$xferconf_b_number\">$NWB#vicidial_lists-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Transfer-Conf Number 3 Override: </td><td align=left><input type=text name=xferconf_c_number size=20 maxlength=50 value=\"$xferconf_c_number\">$NWB#vicidial_lists-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Transfer-Conf Number 4 Override: </td><td align=left><input type=text name=xferconf_d_number size=20 maxlength=50 value=\"$xferconf_d_number\">$NWB#vicidial_lists-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Transfer-Conf Number 5 Override: </td><td align=left><input type=text name=xferconf_e_number size=20 maxlength=50 value=\"$xferconf_e_number\">$NWB#vicidial_lists-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Time Zone Setting: </td><td align=left><select size=1 name=time_zone_setting><option>COUNTRY_AND_AREA_CODE</option><option>POSTAL_CODE</option><option>NANPA_PREFIX</option><option>OWNER_TIME_ZONE_CODE</option><option SELECTED>$time_zone_setting</option></select>$NWB#vicidial_lists-time_zone_setting$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
echo "<center>\n";
echo "<br><b>STATUSES WITHIN THIS LIST:</b><br>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>STATUS</td><td>STATUS NAME</td><td>CALLED</td><td>NOT CALLED</td></tr>\n";
$leads_in_list = 0;
$leads_in_list_N = 0;
$leads_in_list_Y = 0;
$stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
$lead_list['count'] = 0;
$lead_list['Y_count'] = 0;
$lead_list['N_count'] = 0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$lead_list['count'] = ($lead_list['count'] + $rowx[2]);
if ($rowx[1] == 'N')
{
$since_reset = 'N';
$since_resetX = 'Y';
}
else
{
$since_reset = 'Y';
$since_resetX = 'N';
}
$lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]);
$lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]);
#If opposite side is not set, it may not in the future so give it a value of zero
if (!isset($lead_list[$since_resetX][$rowx[0]]))
{
$lead_list[$since_resetX][$rowx[0]]=0;
}
$o++;
}
$o=0;
if ($lead_list['count'] > 0)
{
while (list($dispo,) = each($lead_list[$since_reset]))
{
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
if ($dispo == 'CBHOLD')
{
$CLB="<a href=\"$PHP_SELF?ADD=811&list_id=$list_id\">";
$CLE="</a>";
}
else
{
$CLB='';
$CLE='';
}
echo "<tr $bgcolor><td><font size=1>$CLB$dispo$CLE</td><td><font size=1>$statuses_list[$dispo]</td><td><font size=1>".$lead_list['Y'][$dispo]."</td><td><font size=1>".$lead_list['N'][$dispo]." </td></tr>\n";
$o++;
}
}
echo "<tr><td colspan=2><font size=1>SUBTOTALS</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n";
echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>TOTAL</td><td colspan=3 align=center><font size=1>$lead_list[count]</td></tr>\n";
echo "</table></center><br>\n";
unset($lead_list);
echo "<center>\n";
echo "<br><b>TIME ZONES WITHIN THIS LIST:</b><br>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>GMT OFFSET NOW (local time)</td><td>CALLED</td><td>NOT CALLED</td></tr>\n";
$stmt="SELECT gmt_offset_now,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by gmt_offset_now,called_since_last_reset order by gmt_offset_now,called_since_last_reset";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
$plus='+';
$lead_list['count'] = 0;
$lead_list['Y_count'] = 0;
$lead_list['N_count'] = 0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$lead_list['count'] = ($lead_list['count'] + $rowx[2]);
if ($rowx[1] == 'N')
{
$since_reset = 'N';
$since_resetX = 'Y';
}
else
{
$since_reset = 'Y';
$since_resetX = 'N';
}
$lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]);
$lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]);
#If opposite side is not set, it may not in the future so give it a value of zero
if (!isset($lead_list[$since_resetX][$rowx[0]]))
{
$lead_list[$since_resetX][$rowx[0]]=0;
}
$o++;
}
if ($lead_list['count'] > 0)
{
while (list($tzone,) = each($lead_list[$since_reset]))
{
$LOCALzone=3600 * $tzone;
$LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone);
if ($tzone >= 0) {$DISPtzone = "$plus$tzone";}
else {$DISPtzone = "$tzone";}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1>".$DISPtzone." &nbsp; &nbsp; ($LOCALdate)</td><td><font size=1>".$lead_list['Y'][$tzone]."</td><td><font size=1>".$lead_list['N'][$tzone]."</td></tr>\n";
}
}
echo "<tr><td><font size=1>SUBTOTALS</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n";
echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>TOTAL</td><td colspan=2 align=center><font size=1>$lead_list[count]</td></tr>\n";
echo "</table></center><br>\n";
unset($lead_list);
echo "<center>\n";
echo "<br><b>OWNERS WITHIN THIS LIST:</b><br>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>OWNER</td><td>CALLED</td><td>NOT CALLED</td></tr>\n";
$leads_in_list = 0;
$leads_in_list_N = 0;
$leads_in_list_Y = 0;
$stmt="SELECT owner,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by owner,called_since_last_reset order by owner,called_since_last_reset";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$owners_to_print = mysql_num_rows($rslt);
$o=0;
$lead_list['count'] = 0;
$lead_list['Y_count'] = 0;
$lead_list['N_count'] = 0;
while ($owners_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$lead_list['count'] = ($lead_list['count'] + $rowx[2]);
if ($rowx[1] == 'N')
{
$since_reset = 'N';
$since_resetX = 'Y';
}
else
{
$since_reset = 'Y';
$since_resetX = 'N';
}
$lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]);
$lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]);
#If opposite side is not set, it may not in the future so give it a value of zero
if (!isset($lead_list[$since_resetX][$rowx[0]]))
{
$lead_list[$since_resetX][$rowx[0]]=0;
}
$o++;
}
$o=0;
if ($lead_list['count'] > 0)
{
while (list($owner,) = each($lead_list[$since_reset]))
{
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
$CLB='';
$CLE='';
echo "<tr $bgcolor><td><font size=1>$CLB$owner$CLE</td><td><font size=1>".$lead_list['Y'][$owner]."</td><td><font size=1>".$lead_list['N'][$owner]." </td></tr>\n";
$o++;
}
}
echo "<tr><td><font size=1>SUBTOTALS</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n";
echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>TOTAL</td><td colspan=3 align=center><font size=1>$lead_list[count]</td></tr>\n";
echo "</table></center><br>\n";
unset($lead_list);
echo "<center>\n";
echo "<br><b>RANKS WITHIN THIS LIST:</b><br>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>RANK</td><td>CALLED</td><td>NOT CALLED</td></tr>\n";
$leads_in_list = 0;
$leads_in_list_N = 0;
$leads_in_list_Y = 0;
$stmt="SELECT rank,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by rank,called_since_last_reset order by rank,called_since_last_reset";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$ranks_to_print = mysql_num_rows($rslt);
$o=0;
$lead_list['count'] = 0;
$lead_list['Y_count'] = 0;
$lead_list['N_count'] = 0;
while ($ranks_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$lead_list['count'] = ($lead_list['count'] + $rowx[2]);
if ($rowx[1] == 'N')
{
$since_reset = 'N';
$since_resetX = 'Y';
}
else
{
$since_reset = 'Y';
$since_resetX = 'N';
}
$lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]);
$lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]);
#If opposite side is not set, it may not in the future so give it a value of zero
if (!isset($lead_list[$since_resetX][$rowx[0]]))
{
$lead_list[$since_resetX][$rowx[0]]=0;
}
$o++;
}
$o=0;
if ($lead_list['count'] > 0)
{
while (list($rank,) = each($lead_list[$since_reset]))
{
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
$CLB='';
$CLE='';
echo "<tr $bgcolor><td><font size=1>$CLB$rank$CLE</td><td><font size=1>".$lead_list['Y'][$rank]."</td><td><font size=1>".$lead_list['N'][$rank]." </td></tr>\n";
$o++;
}
}
echo "<tr><td><font size=1>SUBTOTALS</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n";
echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>TOTAL</td><td colspan=3 align=center><font size=1>$lead_list[count]</td></tr>\n";
echo "</table></center><br>\n";
unset($lead_list);
$leads_in_list = 0;
$leads_in_list_N = 0;
$leads_in_list_Y = 0;
$stmt="SELECT status, if(called_count >= 100, 100, called_count), count(*) from vicidial_list where list_id='$list_id' group by status, if(called_count >= 100, 100, called_count) order by status,called_count";
$rslt=mysql_query($stmt, $link);
$status_called_to_print = mysql_num_rows($rslt);
$o=0;
$sts=0;
$first_row=1;
$all_called_first=1000;
$all_called_last=0;
while ($status_called_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$leads_in_list = ($leads_in_list + $rowx[2]);
$count_statuses[$o] = $rowx[0];
$count_called[$o] = $rowx[1];
$count_count[$o] = $rowx[2];
$all_called_count[$rowx[1]] = ($all_called_count[$rowx[1]] + $rowx[2]);
if ( (strlen($status[$sts]) < 1) or ($status[$sts] != "$rowx[0]") )
{
if ($first_row) {$first_row=0;}
else {$sts++;}
$status[$sts] = "$rowx[0]";
$status_called_first[$sts] = "$rowx[1]";
if ($status_called_first[$sts] < $all_called_first) {$all_called_first = $status_called_first[$sts];}
}
$leads_in_sts[$sts] = ($leads_in_sts[$sts] + $rowx[2]);
$status_called_last[$sts] = "$rowx[1]";
if ($status_called_last[$sts] > $all_called_last) {$all_called_last = $status_called_last[$sts];}
$o++;
}
echo "<center>\n";
echo "<br><b>CALLED COUNTS WITHIN THIS LIST:</b><br>\n";
echo "<TABLE width=500 cellspacing=1>\n";
echo "<tr><td align=left><font size=1>STATUS</td><td align=center><font size=1>STATUS NAME</td>";
$first = $all_called_first;
while ($first <= $all_called_last)
{
if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';}
else{$AB='bgcolor="#E0FFFF"';}
if ($first >= 100) {$Fplus='+';}
else {$Fplus='';}
echo "<td align=center $AB><font size=1>$first$Fplus</td>";
$first++;
}
echo "<td align=center><font size=1>SUBTOTAL</td></tr>\n";
$sts=0;
$statuses_called_to_print = count($status);
while ($statuses_called_to_print > $sts)
{
$Pstatus = $status[$sts];
if (eregi("1$|3$|5$|7$|9$", $sts))
{$bgcolor='bgcolor="#B9CBFD"'; $AB='bgcolor="#9BB9FB"';}
else
{$bgcolor='bgcolor="#9BB9FB"'; $AB='bgcolor="#B9CBFD"';}
# echo "$status[$sts]|$status_called_first[$sts]|$status_called_last[$sts]|$leads_in_sts[$sts]|\n";
# echo "$status[$sts]|";
echo "<tr $bgcolor><td><font size=1>$Pstatus</td><td><font size=1>$statuses_list[$Pstatus]</td>";
$first = $all_called_first;
while ($first <= $all_called_last)
{
if (eregi("1$|3$|5$|7$|9$", $sts))
{
if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#9BB9FB"';}
else{$AB='bgcolor="#B9CBFD"';}
}
else
{
if (eregi("0$|2$|4$|6$|8$", $first)) {$AB='bgcolor="#9BB9FB"';}
else{$AB='bgcolor="#B9CBFD"';}
}
$called_printed=0;
$o=0;
while ($status_called_to_print > $o)
{
if ( ($count_statuses[$o] == "$Pstatus") and ($count_called[$o] == "$first") )
{
$called_printed++;
echo "<td $AB><font size=1> $count_count[$o]</td>";
}
$o++;
}
if (!$called_printed)
{echo "<td $AB><font size=1> &nbsp;</td>";}
$first++;
}
echo "<td><font size=1>$leads_in_sts[$sts]</td></tr>\n\n";
$sts++;
}
echo "<tr><td align=center colspan=2><b><font size=1>TOTAL</td>";
$first = $all_called_first;
while ($first <= $all_called_last)
{
if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';}
else{$AB='bgcolor="#E0FFFF"';}
echo "<td align=center $AB><b><font size=1>$all_called_count[$first]</td>";
$first++;
}
echo "<td align=center><b><font size=1>$leads_in_list</td></tr>\n";
echo "</table></center><br>\n";
echo "<center><b>\n";
if ($SScustom_fields_enabled > 0)
{
$stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id';";
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
echo "<br><br><a href=\"./admin_lists_custom.php?action=MODIFY_CUSTOM_FIELDS&list_id=$list_id\">Custom fields defined for this list: $rowx[0]</a><BR>\n";
}
echo "<br><br><a href=\"$PHP_SELF?ADD=811&list_id=$list_id\">Click here to see all CallBack Holds in this list</a><BR>\n";
echo "<br><br><a href=\"./list_download.php?list_id=$list_id\">Click here to download this list</a><BR><BR>\n";
if ($LOGdelete_lists > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=511&list_id=$list_id\">DELETE THIS LIST</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=LISTS&stage=$list_id\">Click here to see Admin changes to this list</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=3111 modify in-group info in the system
######################
if ($ADD==3111)
{
if ($LOGmodify_ingroups==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=3111&group_id=$group_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,ignore_list_script_override,extension_appended_cidname,uniqueid_status_display,uniqueid_status_prefix,hold_time_option_minimum,hold_time_option_press_filename,hold_time_option_callmenu,onhold_prompt_no_block,onhold_prompt_seconds,hold_time_option_no_block,hold_time_option_prompt_seconds,hold_time_second_option,hold_time_third_option,wait_hold_option_priority,wait_time_option,wait_time_second_option,wait_time_third_option,wait_time_option_seconds,wait_time_option_exten,wait_time_option_voicemail,wait_time_option_xfer_group,wait_time_option_callmenu,wait_time_option_callback_filename,wait_time_option_callback_list_id,wait_time_option_press_filename,wait_time_option_no_block,wait_time_option_prompt_seconds,timer_action_destination,calculate_estimated_hold_seconds,add_lead_url,eht_minimum_prompt_filename, eht_minimum_prompt_no_block, eht_minimum_prompt_seconds,on_hook_ring_time from vicidial_inbound_groups where group_id='$group_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$group_name = $row[1];
$group_color = $row[2];
$active = $row[3];
$web_form_address = stripslashes($row[4]);
$voicemail_ext = $row[5];
$next_agent_call = $row[6];
$fronter_display = $row[7];
$script_id = $row[8];
$get_call_launch = $row[9];
$xferconf_a_dtmf = $row[10];
$xferconf_a_number = $row[11];
$xferconf_b_dtmf = $row[12];
$xferconf_b_number = $row[13];
$drop_call_seconds = $row[14];
$drop_action = $row[15];
$drop_exten = $row[16];
$call_time_id = $row[17];
$after_hours_action = $row[18];
$after_hours_message_filename = $row[19];
$after_hours_exten = $row[20];
$after_hours_voicemail = $row[21];
$welcome_message_filename = $row[22];
$moh_context = $row[23];
$onhold_prompt_filename = $row[24];
$prompt_interval = $row[25];
$agent_alert_exten = $row[26];
$agent_alert_delay = $row[27];
$default_xfer_group = $row[28];
$queue_priority = $row[29];
$drop_inbound_group = $row[30];
$ingroup_recording_override = $row[31];
$ingroup_rec_filename = $row[32];
$afterhours_xfer_group = $row[33];
$qc_enabled = $row[34];
$qc_statuses = $row[35];
$qc_shift_id = $row[36];
$qc_get_record_launch = $row[37];
$qc_show_recording = $row[38];
$qc_web_form_address = stripslashes($row[39]);
$qc_script = $row[40];
$play_place_in_line = $row[41];
$play_estimate_hold_time = $row[42];
$hold_time_option = $row[43];
$hold_time_option_seconds = $row[44];
$hold_time_option_exten = $row[45];
$hold_time_option_voicemail = $row[46];
$hold_time_option_xfer_group = $row[47];
$hold_time_option_callback_filename = $row[48];
$hold_time_option_callback_list_id = $row[49];
$hold_recall_xfer_group = $row[50];
$no_delay_call_route = $row[51];
$play_welcome_message = $row[52];
$answer_sec_pct_rt_stat_one = $row[53];
$answer_sec_pct_rt_stat_two = $row[54];
$default_group_alias = $row[55];
$no_agent_no_queue = $row[56];
$no_agent_action = $row[57];
$no_agent_action_value = $row[58];
$web_form_address_two = stripslashes($row[59]);
$timer_action = $row[60];
$timer_action_message = $row[61];
$timer_action_seconds = $row[62];
$start_call_url = $row[63];
$dispo_call_url = $row[64];
$xferconf_c_number = $row[65];
$xferconf_d_number = $row[66];
$xferconf_e_number = $row[67];
$ignore_list_script_override = $row[68];
$extension_appended_cidname = $row[69];
$uniqueid_status_display = $row[70];
$uniqueid_status_prefix = $row[71];
$hold_time_option_minimum = $row[72];
$hold_time_option_press_filename = $row[73];
$hold_time_option_callmenu = $row[74];
$onhold_prompt_no_block = $row[75];
$onhold_prompt_seconds = $row[76];
$hold_time_option_no_block = $row[77];
$hold_time_option_prompt_seconds = $row[78];
$hold_time_second_option = $row[79];
$hold_time_third_option = $row[80];
$wait_hold_option_priority = $row[81];
$wait_time_option = $row[82];
$wait_time_second_option = $row[83];
$wait_time_third_option = $row[84];
$wait_time_option_seconds = $row[85];
$wait_time_option_exten = $row[86];
$wait_time_option_voicemail = $row[87];
$wait_time_option_xfer_group = $row[88];
$wait_time_option_callmenu = $row[89];
$wait_time_option_callback_filename = $row[90];
$wait_time_option_callback_list_id = $row[91];
$wait_time_option_press_filename = $row[92];
$wait_time_option_no_block = $row[93];
$wait_time_option_prompt_seconds = $row[94];
$timer_action_destination = $row[95];
$calculate_estimated_hold_seconds = $row[96];
$add_lead_url = $row[97];
$eht_minimum_prompt_filename = $row[98];
$eht_minimum_prompt_no_block = $row[99];
$eht_minimum_prompt_seconds = $row[100];
$on_hook_ring_time = $row[101];
##### get callmenu listings for dynamic pulldown
$stmt="SELECT menu_id,menu_name from vicidial_call_menu order by menu_id";
$rslt=mysql_query($stmt, $link);
$Xmenus_to_print = mysql_num_rows($rslt);
$o=0;
$Xmenuslist='';
$Wmenuslist='';
while ($Xmenus_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$Xmenuslist .= "<option ";
$Wmenuslist .= "<option ";
if ($hold_time_option_callmenu == "$rowx[0]")
{
$Xmenuslist .= "SELECTED ";
$Xmenus_selected++;
}
if ($wait_time_option_callmenu == "$rowx[0]")
{
$Wmenuslist .= "SELECTED ";
$Wmenus_selected++;
}
$Xmenuslist .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$Wmenuslist .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
if ($Xmenus_selected < 1)
{$Xmenuslist .= "<option SELECTED value=\"---NONE---\">---NONE---</option>\n";}
if ($Wmenus_selected < 1)
{$Wmenuslist .= "<option SELECTED value=\"---NONE---\">---NONE---</option>\n";}
##### get in-groups listings for dynamic pulldown
$stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id";
$rslt=mysql_query($stmt, $link);
$Xgroups_to_print = mysql_num_rows($rslt);
$Xgroups_menu='';
$Xgroups_selected=0;
$Dgroups_menu='';
$Dgroups_selected=0;
$Agroups_menu='';
$Agroups_selected=0;
$Hgroups_menu='';
$Hgroups_selected=0;
$Wgroups_menu='';
$Wgroups_selected=0;
$Tgroups_menu='';
$Tgroups_selected=0;
$o=0;
while ($Xgroups_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$Xgroups_menu .= "<option ";
$Dgroups_menu .= "<option ";
$Agroups_menu .= "<option ";
$Tgroups_menu .= "<option ";
$Wgroups_menu .= "<option ";
$Hgroups_menu .= "<option ";
if ($default_xfer_group == "$rowx[0]")
{
$Xgroups_menu .= "SELECTED ";
$Xgroups_selected++;
}
if ($drop_inbound_group == "$rowx[0]")
{
$Dgroups_menu .= "SELECTED ";
$Dgroups_selected++;
}
if ($afterhours_xfer_group == "$rowx[0]")
{
$Agroups_menu .= "SELECTED ";
$Agroups_selected++;
}
if ($hold_time_option_xfer_group == "$rowx[0]")
{
$Tgroups_menu .= "SELECTED ";
$Tgroups_selected++;
}
if ($wait_time_option_xfer_group == "$rowx[0]")
{
$Wgroups_menu .= "SELECTED ";
$Wgroups_selected++;
}
if ($hold_recall_xfer_group == "$rowx[0]")
{
$Hgroups_menu .= "SELECTED ";
$Hgroups_selected++;
}
$Xgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$Dgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
if ($group_id!=$rowx[0])
{
$Agroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$Tgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$Wgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$Hgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
}
$o++;
}
if ($Xgroups_selected < 1)
{$Xgroups_menu .= "<option SELECTED value=\"---NONE---\">---NONE---</option>\n";}
else
{$Xgroups_menu .= "<option value=\"---NONE---\">---NONE---</option>\n";}
if ($Dgroups_selected < 1)
{$Dgroups_menu .= "<option SELECTED value=\"---NONE---\">---NONE---</option>\n";}
else
{$Dgroups_menu .= "<option value=\"---NONE---\">---NONE---</option>\n";}
if ($Agroups_selected < 1)
{$Agroups_menu .= "<option SELECTED value=\"---NONE---\">---NONE---</option>\n";}
else
{$Agroups_menu .= "<option value=\"---NONE---\">---NONE---</option>\n";}
if ($Tgroups_selected < 1)
{$Tgroups_menu .= "<option SELECTED value=\"---NONE---\">---NONE---</option>\n";}
else
{$Tgroups_menu .= "<option value=\"---NONE---\">---NONE---</option>\n";}
if ($Wgroups_selected < 1)
{$Wgroups_menu .= "<option SELECTED value=\"---NONE---\">---NONE---</option>\n";}
else
{$Wgroups_menu .= "<option value=\"---NONE---\">---NONE---</option>\n";}
if ($Hgroups_selected < 1)
{$Hgroups_menu .= "<option SELECTED value=\"---NONE---\">---NONE---</option>\n";}
else
{$Hgroups_menu .= "<option value=\"---NONE---\">---NONE---</option>\n";}
echo "<br>MODIFY A GROUPS RECORD: $row[0]<form action=$PHP_SELF method=POST name=admin_form id=admin_form>\n";
echo "<input type=hidden name=ADD value=4111>\n";
echo "<input type=hidden name=group_id value=\"$row[0]\">\n";
echo "<input type=hidden name=DB value=\"$DB\">\n";
echo "<input type=hidden name=stage value=\"SUBMIT\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Group ID: </td><td align=left><b>$row[0]</b>$NWB#vicidial_inbound_groups-group_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Group Name: </td><td align=left><input type=text name=group_name size=30 maxlength=30 value=\"$row[1]\">$NWB#vicidial_inbound_groups-group_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Group Color: </td><td align=left bgcolor=\"$row[2]\" id=\"group_color_td\"><input type=text name=group_color size=7 maxlength=7 value=\"$row[2]\">$NWB#vicidial_inbound_groups-group_color$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$active</option></select>$NWB#vicidial_inbound_groups-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Web Form: </td><td align=left><input type=text name=web_form_address size=70 maxlength=1055 value=\"$web_form_address\">$NWB#vicidial_inbound_groups-web_form_address$NWE</td></tr>\n";
if ($SSenable_second_webform > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Web Form Two: </td><td align=left><input type=text name=web_form_address_two size=70 maxlength=1055 value=\"$web_form_address_two\">$NWB#vicidial_inbound_groups-web_form_address$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>oldest_inbound_call_start</option><option>oldest_inbound_call_finish</option><option>overall_user_level</option><option>inbound_group_rank</option><option>campaign_rank</option><option>fewest_calls</option><option>fewest_calls_campaign</option><option>longest_wait_time</option><option>ring_all</option><option SELECTED>$next_agent_call</option></select>$NWB#vicidial_inbound_groups-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Queue Priority: </td><td align=left><select size=1 name=queue_priority>\n";
$n=99;
while ($n>=-99)
{
$dtl = 'Even';
if ($n<0) {$dtl = 'Lower';}
if ($n>0) {$dtl = 'Higher';}
if ($n == $queue_priority)
{echo "<option SELECTED value=\"$n\">$n - $dtl</option>\n";}
else
{echo "<option value=\"$n\">$n - $dtl</option>\n";}
$n--;
}
echo "</select> $NWB#vicidial_inbound_groups-queue_priority$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>On-Hook Ring Time: </td><td align=left><input type=text name=on_hook_ring_time size=5 maxlength=4 value=\"$on_hook_ring_time\">$NWB#vicidial_inbound_groups-on_hook_ring_time$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Fronter Display: </td><td align=left><select size=1 name=fronter_display><option>Y</option><option>N</option><option SELECTED>$fronter_display</option></select>$NWB#vicidial_inbound_groups-fronter_display$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=3111111&script_id=$script_id\">Script</a>: </td><td align=left><select size=1 name=script_id>\n";
echo "$scripts_list";
echo "<option selected value=\"$script_id\">$script_id - $scriptname_list[$script_id]</option>\n";
echo "</select>$NWB#vicidial_inbound_groups-ingroup_script$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Ignore List Script Override: </td><td align=left><select size=1 name=ignore_list_script_override><option>Y</option><option>N</option><option SELECTED>$ignore_list_script_override</option></select>$NWB#vicidial_inbound_groups-ignore_list_script_override$NWE</td></tr>\n";
$eswHTML=''; $cfwHTML='';
if ($SSenable_second_webform > 0)
{$eswHTML = '<option>WEBFORMTWO</option>';}
if ($SScustom_fields_enabled > 0)
{$cfwHTML = '<option>FORM</option>';}
echo "<tr bgcolor=#B6D3FC><td align=right>Get Call Launch: </td><td align=left><select size=1 name=get_call_launch><option selected>NONE</option><option>SCRIPT</option><option>WEBFORM</option>$eswHTML$cfwHTML<option selected>$get_call_launch</option></select>$NWB#vicidial_inbound_groups-get_call_launch$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Transfer-Conf DTMF 1: </td><td align=left><input type=text name=xferconf_a_dtmf size=20 maxlength=50 value=\"$xferconf_a_dtmf\">$NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Transfer-Conf Number 1: </td><td align=left><input type=text name=xferconf_a_number size=20 maxlength=50 value=\"$xferconf_a_number\">$NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Transfer-Conf DTMF 2: </td><td align=left><input type=text name=xferconf_b_dtmf size=20 maxlength=50 value=\"$xferconf_b_dtmf\">$NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Transfer-Conf Number 2: </td><td align=left><input type=text name=xferconf_b_number size=20 maxlength=50 value=\"$xferconf_b_number\">$NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Transfer-Conf Number 3: </td><td align=left><input type=text name=xferconf_c_number size=20 maxlength=50 value=\"$xferconf_c_number\">$NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Transfer-Conf Number 4: </td><td align=left><input type=text name=xferconf_d_number size=20 maxlength=50 value=\"$xferconf_d_number\">$NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Transfer-Conf Number 5: </td><td align=left><input type=text name=xferconf_e_number size=20 maxlength=50 value=\"$xferconf_e_number\">$NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Timer Action: </td><td align=left><select size=1 name=timer_action><option selected>NONE</option><option>D1_DIAL</option><option>D2_DIAL</option><option>D3_DIAL</option><option>D4_DIAL</option><option>D5_DIAL</option><option>MESSAGE_ONLY</option><option>WEBFORM</option>$eswHTML<option>HANGUP</option><option>CALLMENU</option><option>EXTENSION</option><option>IN_GROUP</option><option selected>$timer_action</option></select>$NWB#vicidial_inbound_groups-timer_action$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Timer Action Message: </td><td align=left><input type=text name=timer_action_message size=50 maxlength=255 value=\"$timer_action_message\">$NWB#vicidial_inbound_groups-timer_action_message$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Timer Action Seconds: </td><td align=left><input type=text name=timer_action_seconds size=10 maxlength=10 value=\"$timer_action_seconds\">$NWB#vicidial_inbound_groups-timer_action_seconds$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Timer Action Destination: </td><td align=left><input type=text name=timer_action_destination size=25 maxlength=30 value=\"$timer_action_destination\">$NWB#vicidial_inbound_groups-timer_action_destination$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Drop Call Seconds: </td><td align=left><input type=text name=drop_call_seconds size=5 maxlength=4 value=\"$drop_call_seconds\">$NWB#vicidial_inbound_groups-drop_call_seconds$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Drop Action: </td><td align=left><select size=1 name=drop_action><option>HANGUP</option><option>MESSAGE</option><option>VOICEMAIL</option><option>IN_GROUP</option><option SELECTED>$drop_action</option></select>$NWB#vicidial_inbound_groups-drop_action$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Drop Exten: </td><td align=left><input type=text name=drop_exten size=10 maxlength=20 value=\"$drop_exten\">$NWB#vicidial_inbound_groups-drop_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Voicemail: </td><td align=left><input type=text name=voicemail_ext id=voicemail_ext size=12 maxlength=10 value=\"$voicemail_ext\"> <a href=\"javascript:launch_vm_chooser('voicemail_ext','vm',500);\">voicemail chooser</a>$NWB#vicidial_inbound_groups-voicemail_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Drop Transfer Group: </td><td align=left><select size=1 name=drop_inbound_group>";
echo "$Dgroups_menu";
echo "</select>$NWB#vicidial_inbound_groups-drop_inbound_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=311111111&call_time_id=$call_time_id\">Call Time: </a></td><td align=left><select size=1 name=call_time_id>\n";
echo "$call_times_list";
echo "<option selected value=\"$call_time_id\">$call_time_id - $call_timename_list[$call_time_id]</option>\n";
echo "</select>$NWB#vicidial_inbound_groups-call_time_id$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>After Hours Action: </td><td align=left><select size=1 name=after_hours_action><option>HANGUP</option><option>MESSAGE</option><option>EXTENSION</option><option>VOICEMAIL</option><option>IN_GROUP</option><option SELECTED>$after_hours_action</option></select>$NWB#vicidial_inbound_groups-after_hours_action$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>After Hours Message Filename: </td><td align=left><input type=text name=after_hours_message_filename id=after_hours_message_filename size=50 maxlength=255 value=\"$after_hours_message_filename\"> <a href=\"javascript:launch_chooser('after_hours_message_filename','date',600);\">audio chooser</a> $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>After Hours Extension: </td><td align=left><input type=text name=after_hours_exten size=10 maxlength=20 value=\"$after_hours_exten\">$NWB#vicidial_inbound_groups-after_hours_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>After Hours Voicemail: </td><td align=left><input type=text name=after_hours_voicemail id=after_hours_voicemail size=12 maxlength=10 value=\"$after_hours_voicemail\"> <a href=\"javascript:launch_vm_chooser('after_hours_voicemail','vm',700);\">voicemail chooser</a>$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>After Hours Transfer Group: </td><td align=left><select size=1 name=afterhours_xfer_group>";
echo "$Agroups_menu";
echo "</select>$NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>No Agents No Queueing: </td><td align=left><select size=1 name=no_agent_no_queue><option>Y</option><option>N</option><option>NO_PAUSED</option><option SELECTED>$no_agent_no_queue</option></select>$NWB#vicidial_inbound_groups-no_agent_no_queue$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>No Agent No Queue Action: </td><td align=left><select size=1 name=no_agent_action id=no_agent_action onChange=\"dynamic_call_action('no_agent_action','$no_agent_action','$no_agent_action_value','600');\"><option>CALLMENU</option><option>INGROUP</option><option>DID</option><option>MESSAGE</option><option>EXTENSION</option><option>VOICEMAIL</option><option SELECTED>$no_agent_action</option></select>$NWB#vicidial_inbound_groups-no_agent_no_queue$NWE\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>";
echo "<span id=\"no_agent_action_value_span\" name=\"no_agent_action_value_span\">\n";
if ($no_agent_action=='CALLMENU')
{
echo "<span name=no_agent_action_value_link id=no_agent_action_value_link>";
echo "<a href=\"$PHP_SELF?ADD=3511&menu_id=$no_agent_action_value\">Call Menu:</a>";
echo "</span>";
echo " <select size=1 name=no_agent_action_value id=no_agent_action_value onChange=\"dynamic_call_action_link('no_agent_action','CALLMENU');\">$call_menu_list<option SELECTED>$no_agent_action_value</option></select>\n";
}
if ($no_agent_action=='INGROUP')
{
if (strlen($no_agent_action_value) < 10)
{$no_agent_action_value = 'SALESLINE,CID,LB,998,TESTCAMP,1';}
$IGno_agent_action_value = explode(",",$no_agent_action_value);
$IGgroup_id = $IGno_agent_action_value[0];
$IGhandle_method = $IGno_agent_action_value[1];
$IGsearch_method = $IGno_agent_action_value[2];
$IGlist_id = $IGno_agent_action_value[3];
$IGcampaign_id = $IGno_agent_action_value[4];
$IGphone_code = $IGno_agent_action_value[5];
echo "<span name=no_agent_action_value_link id=no_agent_action_value_link>";
echo "<a href=\"$PHP_SELF?ADD=3111&group_id=$IGgroup_id\">In-Group:</a>";
echo "</span>";
echo " <select size=1 name=IGgroup_id_no_agent_action id=IGgroup_id_no_agent_action onChange=\"dynamic_call_action_link('IGgroup_id_no_agent_action','INGROUP');\">";
echo "$ingroup_list<option SELECTED>$IGgroup_id</option></select>";
echo " &nbsp; Handle Method: <select size=1 name=IGhandle_method_$j id=IGhandle_method_$j>";
echo "$IGhandle_method_list<option SELECTED>$IGhandle_method</option></select>\n";
echo "<BR>Search Method: <select size=1 name=IGsearch_method_$j id=IGsearch_method_$j>";
echo "$IGsearch_method_list<option SELECTED>$IGsearch_method</option></select>\n";
echo " &nbsp; List ID: <input type=text size=5 maxlength=14 name=IGlist_id_$j id=IGlist_id_$j value=\"$IGlist_id\">";
echo "<BR>Campaign ID: <select size=1 name=IGcampaign_id_$j id=IGcampaign_id_$j>";
echo "$IGcampaign_id_list<option SELECTED>$IGcampaign_id</option></select>\n";
echo " &nbsp; Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_$j id=IGphone_code_$j value=\"$IGphone_code\">";
}
if ($no_agent_action=='DID')
{
$stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$no_agent_action_value';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$did_id = $row[0];
echo "<span name=no_agent_action_value_link id=no_agent_action_value_link>";
echo "<a href=\"$PHP_SELF?ADD=3311&did_id=$did_id\">DID:</a>";
echo "</span>";
echo " <select size=1 name=no_agent_action_value id=no_agent_action_value onChange=\"dynamic_call_action_link('no_agent_action','DID');\">$did_list<option SELECTED>$no_agent_action_value</option></select>\n";
}
if ($no_agent_action=='MESSAGE')
{
if (strlen($no_agent_action_value) < 3)
{$no_agent_action_value = 'nbdy-avail-to-take-call|vm-goodbye';}
echo "Audio File: <input type=text name=no_agent_action_value id=no_agent_action_value size=50 maxlength=255 value=\"$no_agent_action_value\"> <a href=\"javascript:launch_chooser('no_agent_action_value','date',600);\">audio chooser</a>\n";
}
if ($no_agent_action=='EXTENSION')
{
if (strlen($no_agent_action_value) < 3)
{$no_agent_action_value = '8304,default';}
$EXno_agent_action_value = explode(",",$no_agent_action_value);
$EXextension = $EXno_agent_action_value[0];
$EXcontext = $EXno_agent_action_value[1];
echo "Extension: <input type=text name=EXextension_no_agent_action id=EXextension_no_agent_action size=20 maxlength=255 value=\"$EXextension\"> &nbsp; Context: <input type=text name=EXcontext_no_agent_action id=EXcontext_no_agent_action size=20 maxlength=255 value=\"$EXcontext\">\n";
}
if ($no_agent_action=='VOICEMAIL')
{
echo "Voicemail Box: <input type=text name=no_agent_action_value id=no_agent_action_value size=12 maxlength=10 value=\"$no_agent_action_value\"> <a href=\"javascript:launch_vm_chooser('no_agent_action_value','vm',700);\">voicemail chooser</a>\n";
}
echo "</span>
<BR> &nbsp; </td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Welcome Message Filename: </td><td align=left><input type=text name=welcome_message_filename id=welcome_message_filename size=50 maxlength=255 value=\"$welcome_message_filename\"> <a href=\"javascript:launch_chooser('welcome_message_filename','date',800);\">audio chooser</a> $NWB#vicidial_inbound_groups-welcome_message_filename$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Play Welcome Message: </td><td align=left><select size=1 name=play_welcome_message><option>ALWAYS</option><option>NEVER</option><option>IF_WAIT_ONLY</option><option>YES_UNLESS_NODELAY</option><option SELECTED>$play_welcome_message</option></select>$NWB#vicidial_inbound_groups-play_welcome_message$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Music On Hold Context: </td><td align=left><input type=text name=moh_context id=moh_context size=50 maxlength=50 value=\"$moh_context\"> <a href=\"javascript:launch_moh_chooser('moh_context','moh',800);\">moh chooser</a> $NWB#vicidial_inbound_groups-moh_context$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>On Hold Prompt Filename: </td><td align=left><input type=text name=onhold_prompt_filename id=onhold_prompt_filename size=50 maxlength=255 value=\"$onhold_prompt_filename\"> <a href=\"javascript:launch_chooser('onhold_prompt_filename','date',800);\">audio chooser</a> $NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>On Hold Prompt Interval: </td><td align=left><input type=text name=prompt_interval size=5 maxlength=5 value=\"$prompt_interval\">$NWB#vicidial_inbound_groups-prompt_interval$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>On Hold Prompt No Block: </td><td align=left><select size=1 name=onhold_prompt_no_block><option>N</option><option>Y</option><option SELECTED>$onhold_prompt_no_block</option></select>$NWB#vicidial_inbound_groups-onhold_prompt_no_block$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>On Hold Prompt Seconds: </td><td align=left><input type=text name=onhold_prompt_seconds size=5 maxlength=5 value=\"$onhold_prompt_seconds\">$NWB#vicidial_inbound_groups-onhold_prompt_seconds$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Play Place in Line: </td><td align=left><select size=1 name=play_place_in_line><option>Y</option><option>N</option><option SELECTED>$play_place_in_line</option></select>$NWB#vicidial_inbound_groups-play_place_in_line$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Play Estimated Hold Time: </td><td align=left><select size=1 name=play_estimate_hold_time><option>Y</option><option>N</option><option SELECTED>$play_estimate_hold_time</option></select>$NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Calculate Estimated Hold Seconds: </td><td align=left><input type=text name=calculate_estimated_hold_seconds size=5 maxlength=5 value=\"$calculate_estimated_hold_seconds\">$NWB#vicidial_inbound_groups-calculate_estimated_hold_seconds$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Estimated Hold Time Minimum Filename: </td><td align=left><input type=text name=eht_minimum_prompt_filename id=eht_minimum_prompt_filename size=50 maxlength=255 value=\"$eht_minimum_prompt_filename\"> <a href=\"javascript:launch_chooser('eht_minimum_prompt_filename','date',800);\">audio chooser</a> $NWB#vicidial_inbound_groups-eht_minimum_prompt_filename$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Estimated Hold Time Minimum Prompt No Block: </td><td align=left><select size=1 name=eht_minimum_prompt_no_block><option>N</option><option>Y</option><option SELECTED>$eht_minimum_prompt_no_block</option></select>$NWB#vicidial_inbound_groups-eht_minimum_prompt_no_block$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Estimated Hold Time Minimum Prompt Seconds: </td><td align=left><input type=text name=eht_minimum_prompt_seconds size=5 maxlength=5 value=\"$eht_minimum_prompt_seconds\">$NWB#vicidial_inbound_groups-eht_minimum_prompt_seconds$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Wait Time Option: </td><td align=left><select size=1 name=wait_time_option><option>NONE</option><option>PRESS_STAY</option><option>PRESS_VMAIL</option><option>PRESS_EXTEN</option><option>PRESS_CALLMENU</option><option>PRESS_CID_CALLBACK</option><option>PRESS_INGROUP</option><option SELECTED>$wait_time_option</option></select>$NWB#vicidial_inbound_groups-wait_time_option$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Wait Time Second Option: </td><td align=left><select size=1 name=wait_time_second_option><option>NONE</option><option>PRESS_STAY</option><option>PRESS_VMAIL</option><option>PRESS_EXTEN</option><option>PRESS_CALLMENU</option><option>PRESS_CID_CALLBACK</option><option>PRESS_INGROUP</option><option SELECTED>$wait_time_second_option</option></select>$NWB#vicidial_inbound_groups-wait_time_second_option$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Wait Time Third Option: </td><td align=left><select size=1 name=wait_time_third_option><option>NONE</option><option>PRESS_STAY</option><option>PRESS_VMAIL</option><option>PRESS_EXTEN</option><option>PRESS_CALLMENU</option><option>PRESS_CID_CALLBACK</option><option>PRESS_INGROUP</option><option SELECTED>$wait_time_third_option</option></select>$NWB#vicidial_inbound_groups-wait_time_third_option$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Wait Time Option Seconds: </td><td align=left><input type=text name=wait_time_option_seconds size=5 maxlength=5 value=\"$wait_time_option_seconds\">$NWB#vicidial_inbound_groups-wait_time_option_seconds$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Wait Time Option Extension: </td><td align=left><input type=text name=wait_time_option_exten size=20 maxlength=20 value=\"$wait_time_option_exten\">$NWB#vicidial_inbound_groups-wait_time_option_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right><a href=\"$PHP_SELF?ADD=3511&menu_id=$wait_time_option_callmenu\">Wait Time Option Callmenu</a>: </td><td align=left><select size=1 name=wait_time_option_callmenu>\n";
echo "$Wmenuslist";
echo "</select>$NWB#vicidial_inbound_groups-wait_time_option_callmenu$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Wait Time Option Voicemail: </td><td align=left><input type=text name=wait_time_option_voicemail id=wait_time_option_voicemail size=12 maxlength=10 value=\"$wait_time_option_voicemail\"> <a href=\"javascript:launch_vm_chooser('wait_time_option_voicemail','vm',1100);\">voicemail chooser</a> $NWB#vicidial_inbound_groups-wait_time_option_voicemail$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Wait Time Option Transfer In-Group: </td><td align=left><select size=1 name=wait_time_option_xfer_group>";
echo "$Wgroups_menu";
echo "</select>$NWB#vicidial_inbound_groups-wait_time_option_xfer_group$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Wait Time Option Press Filename: </td><td align=left><input type=text name=wait_time_option_press_filename id=wait_time_option_press_filename size=50 maxlength=255 value=\"$wait_time_option_press_filename\"> <a href=\"javascript:launch_chooser('wait_time_option_press_filename','date',1200);\">audio chooser</a> $NWB#vicidial_inbound_groups-wait_time_option_press_filename$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Wait Time Option Press No Block: </td><td align=left><select size=1 name=wait_time_option_no_block><option>N</option><option>Y</option><option SELECTED>$wait_time_option_no_block</option></select>$NWB#vicidial_inbound_groups-wait_time_option_no_block$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Wait Time Option Press Filename Seconds: </td><td align=left><input type=text name=wait_time_option_prompt_seconds size=5 maxlength=5 value=\"$wait_time_option_prompt_seconds\">$NWB#vicidial_inbound_groups-wait_time_option_prompt_seconds$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Wait Time Option After Press Filename: </td><td align=left><input type=text name=wait_time_option_callback_filename id=wait_time_option_callback_filename size=50 maxlength=255 value=\"$wait_time_option_callback_filename\"> <a href=\"javascript:launch_chooser('wait_time_option_callback_filename','date',1300);\">audio chooser</a> $NWB#vicidial_inbound_groups-wait_time_option_callback_filename$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Wait Time Option Callback List ID: </td><td align=left><input type=text name=wait_time_option_callback_list_id size=14 maxlength=14 value=\"$wait_time_option_callback_list_id\">$NWB#vicidial_inbound_groups-wait_time_option_callback_list_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Wait Hold Option Priority: </td><td align=left><select size=1 name=wait_hold_option_priority><option>WAIT</option><option>BOTH</option><option SELECTED>$wait_hold_option_priority</option></select>$NWB#vicidial_inbound_groups-wait_hold_option_priority$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Estimated Hold Time Option: </td><td align=left><select size=1 name=hold_time_option><option>NONE</option><option>EXTENSION</option><option>CALL_MENU</option><option>VOICEMAIL</option><option>IN_GROUP</option><option>CALLERID_CALLBACK</option><option>DROP_ACTION</option><option>PRESS_STAY</option><option>PRESS_VMAIL</option><option>PRESS_EXTEN</option><option>PRESS_CALLMENU</option><option>PRESS_CID_CALLBACK</option><option>PRESS_INGROUP</option><option SELECTED>$hold_time_option</option></select>$NWB#vicidial_inbound_groups-hold_time_option$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Hold Time Second Option: </td><td align=left><select size=1 name=hold_time_second_option><option>NONE</option><option>PRESS_STAY</option><option>PRESS_VMAIL</option><option>PRESS_EXTEN</option><option>PRESS_CALLMENU</option><option>PRESS_CID_CALLBACK</option><option>PRESS_INGROUP</option><option SELECTED>$hold_time_second_option</option></select>$NWB#vicidial_inbound_groups-hold_time_second_option$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Hold Time Third Option: </td><td align=left><select size=1 name=hold_time_third_option><option>NONE</option><option>PRESS_STAY</option><option>PRESS_VMAIL</option><option>PRESS_EXTEN</option><option>PRESS_CALLMENU</option><option>PRESS_CID_CALLBACK</option><option>PRESS_INGROUP</option><option SELECTED>$hold_time_third_option</option></select>$NWB#vicidial_inbound_groups-hold_time_third_option$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Hold Time Option Seconds: </td><td align=left><input type=text name=hold_time_option_seconds size=5 maxlength=5 value=\"$hold_time_option_seconds\">$NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Hold Time Option Minimum: </td><td align=left><input type=text name=hold_time_option_minimum size=5 maxlength=5 value=\"$hold_time_option_minimum\">$NWB#vicidial_inbound_groups-hold_time_option_minimum$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Hold Time Option Extension: </td><td align=left><input type=text name=hold_time_option_exten size=20 maxlength=20 value=\"$hold_time_option_exten\">$NWB#vicidial_inbound_groups-hold_time_option_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right><a href=\"$PHP_SELF?ADD=3511&menu_id=$hold_time_option_callmenu\">Hold Time Option Callmenu</a>: </td><td align=left><select size=1 name=hold_time_option_callmenu>\n";
echo "$Xmenuslist";
echo "</select>$NWB#vicidial_inbound_groups-hold_time_option_callmenu$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Hold Time Option Voicemail: </td><td align=left><input type=text name=hold_time_option_voicemail id=hold_time_option_voicemail size=12 maxlength=10 value=\"$hold_time_option_voicemail\"> <a href=\"javascript:launch_vm_chooser('hold_time_option_voicemail','vm',1100);\">voicemail chooser</a> $NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Hold Time Option Transfer In-Group: </td><td align=left><select size=1 name=hold_time_option_xfer_group>";
echo "$Tgroups_menu";
echo "</select>$NWB#vicidial_inbound_groups-hold_time_option_xfer_group$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Hold Time Option Press Filename: </td><td align=left><input type=text name=hold_time_option_press_filename id=hold_time_option_press_filename size=50 maxlength=255 value=\"$hold_time_option_press_filename\"> <a href=\"javascript:launch_chooser('hold_time_option_press_filename','date',1200);\">audio chooser</a> $NWB#vicidial_inbound_groups-hold_time_option_press_filename$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Hold Time Option Press No Block: </td><td align=left><select size=1 name=hold_time_option_no_block><option>N</option><option>Y</option><option SELECTED>$hold_time_option_no_block</option></select>$NWB#vicidial_inbound_groups-hold_time_option_no_block$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Hold Time Option Press Filename Seconds: </td><td align=left><input type=text name=hold_time_option_prompt_seconds size=5 maxlength=5 value=\"$hold_time_option_prompt_seconds\">$NWB#vicidial_inbound_groups-hold_time_option_prompt_seconds$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Hold Time Option After Press Filename: </td><td align=left><input type=text name=hold_time_option_callback_filename id=hold_time_option_callback_filename size=50 maxlength=255 value=\"$hold_time_option_callback_filename\"> <a href=\"javascript:launch_chooser('hold_time_option_callback_filename','date',1300);\">audio chooser</a> $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Hold Time Option Callback List ID: </td><td align=left><input type=text name=hold_time_option_callback_list_id size=14 maxlength=14 value=\"$hold_time_option_callback_list_id\">$NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Alert Filename: </td><td align=left><input type=text name=agent_alert_exten id=agent_alert_exten size=40 maxlength=100 value=\"$agent_alert_exten\"> <a href=\"javascript:launch_chooser('agent_alert_exten','date',1500);\">audio chooser</a> $NWB#vicidial_inbound_groups-agent_alert_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Alert Delay: </td><td align=left><input type=text name=agent_alert_delay size=6 maxlength=6 value=\"$agent_alert_delay\">$NWB#vicidial_inbound_groups-agent_alert_delay$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Transfer Group: </td><td align=left><select size=1 name=default_xfer_group>";
echo "$Xgroups_menu";
echo "</select>$NWB#vicidial_inbound_groups-default_xfer_group$NWE</td></tr>\n";
##### get groups_alias listings for dynamic default group alias pulldown list menu
$stmt="SELECT group_alias_id,group_alias_name from groups_alias where active='Y' order by group_alias_id";
$rslt=mysql_query($stmt, $link);
$group_alias_to_print = mysql_num_rows($rslt);
$group_alias_menu='';
$group_alias_selected=0;
$o=0;
while ($group_alias_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$group_alias_menu .= "<option ";
if ($default_group_alias == "$rowx[0]")
{
$group_alias_menu .= "SELECTED ";
$group_alias_selected++;
}
$group_alias_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "<tr bgcolor=#B6D3FC><td align=right>Default Group Alias: </td><td align=left><select size=1 name=default_group_alias>";
echo "<option value=\"\">NONE</option>";
echo "$group_alias_menu";
echo "</select>$NWB#vicidial_inbound_groups-default_group_alias$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Hold Recall Transfer In-Group: </td><td align=left><select size=1 name=hold_recall_xfer_group>";
echo "$Hgroups_menu";
echo "</select>$NWB#vicidial_inbound_groups-hold_recall_xfer_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>No Delay Call Route: </td><td align=left><select size=1 name=no_delay_call_route><option>Y</option><option>N</option><option SELECTED>$no_delay_call_route</option></select>$NWB#vicidial_inbound_groups-no_delay_call_route$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Recording Override: </td><td align=left><select size=1 name=ingroup_recording_override><option>DISABLED</option><option>NEVER</option><option>ONDEMAND</option><option>ALLCALLS</option><option>ALLFORCE</option><option SELECTED>$ingroup_recording_override</option></select>$NWB#vicidial_inbound_groups-ingroup_recording_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Recording Filename: </td><td align=left><input type=text name=ingroup_rec_filename size=50 maxlength=50 value=\"$ingroup_rec_filename\">$NWB#vicidial_inbound_groups-ingroup_rec_filename$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Stats Percent of Calls Answered Within X seconds 1: </td><td align=left><input type=text name=answer_sec_pct_rt_stat_one size=5 maxlength=5 value=\"$answer_sec_pct_rt_stat_one\">$NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Stats Percent of Calls Answered Within X seconds 2: </td><td align=left><input type=text name=answer_sec_pct_rt_stat_two size=5 maxlength=5 value=\"$answer_sec_pct_rt_stat_two\">$NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Start Call URL: </td><td align=left><input type=text name=start_call_url size=70 maxlength=2000 value=\"$start_call_url\">$NWB#vicidial_inbound_groups-start_call_url$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Dispo Call URL: </td><td align=left><input type=text name=dispo_call_url size=70 maxlength=2000 value=\"$dispo_call_url\">$NWB#vicidial_inbound_groups-dispo_call_url$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Add Lead URL: </td><td align=left><input type=text name=add_lead_url size=70 maxlength=2000 value=\"$add_lead_url\">$NWB#vicidial_inbound_groups-add_lead_url$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Extension Append CID: </td><td align=left><select size=1 name=extension_appended_cidname><option>Y</option><option>N</option><option SELECTED>$extension_appended_cidname</option></select>$NWB#vicidial_inbound_groups-extension_appended_cidname$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Uniqueid Status Display: </td><td align=left><select size=1 name=uniqueid_status_display><option>DISABLED</option><option>ENABLED</option><option>ENABLED_PREFIX</option><option>ENABLED_PRESERVE</option><option SELECTED>$uniqueid_status_display</option></select>$NWB#vicidial_inbound_groups-uniqueid_status_display$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Uniqueid Status Prefix: </td><td align=left><input type=text name=uniqueid_status_prefix size=10 maxlength=50 value=\"$uniqueid_status_prefix\">$NWB#vicidial_inbound_groups-uniqueid_status_prefix$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
if ($SSqc_features_active > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2> &nbsp; </td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2> Inbound Group QC Settings: </td></tr>\n";
##### get status listings for dynamic pulldown
$qc_statuses = preg_replace("/^ | -$/","",$qc_statuses);
$QCstatuses = explode(" ", $qc_statuses);
$QCs_to_print = (count($QCstatuses) -0);
$stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_statuses where status NOT IN('QUEUE','INCALL') order by status";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$qc_statuses_list='';
$o=0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$qc_statuses_list .= "<input type=\"checkbox\" name=\"qc_statuses[]\" value=\"$rowx[0]\"";
$p=0;
while ($p < $QCs_to_print)
{
if ($rowx[0] == $QCstatuses[$p])
{
$qc_statuses_list .= " CHECKED";
}
$p++;
}
$qc_statuses_list .= "> $rowx[0] - $rowx[1]<BR>\n";
$o++;
}
$stmt="SELECT distinct(status),status_name from vicidial_campaign_statuses order by status";
$rslt=mysql_query($stmt, $link);
$Cstatuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($Cstatuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
if (!ereg("\"$rowx[0]\"",$qc_statuses_list))
{
$qc_statuses_list .= "<input type=\"checkbox\" name=\"qc_statuses[]\" value=\"$rowx[0]\"";
$p=0;
while ($p < $QCs_to_print)
{
if ($rowx[0] == $QCstatuses[$p])
{
$qc_statuses_list .= " CHECKED";
}
$p++;
}
$qc_statuses_list .= "> $rowx[0] - $rowx[1]<BR>\n";
}
$o++;
}
##### get scripts listings for pulldown
$stmt="SELECT script_id,script_name from vicidial_scripts order by script_id";
$rslt=mysql_query($stmt, $link);
$scripts_to_print = mysql_num_rows($rslt);
$QCscripts_list="";
$o=0;
while ($scripts_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$QCscripts_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$scriptname_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
##### get shifts listings for pulldown
$stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id";
$rslt=mysql_query($stmt, $link);
$shifts_to_print = mysql_num_rows($rslt);
$QCshifts_list="";
$o=0;
while ($shifts_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$QCshifts_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$shiftname_list["$rowx[0]"] = "$rowx[1]";
$o++;
}
echo "<tr bgcolor=#9BB9FB><td align=right>QC Enabled: </td><td><select size=1 name=qc_enabled><option>Y</option><option>N</option><option SELECTED>$qc_enabled</option></select> $NWB#vicidial_inbound_groups-qc_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#9BB9FB><td align=right>QC Statuses: <BR> $NWB#vicidial_inbound_groups-qc_statuses$NWE</td><td>$qc_statuses_list</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>QC WebForm: </td><td align=left><input type=text name=qc_web_form_address size=70 maxlength=255 value=\"$qc_web_form_address\">$NWB#vicidial_inbound_groups-qc_web_form_address$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right><a href=\"$PHP_SELF?ADD=3111111&script_id=$script_id\">QC Script</a>: </td><td align=left><select size=1 name=qc_script>\n";
echo "$QCscripts_list";
echo "<option selected value=\"$qc_script\">$qc_script - $scriptname_list[$qc_script]</option>\n";
echo "</select>$NWB#vicidial_inbound_groups-qc_script$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right><a href=\"$PHP_SELF?ADD=331111111&shift_id=$qc_shift_id\">QC Shift</a>: </td><td align=left><select size=1 name=qc_shift_id>\n";
echo "$QCshifts_list";
echo "<option selected value=\"$qc_shift_id\">$qc_shift_id - $shiftname_list[$qc_shift_id]</option>\n";
echo "</select>$NWB#vicidial_inbound_groups-qc_shift_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>QC Get Record Launch: </td><td><select size=1 name=qc_get_record_launch><option>NONE</option><option>SCRIPT</option><option>WEBFORM</option><option>QCSCRIPT</option><option>QCWEBFORM</option><option SELECTED>$qc_get_record_launch</option></select> $NWB#vicidial_inbound_groups-qc_get_record_launch$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>QC Show Recording: </td><td><select size=1 name=qc_show_recording><option>Y</option><option>N</option><option SELECTED>$qc_show_recording</option></select> $NWB#vicidial_inbound_groups-qc_show_recording$NWE</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=center colspan=2><input type=submit name=submit value=SUBMIT></td></tr>\n";
}
echo "</table>\n";
echo "<BR></center><BR><BR>\n";
### list of agent rank or skill-level for this inbound group
# ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
echo "<center>\n";
echo "<br><b>AGENT RANKS FOR THIS INBOUND GROUP:</b><br>\n";
echo "<TABLE width=600 cellspacing=3>\n";
echo "<tr><td>USER</td><td>SELECTED</td><td> &nbsp; &nbsp; RANK</td><td> &nbsp; &nbsp; CALLS TODAY</td></tr>\n";
$stmt="SELECT user,full_name,closer_campaigns from vicidial_users where active='Y' order by user;";
$rsltx=mysql_query($stmt, $link);
$users_to_print = mysql_num_rows($rsltx);
$o=0;
while ($users_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
$o++;
$ARIG_user[$o] = $rowx[0];
$ARIG_name[$o] = $rowx[1];
$ARIG_close[$o] = $rowx[2];
$ARIG_check[$o] = '';
if (preg_match("/ $group_id /",$ARIG_close[$o]))
{$ARIG_check[$o] = ' CHECKED';}
}
$o=0;
$ARIG_changenotes='';
$stmtDlog='';
while ($users_to_print > $o)
{
$o++;
$stmt="SELECT group_rank,calls_today from vicidial_inbound_group_agents where group_id='$group_id' and user='$ARIG_user[$o]';";
$rsltx=mysql_query($stmt, $link);
$viga_to_print = mysql_num_rows($rsltx);
if ($viga_to_print > 0)
{
$rowx=mysql_fetch_row($rsltx);
$ARIG_rank[$o] = $rowx[0];
$ARIG_calls[$o] = $rowx[1];
}
else
{
$stmtD="INSERT INTO vicidial_inbound_group_agents set calls_today='0',group_rank='0',group_weight='0',user='$ARIG_user[$o]',group_id='$group_id';";
$rslt=mysql_query($stmtD, $link);
if ($DB > 0) {echo "|$stmtD|";}
$stmtDlog .= "$stmtD|";
$ARIG_changenotes .= "added missing user to viga table $ARIG_user[$o]|";
$ARIG_rank[$o] = '0';
$ARIG_calls[$o] = '0';
}
}
if (strlen($ARIG_changenotes) > 10)
{
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmtDlog|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='USER INGROUP VIGA ADD', event_sql=\"$SQL_log\", event_notes='$ARIG_changenotes';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
if ($stage=='SUBMIT')
{
$o=0;
while ($users_to_print > $o)
{
$o++;
$ARIG_checked='';
$ARIG_ranked='';
$checkbox_field="CHECK_$ARIG_user[$o]$US$group_id";
$rank_field="RANK_$ARIG_user[$o]$US$group_id";
if (isset($_GET["$checkbox_field"])) {$ARIG_checked=$_GET["$checkbox_field"];}
elseif (isset($_POST["$checkbox_field"])) {$ARIG_checked=$_POST["$checkbox_field"];}
if (isset($_GET["$rank_field"])) {$ARIG_ranked=$_GET["$rank_field"];}
elseif (isset($_POST["$rank_field"])) {$ARIG_ranked=$_POST["$rank_field"];}
$ARIG_checked = ereg_replace("[^A-Z]","",$ARIG_checked);
$ARIG_ranked = ereg_replace("[^-0-9]","",$ARIG_ranked);
$stmtA='';
$stmtB='';
$stmtC='';
$ARIG_updated=0;
$ARIG_changenotes='';
if ( ($ARIG_check[$o]=='') and ($ARIG_checked=='YES') )
{
if (strlen($ARIG_close[$o]) < 4) {$ARIG_close[$o]=' - ';}
$stmtA="UPDATE vicidial_users set closer_campaigns=' $group_id$ARIG_close[$o]' where user='$ARIG_user[$o]';";
$rslt=mysql_query($stmtA, $link);
if ($DB > 0) {echo "|$stmtA|";}
$ARIG_updated++;
$ARIG_changenotes .= "added $group_id to selected in-groups|";
}
if ( ($ARIG_check[$o]==' CHECKED') and ($ARIG_checked=='') )
{
$ARIG_close[$o] = preg_replace("/ $group_id /",' ',$ARIG_close[$o]);
$stmtB="UPDATE vicidial_users set closer_campaigns='$ARIG_close[$o]' where user='$ARIG_user[$o]';";
$rslt=mysql_query($stmtB, $link);
if ($DB > 0) {echo "|$stmtB|";}
$ARIG_updated++;
$ARIG_changenotes .= "removed $group_id from selected in-groups|";
}
if ( ($ARIG_ranked < $ARIG_rank[$o]) or ($ARIG_ranked > $ARIG_rank[$o]) )
{
$stmtC="UPDATE vicidial_inbound_group_agents set group_rank='$ARIG_ranked',group_weight='$ARIG_ranked' where user='$ARIG_user[$o]' and group_id='$group_id';";
$rslt=mysql_query($stmtC, $link);
if ($DB > 0) {echo "|$stmtC|";}
$ARIG_updated++;
$ARIG_changenotes .= "changed rank from $ARIG_rank[$o] to $ARIG_ranked|";
}
if ($ARIG_updated > 0)
{
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmtA|$stmtB|$stmtC|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='MODIFY', record_id='$ARIG_user[$o]', event_code='USER INGROUP SETTINGS', event_sql=\"$SQL_log\", event_notes='$ARIG_changenotes';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
$stmt="SELECT vu.user,viga.group_rank,calls_today,full_name,closer_campaigns from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user;";
$rsltx=mysql_query($stmt, $link);
$users_to_print = mysql_num_rows($rsltx);
$o=0;
while ($users_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
$o++;
$ARIG_user[$o] = $rowx[0];
$ARIG_rank[$o] = $rowx[1];
$ARIG_calls[$o] = $rowx[2];
$ARIG_name[$o] = $rowx[3];
$ARIG_close[$o] = $rowx[4];
$ARIG_check[$o] = '';
if (preg_match("/ $group_id /",$ARIG_close[$o]))
{$ARIG_check[$o] = ' CHECKED';}
}
}
$checkbox_count=0;
$o=0;
while ($users_to_print > $o)
{
$o++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
$checkbox_field="CHECK_$ARIG_user[$o]$US$group_id";
$rank_field="RANK_$ARIG_user[$o]$US$group_id";
$checkbox_list .= "|$checkbox_field";
$checkbox_count++;
$users_output .= "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3&user=$ARIG_user[$o]\">$ARIG_user[$o]</a> - $ARIG_name[$o]</td>\n";
$users_output .= "<td><input type=checkbox name=\"$checkbox_field\" id=\"$checkbox_field\" value=\"YES\"$ARIG_check[$o]></td>\n";
$users_output .= "<td><select size=1 name=$rank_field>\n";
$h="9";
while ($h>=-9)
{
$users_output .= "<option value=\"$h\"";
if ($h==$ARIG_rank[$o])
{$users_output .= " SELECTED";}
$users_output .= ">$h</option>";
$h--;
}
$users_output .= "</select></td>\n";
$users_output .= "<td><font size=1>$ARIG_calls[$o]</td></tr>\n";
}
echo "<tr><td><font size=1> &nbsp; </font></td><td align=left><a href=\"#\" onclick=\"IGU_selectall('$checkbox_count','$checkbox_list');return false;\"><font size=1>select all</font></a></td><td colspan=2><font size=1> &nbsp; </font></td></tr>\n";
echo "$users_output";
echo "<tr><td align=center colspan=4><input type=submit name=submit value=SUBMIT></td></tr>\n";
echo "</table></center><br></FORM>\n";
# echo "</table></center><br>\n";
echo "<a href=\"./AST_CLOSERstats.php?group[]=$group_id\">Click here to see a report for this inbound group</a><BR><BR>\n";
echo "<a href=\"./AST_VICIDIAL_ingrouplist.php?group=$group_id\">Click here to see agents logged in to this inbound group</a><BR><BR>\n";
echo "<center><b>\n";
echo "<B>DIDS USING THIS IN-GROUP:</B><BR>\n";
echo "<TABLE>\n";
$stmt="SELECT did_id,did_pattern,did_description from vicidial_inbound_dids where group_id='$group_id' and did_route='IN_GROUP';";
$rslt=mysql_query($stmt, $link);
$dids_to_print = mysql_num_rows($rslt);
$o=0;
while ($dids_to_print > $o)
{
$row=mysql_fetch_row($rslt);
echo "<TR><TD><a href=\"$PHP_SELF?ADD=3311&did_id=$row[0]\">$row[1] </a></TD><TD> $row[2]<BR></TD></TR>\n";
$o++;
}
echo "</TABLE><BR>\n";
echo "<B>CALL MENUS USING THIS IN-GROUP:</B><BR>\n";
echo "<TABLE>\n";
$stmt="SELECT distinct vm.menu_id,menu_name from vicidial_call_menu vm,vicidial_call_menu_options vmo where vm.menu_id=vmo.menu_id and option_route='INGROUP' and option_route_value='$group_id';";
$rslt=mysql_query($stmt, $link);
$cms_to_print = mysql_num_rows($rslt);
$o=0;
while ($cms_to_print > $o)
{
$row=mysql_fetch_row($rslt);
echo "<TR><TD><a href=\"$PHP_SELF?ADD=3511&menu_id=$row[0]\">$row[0] </a></TD><TD> $row[1]<BR></TD></TR>\n";
$o++;
}
echo "</TABLE><BR>\n";
echo "<B>CAMPAIGNS ALLOWING THIS IN-GROUP:</B><BR>\n";
echo "<TABLE>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\" $LOGallowed_campaignsSQL;";
$rslt=mysql_query($stmt, $link);
$campin_to_print = mysql_num_rows($rslt);
$o=0;
while ($campin_to_print > $o)
{
$row=mysql_fetch_row($rslt);
echo "<TR><TD><a href=\"$PHP_SELF?ADD=31&campaign_id=$row[0]\">$row[0] </a></TD><TD> $row[1]<BR></TD></TR>\n";
$o++;
}
echo "</TABLE>\n";
if ($LOGdelete_ingroups > 0)
{
# echo "<br><br><a href=\"$PHP_SELF?ADD=53&campaign_id=$group_id&stage=IN\">EMERGENCY VDAC CLEAR FOR THIS IN-GROUP</a><BR><BR>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=5111&group_id=$group_id\">DELETE THIS IN-GROUP</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=INGROUPS&stage=$group_id\">Click here to see Admin changes to this In-Group</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=3311 modify did info in the system
######################
if ($ADD==3311)
{
if ($LOGmodify_dids==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=3311&did_id=$did_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$didSQL = "did_id='$did_id'";
if ( (strlen($did_id)<1) and (strlen($did_pattern)>0) )
{$didSQL = "did_pattern='$did_pattern'";}
$stmt="SELECT did_id,did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number from vicidial_inbound_dids where $didSQL;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$did_id = $row[0];
$did_pattern = $row[1];
$did_description = $row[2];
$did_active = $row[3];
$did_route = $row[4];
$extension = $row[5];
$exten_context = $row[6];
$voicemail_ext = $row[7];
$phone = $row[8];
$server_ip = $row[9];
$user = $row[10];
$user_unavailable_action = $row[11];
$user_route_settings_ingroup = $row[12];
$group_id = $row[13];
$call_handle_method = $row[14];
$agent_search_method = $row[15];
$list_id = $row[16];
$campaign_id = $row[17];
$phone_code = $row[18];
$menu_id = $row[19];
$record_call = $row[20];
$filter_inbound_number = $row[21];
$filter_phone_group_id = $row[22];
$filter_url = $row[23];
$filter_action = $row[24];
$filter_extension = $row[25];
$filter_exten_context = $row[26];
$filter_voicemail_ext = $row[27];
$filter_phone = $row[28];
$filter_server_ip = $row[29];
$filter_user = $row[30];
$filter_user_unavailable_action = $row[31];
$filter_user_route_settings_ingroup = $row[32];
$filter_group_id = $row[33];
$filter_call_handle_method = $row[34];
$filter_agent_search_method = $row[35];
$filter_list_id = $row[36];
$filter_campaign_id = $row[37];
$filter_phone_code = $row[38];
$filter_menu_id = $row[39];
$filter_clean_cid_number = $row[40];
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$campaigns_list='';
$o=0;
while ($campaigns_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
##### get in-groups listings for dynamic pulldown
$stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id";
$rslt=mysql_query($stmt, $link);
$Xgroups_to_print = mysql_num_rows($rslt);
$Xgroups_menu='';
$Xgroups_selected=0;
$FXgroups_menu='';
$FXgroups_selected=0;
$o=0;
while ($Xgroups_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$Xgroups_menu .= "<option ";
$FXgroups_menu .= "<option ";
if ($user_route_settings_ingroup == "$rowx[0]")
{
$Xgroups_menu .= "SELECTED ";
$Xgroups_selected++;
}
if ($filter_user_route_settings_ingroup == "$rowx[0]")
{
$FXgroups_menu .= "SELECTED ";
$FXgroups_selected++;
}
$Xgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$FXgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
if ($Xgroups_selected < 1)
{$Xgroups_menu .= "<option SELECTED value=\"---NONE---\">---NONE---</option>\n";}
else
{$Xgroups_menu .= "<option value=\"---NONE---\">---NONE---</option>\n";}
if ($FXgroups_selected < 1)
{$FXgroups_menu .= "<option SELECTED value=\"---NONE---\">---NONE---</option>\n";}
else
{$FXgroups_menu .= "<option value=\"---NONE---\">---NONE---</option>\n";}
##### get in-groups listings for dynamic pulldown
$stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id";
$rslt=mysql_query($stmt, $link);
$Dgroups_to_print = mysql_num_rows($rslt);
$Dgroups_menu='';
$Dgroups_selected=0;
$FDgroups_menu='';
$FDgroups_selected=0;
$o=0;
while ($Dgroups_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$Dgroups_menu .= "<option ";
$FDgroups_menu .= "<option ";
if ($group_id == "$rowx[0]")
{
$Dgroups_menu .= "SELECTED ";
$Dgroups_selected++;
}
if ($filter_group_id == "$rowx[0]")
{
$FDgroups_menu .= "SELECTED ";
$FDgroups_selected++;
}
$Dgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$FDgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
if ($Dgroups_selected < 1)
{$Dgroups_menu .= "<option SELECTED value=\"---NONE---\">---NONE---</option>\n";}
else
{$Dgroups_menu .= "<option value=\"---NONE---\">---NONE---</option>\n";}
if ($FDgroups_selected < 1)
{$FDgroups_menu .= "<option SELECTED value=\"---NONE---\">---NONE---</option>\n";}
else
{$FDgroups_menu .= "<option value=\"---NONE---\">---NONE---</option>\n";}
echo "<br>MODIFY A DID RECORD: $row[0]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=4311>\n";
echo "<input type=hidden name=did_id value=\"$did_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DID Extension: </td><td align=left><input type=text name=did_pattern size=30 maxlength=50 value=\"$did_pattern\">$NWB#vicidial_inbound_dids-did_pattern$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DID Description: </td><td align=left><input type=text name=did_description size=40 maxlength=50 value=\"$did_description\">$NWB#vicidial_inbound_dids-did_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=did_active><option>Y</option><option>N</option><option SELECTED>$did_active</option></select>$NWB#vicidial_inbound_dids-did_active$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>DID Route: </td><td align=left><select size=1 name=did_route><option>AGENT</option><option>EXTEN</option><option>VOICEMAIL</option><option>PHONE</option><option>IN_GROUP</option><option>CALLMENU</option><option SELECTED>$did_route</option></select>$NWB#vicidial_inbound_dids-did_route$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Record Call: </td><td align=left><select size=1 name=record_call><option>N</option><option>Y_QUEUESTOP</option><option>Y</option><option SELECTED>$record_call</option></select>$NWB#vicidial_inbound_dids-record_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Extension: </td><td align=left><input type=text name=extension size=40 maxlength=50 value=\"$extension\">$NWB#vicidial_inbound_dids-extension$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Extension Context: </td><td align=left><input type=text name=exten_context size=40 maxlength=50 value=\"$exten_context\">$NWB#vicidial_inbound_dids-exten_context$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Voicemail Box: </td><td align=left><input type=text name=voicemail_ext id=voicemail_ext size=12 maxlength=10 value=\"$voicemail_ext\"> <a href=\"javascript:launch_vm_chooser('voicemail_ext','vm',100);\">voicemail chooser</a>$NWB#vicidial_inbound_dids-voicemail_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Extension: </td><td align=left><input type=text name=phone size=20 maxlength=100 value=\"$phone\">$NWB#vicidial_inbound_dids-phone$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server IP: </td><td align=left><select size=1 name=server_ip>\n";
echo "$servers_list";
echo "<option SELECTED>$server_ip</option>\n";
echo "</select>$NWB#vicidial_inbound_dids-server_ip$NWE</td></tr>\n";
$stmt="select menu_id,menu_name,menu_prompt from vicidial_call_menu order by menu_id;";
$rslt=mysql_query($stmt, $link);
$menus_to_print = mysql_num_rows($rslt);
$menu_list='';
$i=0;
while ($i < $menus_to_print)
{
$row=mysql_fetch_row($rslt);
$menu_list .= "<option value=\"$row[0]\">$row[0] - $row[1] - $row[2]</option>";
$i++;
}
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=3511&menu_id=$menu_id\">Call Menu:</a> </td><td align=left><select size=1 name=menu_id>$menu_list<option SELECTED>$menu_id</option></select>$NWB#vicidial_inbound_dids-menu_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>User Agent: </td><td align=left><input type=text name=user size=20 maxlength=20 value=\"$user\">$NWB#vicidial_inbound_dids-user$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>User Unavailable Action: </td><td align=left><select size=1 name=user_unavailable_action><option>EXTEN</option><option>VOICEMAIL</option><option>PHONE</option><option>IN_GROUP</option><option SELECTED>$user_unavailable_action</option></select>$NWB#vicidial_inbound_dids-user_unavailable_action$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>User Route Settings In-Group: </td><td align=left><select size=1 name=user_route_settings_ingroup>";
echo "$Xgroups_menu";
echo "</select>$NWB#vicidial_inbound_dids-user_route_settings_ingroup$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=3111&group_id=$group_id\">In-Group ID</a>: </td><td align=left><select size=1 name=group_id>";
echo "$Dgroups_menu";
echo "</select>$NWB#vicidial_inbound_dids-group_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Call Handle Method: </td><td align=left><select size=1 name=call_handle_method><option>CID</option><option>CIDLOOKUP</option><option>CIDLOOKUPRL</option><option>CIDLOOKUPRC</option><option>ANI</option><option>ANILOOKUP</option><option>ANILOOKUPRL</option><option>VIDPROMPT</option><option>VIDPROMPTLOOKUP</option><option>VIDPROMPTLOOKUPRL</option><option>VIDPROMPTLOOKUPRC</option><option>CLOSER</option><option>3DIGITID</option><option>4DIGITID</option><option>5DIGITID</option><option>10DIGITID</option><option SELECTED>$call_handle_method</option></select>$NWB#vicidial_inbound_dids-call_handle_method$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Agent Search Method: </td><td align=left><select size=1 name=agent_search_method><option value=\"LB\">LB - Load Balanced</option><option value=\"LO\">LO - Load Balanced Overflow</option><option value=\"SO\">SO - Server Only</option><option SELECTED>$agent_search_method</option></select>$NWB#vicidial_inbound_dids-agent_search_method$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group List ID: </td><td align=left><input type=text name=list_id size=14 maxlength=14 value=\"$list_id\">$NWB#vicidial_inbound_dids-list_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Campaign ID: </td><td align=left><select size=1 name=campaign_id>\n";
echo "$campaigns_list";
echo "<option SELECTED>$campaign_id</option>\n";
echo "</select>$NWB#vicidial_inbound_dids-campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Phone Code: </td><td align=left><input type=text name=phone_code size=14 maxlength=14 value=\"$phone_code\">$NWB#vicidial_inbound_dids-phone_code$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Clean CID Number: </td><td align=left><input type=text name=filter_clean_cid_number size=20 maxlength=20 value=\"$filter_clean_cid_number\">$NWB#vicidial_inbound_dids-filter_clean_cid_number$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter Inbound Number: </td><td align=left><select size=1 name=filter_inbound_number><option value=\"DISABLED\">DISABLED</option><option value=\"GROUP\">GROUP</option><option value=\"URL\">URL</option><option SELECTED>$filter_inbound_number</option></select>$NWB#vicidial_inbound_dids-filter_inbound_number$NWE</td></tr>\n";
$stmt="select filter_phone_group_id,filter_phone_group_name from vicidial_filter_phone_groups order by filter_phone_group_id;";
$rslt=mysql_query($stmt, $link);
$Fgroups_to_print = mysql_num_rows($rslt);
$Fgroups_list='';
$i=0;
while ($i < $Fgroups_to_print)
{
$row=mysql_fetch_row($rslt);
$Fgroups_list .= "<option value=\"$row[0]\">$row[0] - $row[1] - $row[2]</option>";
$i++;
}
echo "<tr bgcolor=#CCFFFF><td align=right><a href=\"$PHP_SELF?ADD=3711&filter_phone_group_id=$filter_phone_group_id\">Filter Phone Group ID:</a> </td><td align=left><select size=1 name=filter_phone_group_id>$Fgroups_list<option SELECTED>$filter_phone_group_id</option></select>$NWB#vicidial_inbound_dids-filter_phone_group_id$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter URL: </td><td align=left><input type=text name=filter_url size=80 maxlength=1000 value=\"$filter_url\">$NWB#vicidial_inbound_dids-filter_url$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter Action: </td><td align=left><select size=1 name=filter_action><option>AGENT</option><option>EXTEN</option><option>VOICEMAIL</option><option>PHONE</option><option>IN_GROUP</option><option>CALLMENU</option><option SELECTED>$filter_action</option></select>$NWB#vicidial_inbound_dids-filter_action$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter Extension: </td><td align=left><input type=text name=filter_extension size=40 maxlength=50 value=\"$filter_extension\">$NWB#vicidial_inbound_dids-extension$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter Extension Context: </td><td align=left><input type=text name=filter_exten_context size=40 maxlength=50 value=\"$filter_exten_context\">$NWB#vicidial_inbound_dids-exten_context$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter Voicemail Box: </td><td align=left><input type=text name=filter_voicemail_ext id=voicemail_ext size=12 maxlength=10 value=\"$filter_voicemail_ext\"> <a href=\"javascript:launch_vm_chooser('voicemail_ext','vm',100);\">voicemail chooser</a>$NWB#vicidial_inbound_dids-voicemail_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter Phone Extension: </td><td align=left><input type=text name=filter_phone size=20 maxlength=100 value=\"$filter_phone\">$NWB#vicidial_inbound_dids-phone$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter Server IP: </td><td align=left><select size=1 name=filter_server_ip>\n";
echo "$servers_list";
echo "<option SELECTED>$filter_server_ip</option>\n";
echo "</select>$NWB#vicidial_inbound_dids-server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right><a href=\"$PHP_SELF?ADD=3511&menu_id=$menu_id\">Filter Call Menu:</a> </td><td align=left><select size=1 name=filter_menu_id>$menu_list<option SELECTED>$filter_menu_id</option></select>$NWB#vicidial_inbound_dids-menu_id$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter User Agent: </td><td align=left><input type=text name=filter_user size=20 maxlength=20 value=\"$filter_user\">$NWB#vicidial_inbound_dids-user$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter User Unavailable Action: </td><td align=left><select size=1 name=filter_user_unavailable_action><option>EXTEN</option><option>VOICEMAIL</option><option>PHONE</option><option>IN_GROUP</option><option SELECTED>$filter_user_unavailable_action</option></select>$NWB#vicidial_inbound_dids-user_unavailable_action$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter User Route Settings In-Group: </td><td align=left><select size=1 name=filter_user_route_settings_ingroup>";
echo "$FXgroups_menu";
echo "</select>$NWB#vicidial_inbound_dids-user_route_settings_ingroup$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right><a href=\"$PHP_SELF?ADD=3111&group_id=$group_id\">Filter In-Group ID</a>: </td><td align=left><select size=1 name=filter_group_id>";
echo "$FDgroups_menu";
echo "</select>$NWB#vicidial_inbound_dids-group_id$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter In-Group Call Handle Method: </td><td align=left><select size=1 name=filter_call_handle_method><option>CID</option><option>CIDLOOKUP</option><option>CIDLOOKUPRL</option><option>CIDLOOKUPRC</option><option>ANI</option><option>ANILOOKUP</option><option>ANILOOKUPRL</option><option>VIDPROMPT</option><option>VIDPROMPTLOOKUP</option><option>VIDPROMPTLOOKUPRL</option><option>VIDPROMPTLOOKUPRC</option><option>CLOSER</option><option>3DIGITID</option><option>4DIGITID</option><option>5DIGITID</option><option>10DIGITID</option><option SELECTED>$filter_call_handle_method</option></select>$NWB#vicidial_inbound_dids-call_handle_method$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter In-Group Agent Search Method: </td><td align=left><select size=1 name=filter_agent_search_method><option value=\"LB\">LB - Load Balanced</option><option value=\"LO\">LO - Load Balanced Overflow</option><option value=\"SO\">SO - Server Only</option><option SELECTED>$filter_agent_search_method</option></select>$NWB#vicidial_inbound_dids-agent_search_method$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter In-Group List ID: </td><td align=left><input type=text name=filter_list_id size=14 maxlength=14 value=\"$filter_list_id\">$NWB#vicidial_inbound_dids-list_id$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter In-Group Campaign ID: </td><td align=left><select size=1 name=filter_campaign_id>\n";
echo "$campaigns_list";
echo "<option SELECTED>$filter_campaign_id</option>\n";
echo "</select>$NWB#vicidial_inbound_dids-campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Filter In-Group Phone Code: </td><td align=left><input type=text name=filter_phone_code size=14 maxlength=14 value=\"$filter_phone_code\">$NWB#vicidial_inbound_dids-phone_code$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</table>\n";
echo "<BR></center></FORM><br>\n";
echo "<br><a href=\"./AST_DIDstats.php?group[0]=$did_id\">Click here to see a traffic report for this DID</FONT><br>\n";
echo "<br><a href=\"./user_stats.php?user=$did_pattern&did=1&did_id=$did_id\">Click here to see a list of recordings and calls for this DID</FONT><br>\n";
if ($LOGdelete_dids > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=5311&did_id=$did_id\">DELETE THIS DID</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=DIDS&stage=$did_id\">Click here to see Admin changes to this DID</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=3511 modify call menu info in the system
######################
if ($ADD==3511)
{
if ($LOGmodify_dids==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=3511&menu_id=$menu_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT menu_name,menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group,dtmf_log from vicidial_call_menu where menu_id='$menu_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$menu_name = $row[0];
$menu_prompt = $row[1];
$menu_timeout = $row[2];
$menu_timeout_prompt = $row[3];
$menu_invalid_prompt = $row[4];
$menu_repeat = $row[5];
$menu_time_check = $row[6];
$call_time_id = $row[7];
$track_in_vdac = $row[8];
$custom_dialplan_entry= $row[9];
$tracking_group = $row[10];
$dtmf_log = $row[11];
echo "<br>MODIFY A CALL MENU RECORD: $menu_id<form action=$PHP_SELF method=POST name=admin_form id=admin_form>\n";
echo "<input type=hidden name=ADD value=4511>\n";
echo "<input type=hidden name=menu_id value=\"$menu_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Menu ID: </td><td align=left>$menu_id $NWB#vicidial_call_menu-menu_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Menu Name: </td><td align=left><input type=text name=menu_name size=40 maxlength=50 value=\"$menu_name\">$NWB#vicidial_call_menu-menu_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Menu Prompt: </td><td align=left><input type=text name=menu_prompt id=menu_prompt size=60 maxlength=255 value=\"$menu_prompt\"> <a href=\"javascript:launch_chooser('menu_prompt','date',30);\">audio chooser</a> $NWB#vicidial_call_menu-menu_prompt$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Menu Timeout: </td><td align=left><input type=text name=menu_timeout size=10 maxlength=5 value=\"$menu_timeout\">$NWB#vicidial_call_menu-menu_timeout$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Menu Timeout Prompt: </td><td align=left><input type=text name=menu_timeout_prompt id=menu_timeout_prompt size=60 maxlength=255 value=\"$menu_timeout_prompt\"> <a href=\"javascript:launch_chooser('menu_timeout_prompt','date',30);\">audio chooser</a> $NWB#vicidial_call_menu-menu_timeout_prompt$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Menu Invalid Prompt: </td><td align=left><input type=text name=menu_invalid_prompt id=menu_invalid_prompt size=60 maxlength=255 value=\"$menu_invalid_prompt\"> <a href=\"javascript:launch_chooser('menu_invalid_prompt','date',30);\">audio chooser</a> $NWB#vicidial_call_menu-menu_invalid_prompt$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Menu Repeat: </td><td align=left><input type=text name=menu_repeat size=4 maxlength=3 value=\"$menu_repeat\">$NWB#vicidial_call_menu-menu_repeat$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Menu Time Check: </td><td align=left><select size=1 name=menu_time_check>\n";
if ($menu_time_check > 0)
{
echo "<option value=\"0\">0 - No Time Check</option><option selected value=\"1\">1 - Time Check</option>\n";
}
else
{
echo "<option selected value=\"0\">0 - No Time Check</option><option value=\"1\">1 - Time Check</option>\n";
}
echo " </select>$NWB#vicidial_call_menu-menu_time_check$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=311111111&call_time_id=$call_time_id\">Call Time: </a></td><td align=left><select size=1 name=call_time_id>\n";
echo "$call_times_list";
echo "<option selected value=\"$call_time_id\">$call_time_id - $call_timename_list[$call_time_id]</option>\n";
echo "</select>$NWB#vicidial_call_menu-call_time_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Track Calls in Real-Time Report: </td><td align=left><select size=1 name=track_in_vdac>";
if ($track_in_vdac > 0)
{
echo "<option value=\"0\">0 - No Realtime Tracking</option><option selected value=\"1\">1 - Realtime Tracking</option>\n";
}
else
{
echo "<option selected value=\"0\">0 - No Realtime Tracking</option><option value=\"1\">1 - Realtime Tracking</option>\n";
}
echo "</select>$NWB#vicidial_call_menu-track_in_vdac$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Tracking Group: </td><td align=left><select size=1 name=tracking_group>\n";
echo "<option value=\"CALLMENU\">CALLMENU - Default</option>\n";
echo "$ingroup_list";
echo "<option selected value=\"$tracking_group\">$tracking_group</option>\n";
echo "</select>$NWB#vicidial_call_menu-tracking_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Log Key Press: </td><td align=left><select size=1 name=dtmf_log>";
if ($dtmf_log > 0)
{
echo "<option value=\"0\">0 - No DTMF Logging</option><option selected value=\"1\">1 - DTMF Logging Enabled</option>\n";
}
else
{
echo "<option selected value=\"0\">0 - No DTMF Logging</option><option value=\"1\">1 - DTMF Logging Enabled</option>\n";
}
echo "</select>$NWB#vicidial_call_menu-dtmf_log$NWE</td></tr>\n";
echo "<tr><td align=center colspan=2> <input type=submit name=SUBMIT value=SUBMIT> </td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=CENTER colspan=2> Call Menu Options: </td></tr>\n";
$j=0;
$stmtA="SELECT option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$menu_id' order by option_value;";
$rslt=mysql_query($stmtA, $link);
$menus_to_print = mysql_num_rows($rslt);
while ($menus_to_print > $j)
{
$row=mysql_fetch_row($rslt);
$Aoption_value[$j] = $row[0];
$Aoption_description[$j] = $row[1];
$Aoption_route[$j] = $row[2];
$Aoption_route_value[$j] = $row[3];
$Aoption_route_value_context[$j] = $row[4];
$j++;
}
$j=0;
while ($menus_to_print > $j)
{
$choose_height = (($j * 40) + 400);
$option_value = $Aoption_value[$j];
$option_description = $Aoption_description[$j];
$option_route = $Aoption_route[$j];
$option_route_value = $Aoption_route_value[$j];
$option_route_value_context = $Aoption_route_value_context[$j];
$dtmf_list = "<select size=1 name=option_value_$j>";
$h=0;
while ($h <= 18)
{
$dtmf_list .= "<option";
if ( (preg_match("/$dtmf[$h]/",$option_value) and (strlen($option_value) == strlen($dtmf[$h])) ) )
{$dtmf_list .= " selected";}
$dtmf_list .= " value=\"$dtmf[$h]\"> $dtmf_key[$h]</option>";
$h++;
}
$dtmf_list .= "</select>";
if (eregi("1$|3$|5$|7$|9$", $j))
{$bgcolor='bgcolor="#CCFFFF"';}
else
{$bgcolor='bgcolor="#99FFCC"';}
echo "<tr $bgcolor><td align=CENTER colspan=2>
Option: $dtmf_list &nbsp;
Description: <input type=text name=option_description_$j size=40 maxlength=255 value=\"$option_description\">
Route: <select size=1 name=option_route_$j id=option_route_$j onChange=\"call_menu_option('$j','$option_route','$option_route_value','$option_route_value_context','$choose_height');\">
<option>CALLMENU</option>
<option>INGROUP</option>
<option>DID</option>
<option>HANGUP</option>
<option>EXTENSION</option>
<option>PHONE</option>
<option>VOICEMAIL</option>
<option>AGI</option>
<option value=\"\">* REMOVE *</option>
<option selected value=\"$option_route\">$option_route</option>
</select> $NWB#vicidial_call_menu-option_value$NWE <BR>
<span id=\"option_value_value_context_$j\" name=\"option_value_value_context_$j\">\n";
if ($option_route=='CALLMENU')
{
echo "<span name=option_route_link_$j id=option_route_link_$j>";
echo "<a href=\"$PHP_SELF?ADD=3511&menu_id=$option_route_value\">Call Menu:</a>";
echo "</span>";
echo " <select size=1 name=option_route_value_$j id=option_route_value_$j onChange=\"call_menu_link('$j','CALLMENU');\">$call_menu_list<option SELECTED>$option_route_value</option></select>\n";
}
if ($option_route=='INGROUP')
{
if (strlen($option_route_value_context) < 10)
{$option_route_value_context = 'CID,LB,998,TESTCAMP,1,,,,';}
$IGoption_route_value_context = explode(",",$option_route_value_context);
$IGhandle_method = $IGoption_route_value_context[0];
$IGsearch_method = $IGoption_route_value_context[1];
$IGlist_id = $IGoption_route_value_context[2];
$IGcampaign_id = $IGoption_route_value_context[3];
$IGphone_code = $IGoption_route_value_context[4];
$IGvid_enter_filename = $IGoption_route_value_context[5];
$IGvid_id_number_filename = $IGoption_route_value_context[6];
$IGvid_confirm_filename = $IGoption_route_value_context[7];
$IGvid_validate_digits = $IGoption_route_value_context[8];
echo "<span name=option_route_link_$j id=option_route_link_$j>";
echo "<a href=\"$PHP_SELF?ADD=3111&group_id=$option_route_value\">In-Group:</a>";
echo "</span>";
echo " <input type=hidden name=option_route_value_context_$j id=option_route_value_context_$j value=\"$option_route_value_context\">";
echo " <select size=1 name=option_route_value_$j id=option_route_value_$j onChange=\"call_menu_link('$j','INGROUP');\">";
echo "$ingroup_list<option SELECTED>$option_route_value</option></select>";
echo " &nbsp; Handle Method: <select size=1 name=IGhandle_method_$j id=IGhandle_method_$j>";
echo "$IGhandle_method_list<option SELECTED>$IGhandle_method</option></select> $NWB#vicidial_call_menu-ingroup_settings$NWE\n";
echo "<BR>Search Method: <select size=1 name=IGsearch_method_$j id=IGsearch_method_$j>";
echo "$IGsearch_method_list<option SELECTED>$IGsearch_method</option></select>\n";
echo " &nbsp; List ID: <input type=text size=5 maxlength=14 name=IGlist_id_$j id=IGlist_id_$j value=\"$IGlist_id\">";
echo "<BR>Campaign ID: <select size=1 name=IGcampaign_id_$j id=IGcampaign_id_$j>";
echo "$IGcampaign_id_list<option SELECTED>$IGcampaign_id</option></select>\n";
echo " &nbsp; Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_$j id=IGphone_code_$j value=\"$IGphone_code\">";
echo "<BR> &nbsp; VID Enter Filename: <input type=text name=IGvid_enter_filename_$j id=IGvid_enter_filename_$j size=40 maxlength=255 value=\"$IGvid_enter_filename\"> <a href=\"javascript:launch_chooser('IGvid_enter_filename_$j','date',$choose_height);\">audio chooser</a>";
echo "<BR> &nbsp; VID ID Number Filename: <input type=text name=IGvid_id_number_filename_$j id=IGvid_id_number_filename_$j size=40 maxlength=255 value=\"$IGvid_id_number_filename\"> <a href=\"javascript:launch_chooser('IGvid_id_number_filename_$j','date',$choose_height);\">audio chooser</a>";
echo "<BR> &nbsp; VID Confirm Filename: <input type=text name=IGvid_confirm_filename_$j id=IGvid_confirm_filename_$j size=40 maxlength=255 value=\"$IGvid_confirm_filename\"> <a href=\"javascript:launch_chooser('IGvid_confirm_filename_$j','date',$choose_height);\">audio chooser</a>";
echo " &nbsp; VID Digits: <input type=text size=3 maxlength=3 name=IGvid_validate_digits_$j id=IGvid_validate_digits_$j value=\"$IGvid_validate_digits\">";
}
if ($option_route=='DID')
{
$stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$option_route_value';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$did_id = $row[0];
echo "<span name=option_route_link_$j id=option_route_link_$j>";
echo "<a href=\"$PHP_SELF?ADD=3311&did_id=$did_id\">DID:</a>";
echo "</span>";
echo " <select size=1 name=option_route_value_$j id=option_route_value_$j onChange=\"call_menu_link('$j','DID');\">$did_list<option SELECTED>$option_route_value</option></select>\n";
}
if ($option_route=='HANGUP')
{
echo "Audio File: <input type=text name=option_route_value_$j id=option_route_value_$j size=50 maxlength=255 value=\"$option_route_value\"> <a href=\"javascript:launch_chooser('option_route_value_$j','date',$choose_height);\">audio chooser</a>\n";
}
if ($option_route=='EXTENSION')
{
echo "Extension: <input type=text name=option_route_value_$j id=option_route_value_$j size=20 maxlength=255 value=\"$option_route_value\"> &nbsp; Context: <input type=text name=option_route_value_context_$j id=option_route_value_context_$j size=20 maxlength=255 value=\"$option_route_value_context\">\n";
}
if ($option_route=='PHONE')
{
echo "Phone: <select size=1 name=option_route_value_$j id=option_route_value_$j>$phone_list<option SELECTED>$option_route_value</option></select>\n";
}
if ($option_route=='VOICEMAIL')
{
echo "Voicemail Box: <input type=text name=option_route_value_$j id=option_route_value_$j size=12 maxlength=10 value=\"$option_route_value\"> <a href=\"javascript:launch_vm_chooser('option_route_value_$j','vm',700);\">voicemail chooser</a>\n";
}
if ($option_route=='AGI')
{
echo "AGI: <input type=text name=option_route_value_$j id=option_route_value_$j size=80 maxlength=255 value=\"$option_route_value\">\n";
}
echo "</span>
<BR> &nbsp; </td></tr>\n";
$j++;
}
while ($j <= 18)
{
$choose_height = (($j * 40) + 400);
$dtmf_list = "<select size=1 name=option_value_$j><option value=\"\"></option>";
$h=0;
while ($h <= 18)
{
$dtmf_list .= "<option value=\"$dtmf[$h]\"> $dtmf_key[$h]</option>";
$h++;
}
$dtmf_list .= "</select>";
if (eregi("1$|3$|5$|7$|9$", $j))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td align=CENTER colspan=2>
Option: $dtmf_list &nbsp;
Description: <input type=text name=option_description_$j size=40 maxlength=255 value=\"\">
Route: <select size=1 name=option_route_$j id=option_route_$j onChange=\"call_menu_option('$j','','','','$choose_height');\">
<option>CALLMENU</option>
<option>INGROUP</option>
<option>DID</option>
<option>HANGUP</option>
<option>EXTENSION</option>
<option>PHONE</option>
<option>VOICEMAIL</option>
<option>AGI</option>
<option SELECTED value=\"\"> </option>
</select>
$NWB#vicidial_call_menu-option_value$NWE <BR>
<span id=\"option_value_value_context_$j\" name=\"option_value_value_context_$j\">\n";
echo "</span>
<BR> &nbsp; </td></tr>\n";
$j++;
}
if ($SSallow_custom_dialplan > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Custom Dialplan Entry: <BR> $NWB#vicidial_call_menu-custom_dialplan_entry$NWE</td><td align=left><TEXTAREA NAME=custom_dialplan_entry ROWS=5 COLS=70>$custom_dialplan_entry</TEXTAREA></td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>Custom Dialplan Entry: </td><td align=left>Disabled <input type=hidden name=custom_dialplan_entry value=\"\">$NWB#vicidial_call_menu-custom_dialplan_entry$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</table>\n";
echo "<BR></center></FORM><br>\n";
echo "<B>DIDS USING THIS CALL MENU:</B><BR>\n";
echo "<TABLE>\n";
$stmt="SELECT did_id,did_pattern,did_description from vicidial_inbound_dids where menu_id='$menu_id' and did_route='CALLMENU';";
$rslt=mysql_query($stmt, $link);
$dids_to_print = mysql_num_rows($rslt);
$o=0;
while ($dids_to_print > $o)
{
$row=mysql_fetch_row($rslt);
echo "<TR><TD><a href=\"$PHP_SELF?ADD=3311&did_id=$row[0]\">$row[1] </a></TD><TD> $row[2]<BR></TD></TR>\n";
$o++;
}
echo "</TABLE><BR>\n";
echo "<B>CALL MENUS USING THIS CALL MENU:</B><BR>\n";
echo "<TABLE>\n";
$stmt="SELECT distinct vm.menu_id,menu_name from vicidial_call_menu vm,vicidial_call_menu_options vmo where vm.menu_id=vmo.menu_id and option_route='CALLMENU' and option_route_value='$menu_id';";
$rslt=mysql_query($stmt, $link);
$cms_to_print = mysql_num_rows($rslt);
$o=0;
while ($cms_to_print > $o)
{
$row=mysql_fetch_row($rslt);
echo "<TR><TD><a href=\"$PHP_SELF?ADD=3511&menu_id=$row[0]\">$row[0] </a></TD><TD> $row[1]<BR></TD></TR>\n";
$o++;
}
echo "</TABLE>\n";
if ($LOGdelete_dids > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=5511&menu_id=$menu_id\">DELETE THIS CALL MENU</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=CALLMENUS&stage=$menu_id\">Click here to see Admin changes to this CALL MENU</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=31111 modify remote agents info in the system
######################
if ($ADD==31111)
{
if ($LOGmodify_remoteagents==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=31111&remote_agent_id=$remote_agent_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns,extension_group,on_hook_agent,on_hook_ring_time from vicidial_remote_agents where remote_agent_id='$remote_agent_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$remote_agent_id = $row[0];
$user_start = $row[1];
$number_of_lines = $row[2];
$server_ip = $row[3];
$conf_exten = $row[4];
$status = $row[5];
$campaign_id = $row[6];
$extension_group = $row[8];
$on_hook_agent = $row[9];
$on_hook_ring_time =$row[10];
##### get extension group listing for dynamic pulldown
$stmt="SELECT extension_group_id,count(*) from vicidial_extension_groups group by extension_group_id order by extension_group_id;";
$rsltx=mysql_query($stmt, $link);
$extengrp_to_print = mysql_num_rows($rsltx);
$extengrp_list='';
$o=0;
while ($extengrp_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
$extengrp_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "<br>MODIFY A REMOTE AGENTS ENTRY: $row[0]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=41111>\n";
echo "<input type=hidden name=remote_agent_id value=\"$row[0]\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=3&user=$user_start\">User ID Start</a>: </td><td align=left><input type=text name=user_start size=9 maxlength=9 value=\"$user_start\"> (numbers only, incremented, must be an existing vicidial user)$NWB#vicidial_remote_agents-user_start$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Number of Lines: </td><td align=left><input type=text name=number_of_lines size=3 maxlength=3 value=\"$number_of_lines\"> (numbers only)$NWB#vicidial_remote_agents-number_of_lines$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server IP: </td><td align=left><select size=1 name=server_ip>\n";
echo "$servers_list";
echo "<option SELECTED>$row[3]</option>\n";
echo "</select>$NWB#vicidial_remote_agents-server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>External Extension: </td><td align=left><input type=text name=conf_exten size=20 maxlength=20 value=\"$conf_exten\"> (dial plan number dialed to reach agents)$NWB#vicidial_remote_agents-conf_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Extension Group: </td><td align=left><select size=1 name=extension_group>\n";
echo "$extengrp_list";
echo "<option>NONE</option>\n";
echo "<option SELECTED>$extension_group</option>\n";
echo "</select>$NWB#vicidial_remote_agents-extension_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Status: </td><td align=left><select size=1 name=status><option SELECTED>ACTIVE</option><option>INACTIVE</option><option SELECTED>$status</option></select>$NWB#vicidial_remote_agents-status$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign: </td><td align=left><select size=1 name=campaign_id>\n";
echo "$campaigns_list";
echo "<option SELECTED>$campaign_id</option>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>On-Hook Agent: </td><td align=left><select size=1 name=on_hook_agent><option>Y</option><option>N</option><option SELECTED>$on_hook_agent</option></select>$NWB#vicidial_remote_agents-on_hook_agent$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>On-Hook Ring Time: </td><td align=left><input type=text name=on_hook_ring_time size=5 maxlength=4 value=\"$on_hook_ring_time\"> $NWB#vicidial_remote_agents-on_hook_ring_time$NWE</td></tr>\n";
echo "</select>$NWB#vicidial_remote_agents-campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Inbound Groups: </td><td align=left>\n";
echo "$groups_list";
echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n";
if ($LOGdelete_remote_agents > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=51111&remote_agent_id=$remote_agent_id\">DELETE THIS REMOTE AGENT</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=REMOTEAGENTS&stage=$remote_agent_id\">Click here to see Admin changes to this remote agent</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=3711 modify filter phone group info in the system
######################
if ($ADD==3711)
{
if ($LOGmodify_dids==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=3711&filter_phone_group_id=$filter_phone_group_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT filter_phone_group_id,filter_phone_group_name,filter_phone_group_description from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$filter_phone_group_id = $row[0];
$filter_phone_group_name = $row[1];
$filter_phone_group_description = $row[2];
echo "<br>Modify Filter Phone Group: $filter_phone_group_id<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=4711>\n";
echo "<input type=hidden name=filter_phone_group_id value=\"$filter_phone_group_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Filter Phone Group ID: </td><td align=left> <B>$filter_phone_group_id</B> $NWB#vicidial_filter_phone_groups-user_start$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Filter Phone Group Name: </td><td align=left><input type=text name=filter_phone_group_name size=40 maxlength=40 value=\"$filter_phone_group_name\"> $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Filter Phone Group Description: </td><td align=left><input type=text name=filter_phone_group_description size=60 maxlength=100 value=\"$filter_phone_group_description\"> $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
$stmt="SELECT count(*) from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
echo "<br><br>Numbers in this Filter Phone Group: $row[0]";
if ($LOGdelete_dids > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=5711&filter_phone_group_id=$filter_phone_group_id\">DELETE THIS FILTER PHONE GROUP</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"./list_download.php?group_id=$filter_phone_group_id&download_type=fpgn\">Click here to download the numbers in this filter phone group</FONT>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=FILTERPHONEGROUPS&stage=$filter_phone_group_id\">Click here to see Admin changes to this filter phone group</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=32111 modify extension group entry in the system
######################
if ($ADD==32111)
{
if ($LOGmodify_remoteagents==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=32111&extension_id=$extension_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT extension_id,extension_group_id,extension,rank,campaign_groups,call_count_today,last_call_time,last_callerid from vicidial_extension_groups where extension_id='$extension_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$extension_id = $row[0];
$extension_group_id = $row[1];
$extension = $row[2];
$rank = $row[3];
$campaign_groups = $row[4];
$call_count_today = $row[5];
$last_call_time = $row[6];
$last_callerid = $row[7];
echo "<br>MODIFY AN EXTENSION GROUP ENTRY: $row[0]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=42111>\n";
echo "<input type=hidden name=extension_id value=\"$extension_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Extension Group: </td><td align=left><input type=text name=extension_group_id size=20 maxlength=20 value=\"$extension_group_id\"> (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Extension: </td><td align=left><input type=text name=extension size=18 maxlength=18 value=\"$extension\"> (numbers only)$NWB#vicidial_extension_groups-extension$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Rank: </td><td align=left><select size=1 name=rank>\n";
$n=99;
$rankfound=0;
while ($n>=-99)
{
if ($n == $rank)
{echo "<option SELECTED value=\"$n\">$n</option>\n"; $rankfound++;}
else
{echo "<option value=\"$n\">$n</option>\n";}
$n--;
}
if ($rankfound < 1)
{echo "<option SELECTED value=\"$rank\">$rank</option>\n";}
echo "</select> $NWB#vicidial_extension_groups-rank$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaigns Groups: </td><td align=left><input type=text name=campaign_groups size=50 maxlength=255 value=\"$campaign_groups\"> (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Call Count Today: </td><td align=left>$call_count_today</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Last Call Time: </td><td align=left>$last_call_time</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Last Call ID: </td><td align=left>$last_callerid</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
if ($LOGdelete_remote_agents > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=52111&extension_id=$extension_id\">DELETE THIS EXTENSION GROUP ENTRY</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=EXTENGROUP&stage=$extension_id\">Click here to see Admin changes to this extension group entry</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=311111 modify user group info in the system
######################
if ($ADD==311111)
{
if ($LOGmodify_usergroups==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=311111&user_group=$user_group";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT user_group,group_name,allowed_campaigns,qc_allowed_campaigns,qc_allowed_inbound_groups,group_shifts,forced_timeclock_login,shift_enforcement,agent_status_viewable_groups,agent_status_view_time,agent_call_log_view,agent_xfer_consultative,agent_xfer_dial_override,agent_xfer_vm_transfer,agent_xfer_blind_transfer,agent_xfer_dial_with_customer,agent_xfer_park_customer_dial,agent_fullscreen,allowed_reports,webphone_url_override,webphone_systemkey_override,webphone_dialpad_override from vicidial_user_groups where user_group='$user_group';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$user_group = $row[0];
$group_name = $row[1];
$GROUP_shifts = $row[5];
$forced_timeclock_login = $row[6];
$shift_enforcement = $row[7];
$VGROUP_vgroups = $row[8];
$agent_status_view_time = $row[9];
$agent_call_log_view = $row[10];
$agent_xfer_consultative = $row[11];
$agent_xfer_dial_override = $row[12];
$agent_xfer_vm_transfer = $row[13];
$agent_xfer_blind_transfer = $row[14];
$agent_xfer_dial_with_customer = $row[15];
$agent_xfer_park_customer_dial = $row[16];
$agent_fullscreen = $row[17];
$allowed_reports = $row[18];
$webphone_url_override = $row[19];
$webphone_systemkey_override = $row[20];
$webphone_dialpad_override = $row[21];
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>MODIFY A USERS GROUP ENTRY<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=411111>\n";
echo "<input type=hidden name=OLDuser_group value=\"$user_group\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Group: </td><td align=left><input type=text name=user_group size=15 maxlength=20 value=\"$user_group\"> (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Description: </td><td align=left><input type=text name=group_name size=40 maxlength=40 value=\"$group_name\"> (description of group)$NWB#vicidial_user_groups-group_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Force Timeclock Login: </td><td align=left><select size=1 name=forced_timeclock_login><option SELECTED>N</option><option>Y</option><option>ADMIN_EXEMPT</option><option SELECTED>$forced_timeclock_login</option></select>$NWB#vicidial_user_groups-forced_timeclock_login$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Enforcement: </td><td align=left><select size=1 name=shift_enforcement><option SELECTED>OFF</option><option>START</option><option>ALL</option><option>ADMIN_EXEMPT</option><option SELECTED>$shift_enforcement</option></select>$NWB#vicidial_user_groups-shift_enforcement$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Allowed Campaigns: <BR>$NWB#vicidial_user_groups-allowed_campaigns$NWE</td><td align=left>\n";
echo "$campaigns_list <BR>&nbsp;";
echo "</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Group Shifts: <BR>$NWB#vicidial_user_groups-group_shifts$NWE</td><td align=left>\n";
$stmt="SELECT shift_id,shift_name from vicidial_shifts order by shift_id";
$rslt=mysql_query($stmt, $link);
$shifts_to_print = mysql_num_rows($rslt);
$o=0;
while ($shifts_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$shift_id_value = $rowx[0];
$shift_name_value = $rowx[1];
echo "<input type=\"checkbox\" name=\"group_shifts[]\" value=\"$shift_id_value\"";
$p=0;
while ($p<1000)
{
if (ereg(" $shift_id_value ", $GROUP_shifts))
{
echo " CHECKED";
}
$p++;
}
echo "> <a href=\"$PHP_SELF?ADD=331111111&shift_id=$shift_id_value\">$shift_id_value</a> - $shift_name_value<BR>\n";
$o++;
}
echo " <BR>&nbsp;</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Status Viewable Groups: <BR>$NWB#vicidial_user_groups-agent_status_viewable_groups$NWE</td><td align=left>\n";
echo "<input type=\"checkbox\" name=\"agent_status_viewable_groups[]\" value=\"--ALL-GROUPS--\"";
if (ereg(" --ALL-GROUPS-- ", $VGROUP_vgroups))
{echo " CHECKED";}
echo "><B>ALL-GROUPS</B> - All user groups in the system<BR>\n";
echo "<input type=\"checkbox\" name=\"agent_status_viewable_groups[]\" value=\"--CAMPAIGN-AGENTS--\"";
if (ereg(" --CAMPAIGN-AGENTS-- ", $VGROUP_vgroups))
{echo " CHECKED";}
echo "><B>CAMPAIGN-AGENTS</B> - All users logged into the same campaign as the agent<BR>\n";
echo "<input type=\"checkbox\" name=\"agent_status_viewable_groups[]\" value=\"--NOT-LOGGED-IN-AGENTS--\"";
if (ereg(" --NOT-LOGGED-IN-AGENTS-- ", $VGROUP_vgroups))
{echo " CHECKED";}
echo "><B>NOT-LOGGED-IN-AGENTS</B> - All users in the system, even not logged-in users<BR>\n";
$stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group";
$rslt=mysql_query($stmt, $link);
$view_groups_to_print = mysql_num_rows($rslt);
$o=0;
while ($view_groups_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$vgroups_id_value = $rowx[0];
$vgroups_name_value = $rowx[1];
echo "<input type=\"checkbox\" name=\"agent_status_viewable_groups[]\" value=\"$vgroups_id_value\"";
$p=0;
while ($p<1000)
{
if (ereg(" $vgroups_id_value ", $VGROUP_vgroups))
{
echo " CHECKED";
}
$p++;
}
echo "> <a href=\"$PHP_SELF?ADD=311111&user_group=$vgroups_id_value\">$vgroups_id_value</a> - $vgroups_name_value<BR>\n";
$o++;
}
echo " <BR>&nbsp;</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Status View Time: </td><td align=left><select size=1 name=agent_status_view_time><option SELECTED>Y</option><option>N</option><option SELECTED>$agent_status_view_time</option></select>$NWB#vicidial_user_groups-agent_status_view_time$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Call Log View: </td><td align=left><select size=1 name=agent_call_log_view><option SELECTED>Y</option><option>N</option><option SELECTED>$agent_call_log_view</option></select>$NWB#vicidial_user_groups-agent_call_log_view$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Allow Consultative Xfer: </td><td align=left><select size=1 name=agent_xfer_consultative><option SELECTED>Y</option><option>N</option><option SELECTED>$agent_xfer_consultative</option></select>$NWB#vicidial_user_groups-agent_xfer_options$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Allow Dial Override Xfer: </td><td align=left><select size=1 name=agent_xfer_dial_override><option SELECTED>Y</option><option>N</option><option SELECTED>$agent_xfer_dial_override</option></select>$NWB#vicidial_user_groups-agent_xfer_options$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Allow Voicemail Message Xfer: </td><td align=left><select size=1 name=agent_xfer_vm_transfer><option SELECTED>Y</option><option>N</option><option SELECTED>$agent_xfer_vm_transfer</option></select>$NWB#vicidial_user_groups-agent_xfer_options$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Allow Blind Xfer: </td><td align=left><select size=1 name=agent_xfer_blind_transfer><option SELECTED>Y</option><option>N</option><option SELECTED>$agent_xfer_blind_transfer</option></select>$NWB#vicidial_user_groups-agent_xfer_options$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Allow Dial With Customer Xfer: </td><td align=left><select size=1 name=agent_xfer_dial_with_customer><option SELECTED>Y</option><option>N</option><option SELECTED>$agent_xfer_dial_with_customer</option></select>$NWB#vicidial_user_groups-agent_xfer_options$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Allow Park Customer Dial Xfer: </td><td align=left><select size=1 name=agent_xfer_park_customer_dial><option SELECTED>Y</option><option>N</option><option SELECTED>$agent_xfer_park_customer_dial</option></select>$NWB#vicidial_user_groups-agent_xfer_options$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Fullscreen: </td><td align=left><select size=1 name=agent_fullscreen><option SELECTED>Y</option><option>N</option><option SELECTED>$agent_fullscreen</option></select>$NWB#vicidial_user_groups-agent_fullscreen$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Allowed Reports: </td><td align=left><select MULTIPLE size=8 name=allowed_reports[]>\n";
$Vreports_ARY = explode(',',$UGreports);
$Vreports_ct = count($Vreports_ARY);
$b=0;
while ($b < $Vreports_ct)
{
$field_selected='';
trim($Vreports_ARY[$b]);
if (preg_match("/$Vreports_ARY[$b]/",$allowed_reports))
{$field_selected = 'SELECTED';}
echo "<option value=\"$Vreports_ARY[$b]\" $field_selected>$Vreports_ARY[$b]</option>\n";
$b++;
}
echo "</select>$NWB#vicidial_user_groups-allowed_reports$NWE</td></tr>\n";
if (strlen($SSwebphone_url) > 5)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Webphone URL Override: </td><td align=left><input type=text name=webphone_url_override size=60 maxlength=255 value=\"$webphone_url_override\"> $NWB#vicidial_user_groups-webphone_url_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Webphone System Key Override: </td><td align=left><input type=text name=webphone_systemkey_override size=60 maxlength=100 value=\"$webphone_systemkey_override\"> $NWB#vicidial_user_groups-webphone_systemkey_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Webphone Dialpad Override: </td><td align=left><select size=1 name=webphone_dialpad_override><option>DISABLED</option><option>Y</option><option>N</option><option>TOGGLE</option><option>TOGGLE_OFF</option><option SELECTED>$webphone_dialpad_override</option></select>$NWB#vicidial_user_groups-webphone_dialpad_override$NWE</td></tr>\n";
}
else
{
echo "<input type=hidden name=webphone_url_override value=\"$webphone_url_override\"> ";
echo "<input type=hidden name=webphone_systemkey_override value=\"$webphone_systemkey_override\"> ";
echo "<input type=hidden name=webphone_dialpad_override value=\"$webphone_dialpad_override\"> ";
}
if ($SSqc_features_active > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=right>QC Allowed Campaigns: <BR>$NWB#vicidial_user_groups-qc_allowed_campaigns$NWE</td><td align=left>\n";
echo "$qc_campaigns_list";
echo " <BR>&nbsp;</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>QC Allowed Inbound Groups: <BR>$NWB#vicidial_user_groups-qc_allowed_inbound_groups$NWE</td><td align=left>\n";
echo "$qc_groups_list";
echo " <BR>&nbsp;</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
### list of users in this user group
$active_confs = 0;
$stmt="SELECT user,full_name,user_level,active from vicidial_users where user_group='$user_group'";
$rsltx=mysql_query($stmt, $link);
$users_to_print = mysql_num_rows($rsltx);
echo "<center>\n";
echo "<br><b>USERS WITHIN THIS USER GROUP: $users_to_print</b><br>\n";
echo "<TABLE width=400 cellspacing=3>\n";
echo "<tr><td>USER</td><td>FULL NAME</td><td>LEVEL</td><td>ACTIVE</td></tr>\n";
$o=0;
while ($users_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
$o++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor>\n";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=3&user=$rowx[0]\">$rowx[0]</a></td>\n";
echo "<td><font size=1>$rowx[1]</td>\n";
echo "<td><font size=1>$rowx[2]</td>\n";
echo "<td><font size=1>$rowx[3]</td>\n";
echo "</tr>\n";
}
echo "</table></center><br>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=8111&user_group=$user_group\">Click here to see all CallBack Holds in this user group</a><BR><BR>\n";
echo "<br><br><a href=\"./timeclock_status.php?user_group=$user_group\">Click here to see the Timeclock Status for this user group</a><BR><BR>\n";
if ($LOGdelete_user_groups > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=511111&user_group=$user_group\">DELETE THIS USER GROUP</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=USERGROUPS&stage=$user_group\">Click here to see Admin changes to this user group</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=3111111 modify script info in the system
######################
if ($ADD==3111111)
{
if ($LOGmodify_scripts==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=3111111&script_id=$script_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$script_name = $row[1];
$script_comments = $row[2];
$script_text = stripslashes($row[3]);
$active = $row[4];
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>MODIFY A SCRIPT<form name=scriptForm action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=4111111>\n";
echo "<input type=hidden name=DB value=\"$DB\">\n";
echo "<input type=hidden name=script_id value=\"$script_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Script ID: </td><td align=left><B>$script_id</B>$NWB#vicidial_scripts-script_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Script Name: </td><td align=left><input type=text name=script_name size=40 maxlength=50 value=\"$script_name\"> (title of the script)$NWB#vicidial_scripts-script_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Script Comments: </td><td align=left><input type=text name=script_comments size=50 maxlength=255 value=\"$script_comments\"> $NWB#vicidial_scripts-script_comments$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option SELECTED>Y</option><option>N</option><option selected>$active</option></select>$NWB#vicidial_scripts-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Script Text: <BR><BR><B><a href=\"javascript:openNewWindow('$PHP_SELF?ADD=7111111&script_id=$script_id')\">Preview Script</a></B> </td><td align=left>";
# BEGIN Insert Field
echo "<select id=\"selectedField\" name=\"selectedField\">";
echo "<option value=\"fullname\">Agent Name</option>";
echo "<option>vendor_lead_code</option>";
echo "<option>source_id</option>";
echo "<option>list_id</option>";
echo "<option>gmt_offset_now</option>";
echo "<option>called_since_last_reset</option>";
echo "<option>phone_code</option>";
echo "<option>phone_number</option>";
echo "<option>title</option>";
echo "<option>first_name</option>";
echo "<option>middle_initial</option>";
echo "<option>last_name</option>";
echo "<option>address1</option>";
echo "<option>address2</option>";
echo "<option>address3</option>";
echo "<option>city</option>";
echo "<option>state</option>";
echo "<option>province</option>";
echo "<option>postal_code</option>";
echo "<option>country_code</option>";
echo "<option>gender</option>";
echo "<option>date_of_birth</option>";
echo "<option>alt_phone</option>";
echo "<option>email</option>";
echo "<option>security_phrase</option>";
echo "<option>comments</option>";
echo "<option>lead_id</option>";
echo "<option>campaign</option>";
echo "<option>phone_login</option>";
echo "<option>group</option>";
echo "<option>channel_group</option>";
echo "<option>SQLdate</option>";
echo "<option>epoch</option>";
echo "<option>uniqueid</option>";
echo "<option>customer_zap_channel</option>";
echo "<option>server_ip</option>";
echo "<option>SIPexten</option>";
echo "<option>session_id</option>";
echo "<option>dialed_number</option>";
echo "<option>dialed_label</option>";
echo "<option>rank</option>";
echo "<option>owner</option>";
echo "<option>camp_script</option>";
echo "<option>in_script</option>";
echo "<option>script_width</option>";
echo "<option>script_height</option>";
echo "<option>recording_filename</option>";
echo "<option>recording_id</option>";
echo "<option>user_custom_one</option>";
echo "<option>user_custom_two</option>";
echo "<option>user_custom_three</option>";
echo "<option>user_custom_four</option>";
echo "<option>user_custom_five</option>";
echo "<option>preset_number_a</option>";
echo "<option>preset_number_b</option>";
echo "<option>preset_number_c</option>";
echo "<option>preset_number_d</option>";
echo "<option>preset_number_e</option>";
echo "<option>preset_number_f</option>";
echo "<option>preset_dtmf_a</option>";
echo "<option>preset_dtmf_b</option>";
echo "<option>did_id</option>";
echo "<option>did_extension</option>";
echo "<option>did_pattern</option>";
echo "<option>did_description</option>";
echo "<option>closecallid</option>";
echo "<option>xfercallid</option>";
echo "<option>agent_log_id</option>";
echo "<option>entry_list_id</option>";
echo "</select>";
echo "<input type=\"button\" name=\"insertField\" value=\"Insert\" onClick=\"scriptInsertField();\"><BR>";
# END Insert Field
echo "<TEXTAREA NAME=script_text ROWS=20 COLS=50>$script_text</TEXTAREA> $NWB#vicidial_scripts-script_text$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
echo "</TABLE><BR><BR>\n";
echo "<B> CAMPAIGNS USING THIS SCRIPT:</B><BR>\n";
echo "<TABLE>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id' $LOGallowed_campaignsSQL;";
$rslt=mysql_query($stmt, $link);
$camps_to_print = mysql_num_rows($rslt);
$o=0;
while ($camps_to_print > $o)
{
$row=mysql_fetch_row($rslt);
echo "<TR><TD><a href=\"$PHP_SELF?ADD=31&campaign_id=$row[0]\">$row[0] </a></TD><TD> $row[1]<BR></TD></TR>\n";
$o++;
}
echo "</TABLE><BR><BR>\n";
echo "<B> IN-GROUPS USING THIS SCRIPT:</B><BR>\n";
echo "<TABLE>\n";
$stmt="SELECT group_id,group_name from vicidial_inbound_groups where ingroup_script='$script_id';";
$rslt=mysql_query($stmt, $link);
$camps_to_print = mysql_num_rows($rslt);
$o=0;
while ($camps_to_print > $o)
{
$row=mysql_fetch_row($rslt);
echo "<TR><TD><a href=\"$PHP_SELF?ADD=3111&group_id=$row[0]\">$row[0] </a></TD><TD> $row[1]<BR></TD></TR>\n";
$o++;
}
echo "</TABLE><BR><BR>\n";
echo "<B> LIST OVERRIDES USING THIS SCRIPT:</B><BR>\n";
echo "<TABLE>\n";
$stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id' $LOGallowed_campaignsSQL;";
$rslt=mysql_query($stmt, $link);
$camps_to_print = mysql_num_rows($rslt);
$o=0;
while ($camps_to_print > $o)
{
$row=mysql_fetch_row($rslt);
echo "<TR><TD><a href=\"$PHP_SELF?ADD=311&list_id=$row[0]\">$row[0] </a></TD><TD> $row[1]<BR></TD></TR>\n";
$o++;
}
if ($LOGdelete_scripts > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=5111111&script_id=$script_id\">DELETE THIS SCRIPT</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=SCRIPTS&stage=$script_id\">Click here to see Admin changes to this script</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=31111111 modify filter info in the system
######################
if ($ADD==31111111)
{
if ($LOGmodify_filters==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=31111111&lead_filter_id=$lead_filter_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_comments,lead_filter_sql from vicidial_lead_filters where lead_filter_id='$lead_filter_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$lead_filter_name = $row[1];
$lead_filter_comments = $row[2];
$lead_filter_sql = stripslashes($row[3]);
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>MODIFY A FILTER<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=41111111>\n";
echo "<input type=hidden name=DB value=\"$DB\">\n";
echo "<input type=hidden name=lead_filter_id value=\"$lead_filter_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Filter ID: </td><td align=left><B>$lead_filter_id</B>$NWB#vicidial_lead_filters-lead_filter_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Filter Name: </td><td align=left><input type=text name=lead_filter_name size=40 maxlength=50 value=\"$lead_filter_name\"> (short description of the filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Filter Comments: </td><td align=left><input type=text name=lead_filter_comments size=50 maxlength=255 value=\"$lead_filter_comments\"> $NWB#vicidial_lead_filters-lead_filter_comments$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Filter SQL:</td><td align=left><TEXTAREA NAME=lead_filter_sql ROWS=20 COLS=50>$lead_filter_sql</TEXTAREA> $NWB#vicidial_lead_filters-lead_filter_sql$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center></form>\n";
##### get campaigns listing for dynamic pulldown
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$campaigns_list='';
$o=0;
while ($campaigns_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "<BR><BR>";
echo "<br>TEST ON CAMPAIGN: <form action=$PHP_SELF method=POST target=\"_blank\">\n";
echo "<input type=hidden name=lead_filter_id value=\"$lead_filter_id\">\n";
echo "<input type=hidden name=ADD value=\"73\">\n";
echo "<select size=1 name=campaign_id>\n";
echo "$campaigns_list";
echo "</select>\n";
echo "<input type=submit name=SUBMIT value=SUBMIT>\n";
if ($LOGdelete_filters > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=51111111&lead_filter_id=$lead_filter_id\">DELETE THIS FILTER</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=FILTERS&stage=$lead_filter_id\">Click here to see Admin changes to this filter</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=321111111 modify call time definition info in the system, ADD/REMOVE
######################
if ($ADD==321111111)
{
if ($LOGmodify_call_times==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=311111111&call_time_id=$call_time_id";
$modify_footer_refresh=1;
}
if ( ($stage=="ADD") and (strlen($state_rule)>0) )
{
$stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$ct_state_call_times = $row[0];
if (eregi("\|$",$ct_state_call_times))
{$ct_state_call_times = "$ct_state_call_times$state_rule\|";}
else
{$ct_state_call_times = "$ct_state_call_times\|$state_rule\|";}
$stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';";
$rslt=mysql_query($stmt, $link);
echo "State Rule Added: $state_rule<BR>\n";
}
if ( ($stage=="REMOVE") and (strlen($state_rule)>0) )
{
$stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$ct_state_call_times = $row[0];
$ct_state_call_times = eregi_replace("\|$state_rule\|",'|',$ct_state_call_times);
$stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';";
$rslt=mysql_query($stmt, $link);
echo "State Rule Removed: $state_rule<BR>\n";
}
$ADD=311111111;
}
else
{
echo "You are not authorized to view this page. Please go back.";
}
}
######################
# ADD=311111111 modify call time definition info in the system
######################
if ($ADD==311111111)
{
if ($LOGmodify_call_times==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=311111111&call_time_id=$call_time_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT call_time_id,call_time_name,call_time_comments,ct_default_start,ct_default_stop,ct_sunday_start,ct_sunday_stop,ct_monday_start,ct_monday_stop,ct_tuesday_start,ct_tuesday_stop,ct_wednesday_start,ct_wednesday_stop,ct_thursday_start,ct_thursday_stop,ct_friday_start,ct_friday_stop,ct_saturday_start,ct_saturday_stop,ct_state_call_times,default_afterhours_filename_override,sunday_afterhours_filename_override,monday_afterhours_filename_override,tuesday_afterhours_filename_override,wednesday_afterhours_filename_override,thursday_afterhours_filename_override,friday_afterhours_filename_override,saturday_afterhours_filename_override from vicidial_call_times where call_time_id='$call_time_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$call_time_name = $row[1];
$call_time_comments = $row[2];
$ct_default_start = $row[3];
$ct_default_stop = $row[4];
$ct_sunday_start = $row[5];
$ct_sunday_stop = $row[6];
$ct_monday_start = $row[7];
$ct_monday_stop = $row[8];
$ct_tuesday_start = $row[9];
$ct_tuesday_stop = $row[10];
$ct_wednesday_start = $row[11];
$ct_wednesday_stop = $row[12];
$ct_thursday_start = $row[13];
$ct_thursday_stop = $row[14];
$ct_friday_start = $row[15];
$ct_friday_stop = $row[16];
$ct_saturday_start = $row[17];
$ct_saturday_stop = $row[18];
$ct_state_call_times = $row[19];
$default_afterhours_filename_override = $row[20];
$sunday_afterhours_filename_override = $row[21];
$monday_afterhours_filename_override = $row[22];
$tuesday_afterhours_filename_override = $row[23];
$wednesday_afterhours_filename_override = $row[24];
$thursday_afterhours_filename_override = $row[25];
$friday_afterhours_filename_override = $row[26];
$saturday_afterhours_filename_override = $row[27];
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>MODIFY A CALL TIME<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=411111111>\n";
echo "<input type=hidden name=DB value=\"$DB\">\n";
echo "<input type=hidden name=call_time_id value=\"$call_time_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Call Time ID: </td><td align=left colspan=3><B>$call_time_id</B>$NWB#vicidial_call_times-call_time_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Call Time Name: </td><td align=left colspan=3><input type=text name=call_time_name size=40 maxlength=50 value=\"$call_time_name\"> (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Call Time Comments: </td><td align=left colspan=3><input type=text name=call_time_comments size=50 maxlength=255 value=\"$call_time_comments\"> $NWB#vicidial_call_times-call_time_comments$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Start:</td><td align=left><input type=text name=ct_default_start size=5 maxlength=4 value=\"$ct_default_start\"> </td><td align=right>Default Stop:</td><td align=left nowrap><input type=text name=ct_default_stop size=5 maxlength=4 value=\"$ct_default_stop\"> $NWB#vicidial_call_times-ct_default_start$NWE &nbsp; &nbsp; &nbsp; AH Override: <input type=text name=default_afterhours_filename_override id=default_afterhours_filename_override size=20 maxlength=255 value=\"$default_afterhours_filename_override\"> <a href=\"javascript:launch_chooser('default_afterhours_filename_override','date',30);\">audio chooser</a> $NWB#vicidial_call_times-default_afterhours_filename_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Sunday Start:</td><td align=left><input type=text name=ct_sunday_start size=5 maxlength=4 value=\"$ct_sunday_start\"> </td><td align=right>Sunday Stop:</td><td align=left><input type=text name=ct_sunday_stop size=5 maxlength=4 value=\"$ct_sunday_stop\"> $NWB#vicidial_call_times-ct_sunday_start$NWE &nbsp; &nbsp; &nbsp; AH Override: <input type=text name=sunday_afterhours_filename_override id=sunday_afterhours_filename_override size=20 maxlength=255 value=\"$sunday_afterhours_filename_override\"> <a href=\"javascript:launch_chooser('sunday_afterhours_filename_override','date',30);\">audio chooser</a> $NWB#vicidial_call_times-default_afterhours_filename_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Monday Start:</td><td align=left><input type=text name=ct_monday_start size=5 maxlength=4 value=\"$ct_monday_start\"> </td><td align=right>Monday Stop:</td><td align=left><input type=text name=ct_monday_stop size=5 maxlength=4 value=\"$ct_monday_stop\"> $NWB#vicidial_call_times-ct_sunday_start$NWE &nbsp; &nbsp; &nbsp; AH Override: <input type=text name=monday_afterhours_filename_override id=monday_afterhours_filename_override size=20 maxlength=255 value=\"$monday_afterhours_filename_override\"> <a href=\"javascript:launch_chooser('monday_afterhours_filename_override','date',30);\">audio chooser</a> $NWB#vicidial_call_times-default_afterhours_filename_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Tuesday Start:</td><td align=left><input type=text name=ct_tuesday_start size=5 maxlength=4 value=\"$ct_tuesday_start\"> </td><td align=right>Tuesday Stop:</td><td align=left><input type=text name=ct_tuesday_stop size=5 maxlength=4 value=\"$ct_tuesday_stop\"> $NWB#vicidial_call_times-ct_sunday_start$NWE &nbsp; &nbsp; &nbsp; AH Override: <input type=text name=tuesday_afterhours_filename_override id=tuesday_afterhours_filename_override size=20 maxlength=255 value=\"$tuesday_afterhours_filename_override\"> <a href=\"javascript:launch_chooser('tuesday_afterhours_filename_override','date',30);\">audio chooser</a> $NWB#vicidial_call_times-default_afterhours_filename_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Wednesday Start:</td><td align=left><input type=text name=ct_wednesday_start size=5 maxlength=4 value=\"$ct_wednesday_start\"> </td><td align=right>Wednesday Stop:</td><td align=left><input type=text name=ct_wednesday_stop size=5 maxlength=4 value=\"$ct_wednesday_stop\"> $NWB#vicidial_call_times-ct_sunday_start$NWE &nbsp; &nbsp; &nbsp; AH Override: <input type=text name=wednesday_afterhours_filename_override id=wednesday_afterhours_filename_override size=20 maxlength=255 value=\"$wednesday_afterhours_filename_override\"> <a href=\"javascript:launch_chooser('wednesday_afterhours_filename_override','date',30);\">audio chooser</a> $NWB#vicidial_call_times-default_afterhours_filename_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Thursday Start:</td><td align=left><input type=text name=ct_thursday_start size=5 maxlength=4 value=\"$ct_thursday_start\"> </td><td align=right>Thursday Stop:</td><td align=left><input type=text name=ct_thursday_stop size=5 maxlength=4 value=\"$ct_thursday_stop\"> $NWB#vicidial_call_times-ct_sunday_start$NWE &nbsp; &nbsp; &nbsp; AH Override: <input type=text name=thursday_afterhours_filename_override id=thursday_afterhours_filename_override size=20 maxlength=255 value=\"$thursday_afterhours_filename_override\"> <a href=\"javascript:launch_chooser('thursday_afterhours_filename_override','date',30);\">audio chooser</a> $NWB#vicidial_call_times-default_afterhours_filename_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Friday Start:</td><td align=left><input type=text name=ct_friday_start size=5 maxlength=4 value=\"$ct_friday_start\"> </td><td align=right>Friday Stop:</td><td align=left><input type=text name=ct_friday_stop size=5 maxlength=4 value=\"$ct_friday_stop\"> $NWB#vicidial_call_times-ct_sunday_start$NWE &nbsp; &nbsp; &nbsp; AH Override: <input type=text name=friday_afterhours_filename_override id=friday_afterhours_filename_override size=20 maxlength=255 value=\"$friday_afterhours_filename_override\"> <a href=\"javascript:launch_chooser('friday_afterhours_filename_override','date',30);\">audio chooser</a> $NWB#vicidial_call_times-default_afterhours_filename_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Saturday Start:</td><td align=left><input type=text name=ct_saturday_start size=5 maxlength=4 value=\"$ct_saturday_start\"> </td><td align=right>Saturday Stop:</td><td align=left><input type=text name=ct_saturday_stop size=5 maxlength=4 value=\"$ct_saturday_stop\"> $NWB#vicidial_call_times-ct_sunday_start$NWE &nbsp; &nbsp; &nbsp; AH Override: <input type=text name=saturday_afterhours_filename_override id=saturday_afterhours_filename_override size=20 maxlength=255 value=\"$saturday_afterhours_filename_override\"> <a href=\"javascript:launch_chooser('saturday_afterhours_filename_override','date',30);\">audio chooser</a> $NWB#vicidial_call_times-default_afterhours_filename_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=4><input type=submit name=SUBMIT value=SUBMIT></FORM></td></tr>\n";
$ct_srs=1;
$b=0;
$srs_SQL ='';
if (strlen($ct_state_call_times)>2)
{
$state_rules = explode('|',$ct_state_call_times);
$ct_srs = ((count($state_rules)) - 1);
}
echo "<tr bgcolor=#B6D3FC><td align=center rowspan=$ct_srs>Active State Call Time Definitions for this Record: </td>\n";
echo "<td align=center colspan=3>&nbsp;</td></tr>\n";
while($ct_srs >= $b)
{
if (strlen($state_rules[$b])>0)
{
$stmt="SELECT state_call_time_state,state_call_time_name from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
echo "<tr bgcolor=#B6D3FC><td align=right colspan=2><a href=\"$PHP_SELF?ADD=3111111111&call_time_id=$state_rules[$b]\">$state_rules[$b] </a> - <a href=\"$PHP_SELF?ADD=321111111&call_time_id=$call_time_id&state_rule=$state_rules[$b]&stage=REMOVE\">REMOVE </a></td><td align=left>$row[0] - $row[1]</td></tr>\n";
$srs_SQL .= "'$state_rules[$b]',";
$srs_state_SQL .= "'$row[0]',";
}
$b++;
}
if (strlen($srs_SQL)>2)
{
$srs_SQL = "$srs_SQL''";
$srs_state_SQL = "$srs_state_SQL''";
$srs_SQL = "where state_call_time_id NOT IN($srs_SQL) and state_call_time_state NOT IN($srs_state_SQL)";
}
else
{$srs_SQL='';}
$stmt="SELECT state_call_time_id,state_call_time_name from vicidial_state_call_times $srs_SQL order by state_call_time_id;";
$rslt=mysql_query($stmt, $link);
$sct_to_print = mysql_num_rows($rslt);
$sct_list='';
$o=0;
while ($sct_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$sct_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "<tr bgcolor=#B6D3FC><td align=right><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=321111111>\n";
echo "<input type=hidden name=stage value=\"ADD\">\n";
echo "<input type=hidden name=call_time_id value=\"$call_time_id\">\n";
echo "Add state call time rule: </td><td align=left colspan=2><select size=1 name=state_rule>\n";
echo "$sct_list";
echo "</select></td>\n";
echo "<td align=center colspan=4><input type=submit name=SUBMIT value=SUBMIT></FORM></td></tr>\n";
echo "</TABLE><BR><BR>\n";
echo "<B>CAMPAIGNS USING THIS CALL TIME:</B><BR>\n";
echo "<TABLE>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id' $LOGallowed_campaignsSQL;";
$rslt=mysql_query($stmt, $link);
$camps_to_print = mysql_num_rows($rslt);
$o=0;
while ($camps_to_print > $o)
{
$row=mysql_fetch_row($rslt);
echo "<TR><TD><a href=\"$PHP_SELF?ADD=31&campaign_id=$row[0]\">$row[0] </a></TD><TD> $row[1]<BR></TD></TR>\n";
$o++;
}
echo "</TABLE>\n";
echo "<B>INBOUND GROUPS USING THIS CALL TIME:</B><BR>\n";
echo "<TABLE>\n";
$stmt="SELECT group_id,group_name from vicidial_inbound_groups where call_time_id='$call_time_id';";
$rslt=mysql_query($stmt, $link);
$camps_to_print = mysql_num_rows($rslt);
$o=0;
while ($camps_to_print > $o)
{
$row=mysql_fetch_row($rslt);
echo "<TR><TD><a href=\"$PHP_SELF?ADD=3111&group_id=$row[0]\">$row[0] </a></TD><TD> $row[1]<BR></TD></TR>\n";
$o++;
}
echo "</TABLE>\n";
echo "</center><BR><BR>\n";
if ($LOGdelete_call_times > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=511111111&call_time_id=$call_time_id\">DELETE THIS CALL TIME DEFINITION</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=CALLTIMES&stage=$call_time_id\">Click here to see Admin changes to this call time</FONT>\n";
}
}
else
{
echo "You are not authorized to view this page. Please go back.";
}
}
######################
# ADD=3111111111 modify state call time definition info in the system
######################
if ($ADD==3111111111)
{
if ($LOGmodify_call_times==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=3111111111&call_time_id=$call_time_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,state_call_time_comments,sct_default_start,sct_default_stop,sct_sunday_start,sct_sunday_stop,sct_monday_start,sct_monday_stop,sct_tuesday_start,sct_tuesday_stop,sct_wednesday_start,sct_wednesday_stop,sct_thursday_start,sct_thursday_stop,sct_friday_start,sct_friday_stop,sct_saturday_start,sct_saturday_stop from vicidial_state_call_times where state_call_time_id='$call_time_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$state_call_time_state =$row[1];
$call_time_name = $row[2];
$call_time_comments = $row[3];
$ct_default_start = $row[4];
$ct_default_stop = $row[5];
$ct_sunday_start = $row[6];
$ct_sunday_stop = $row[7];
$ct_monday_start = $row[8];
$ct_monday_stop = $row[9];
$ct_tuesday_start = $row[10];
$ct_tuesday_stop = $row[11];
$ct_wednesday_start = $row[12];
$ct_wednesday_stop = $row[13];
$ct_thursday_start = $row[14];
$ct_thursday_stop = $row[15];
$ct_friday_start = $row[16];
$ct_friday_stop = $row[17];
$ct_saturday_start = $row[18];
$ct_saturday_stop = $row[19];
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>MODIFY A STATE CALL TIME<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=4111111111>\n";
echo "<input type=hidden name=DB value=\"$DB\">\n";
echo "<input type=hidden name=call_time_id value=\"$call_time_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Call Time ID: </td><td align=left colspan=3><B>$call_time_id</B>$NWB#vicidial_call_times-call_time_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>State Call Time State: </td><td align=left colspan=3><input type=text name=state_call_time_state size=4 maxlength=2 value=\"$state_call_time_state\"> $NWB#vicidial_call_times-state_call_time_state$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>State Call Time Name: </td><td align=left colspan=3><input type=text name=call_time_name size=40 maxlength=50 value=\"$call_time_name\"> (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>State Call Time Comments: </td><td align=left colspan=3><input type=text name=call_time_comments size=50 maxlength=255 value=\"$call_time_comments\"> $NWB#vicidial_call_times-call_time_comments$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Start:</td><td align=left><input type=text name=ct_default_start size=5 maxlength=4 value=\"$ct_default_start\"> </td><td align=right>Default Stop:</td><td align=left><input type=text name=ct_default_stop size=5 maxlength=4 value=\"$ct_default_stop\"> $NWB#vicidial_call_times-ct_default_start$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Sunday Start:</td><td align=left><input type=text name=ct_sunday_start size=5 maxlength=4 value=\"$ct_sunday_start\"> </td><td align=right>Sunday Stop:</td><td align=left><input type=text name=ct_sunday_stop size=5 maxlength=4 value=\"$ct_sunday_stop\"> $NWB#vicidial_call_times-ct_sunday_start$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Monday Start:</td><td align=left><input type=text name=ct_monday_start size=5 maxlength=4 value=\"$ct_monday_start\"> </td><td align=right>Monday Stop:</td><td align=left><input type=text name=ct_monday_stop size=5 maxlength=4 value=\"$ct_monday_stop\"> $NWB#vicidial_call_times-ct_sunday_start$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Tuesday Start:</td><td align=left><input type=text name=ct_tuesday_start size=5 maxlength=4 value=\"$ct_tuesday_start\"> </td><td align=right>Tuesday Stop:</td><td align=left><input type=text name=ct_tuesday_stop size=5 maxlength=4 value=\"$ct_tuesday_stop\"> $NWB#vicidial_call_times-ct_sunday_start$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Wednesday Start:</td><td align=left><input type=text name=ct_wednesday_start size=5 maxlength=4 value=\"$ct_wednesday_start\"> </td><td align=right>Wednesday Stop:</td><td align=left><input type=text name=ct_wednesday_stop size=5 maxlength=4 value=\"$ct_wednesday_stop\"> $NWB#vicidial_call_times-ct_sunday_start$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Thursday Start:</td><td align=left><input type=text name=ct_thursday_start size=5 maxlength=4 value=\"$ct_thursday_start\"> </td><td align=right>Thursday Stop:</td><td align=left><input type=text name=ct_thursday_stop size=5 maxlength=4 value=\"$ct_thursday_stop\"> $NWB#vicidial_call_times-ct_sunday_start$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Friday Start:</td><td align=left><input type=text name=ct_friday_start size=5 maxlength=4 value=\"$ct_friday_start\"> </td><td align=right>Friday Stop:</td><td align=left><input type=text name=ct_friday_stop size=5 maxlength=4 value=\"$ct_friday_stop\"> $NWB#vicidial_call_times-ct_sunday_start$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Saturday Start:</td><td align=left><input type=text name=ct_saturday_start size=5 maxlength=4 value=\"$ct_saturday_start\"> </td><td align=right>Saturday Stop:</td><td align=left><input type=text name=ct_saturday_stop size=5 maxlength=4 value=\"$ct_saturday_stop\"> $NWB#vicidial_call_times-ct_sunday_start$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=4><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE><BR><BR>\n";
echo "<B>CALL TIMES USING THIS STATE CALL TIME:</B><BR>\n";
echo "<TABLE>\n";
$stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\";";
$rslt=mysql_query($stmt, $link);
$camps_to_print = mysql_num_rows($rslt);
$o=0;
while ($camps_to_print > $o)
{
$row=mysql_fetch_row($rslt);
echo "<TR><TD><a href=\"$PHP_SELF?ADD=311111111&call_time_id=$row[0]\">$row[0] </a></TD><TD> $row[1]<BR></TD></TR>\n";
$o++;
}
echo "</TABLE>\n";
echo "</center><BR><BR>\n";
if ($LOGdelete_call_times > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=5111111111&call_time_id=$call_time_id\">DELETE THIS STATE CALL TIME DEFINITION</a>\n";
}
}
else
{
echo "You are not authorized to view this page. Please go back.";
}
}
######################
# ADD=331111111 modify shift definition info in the system
######################
if ($ADD==331111111)
{
if ($LOGmodify_call_times==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=331111111&shift_id=$shift_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where shift_id='$shift_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$shift_name = $row[1];
$shift_start_time = $row[2];
$shift_length = $row[3];
$shift_weekdays = $row[4];
$shift_start_hour = substr($shift_start_time,0,2);
$shift_start_min = substr($shift_start_time,2,2);
$shift_length_hour = substr($shift_length,0,2);
$shift_length_min = substr($shift_length,3,2);
$shift_end_hour = ($shift_start_hour + $shift_length_hour);
$shift_end_min = ($shift_start_min + $shift_length_min);
if ($shift_end_min >=60)
{
$shift_end_min = ($shift_end_min - 60);
$shift_end_hour++;
}
if ($shift_end_hour >=24)
{
$shift_end_hour = ($shift_end_hour - 24);
}
$shift_end_hour = sprintf("%02s", $shift_end_hour);
$shift_end_min = sprintf("%02s", $shift_end_min);
$shift_end = "$shift_end_hour$shift_end_min";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>MODIFY A SHIFT<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=431111111>\n";
echo "<input type=hidden name=DB value=\"$DB\">\n";
echo "<input type=hidden name=shift_id value=\"$shift_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Shift ID: </td><td align=left><B>$shift_id</B></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Name: </td><td align=left><input type=text name=shift_name size=50 maxlength=50 value=\"$shift_name\"> (short description of the shift)$NWB#vicidial_shifts-shift_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Start Time: </td><td align=left><input type=text name=shift_start_time size=5 maxlength=4 id=shift_start_time value=\"$shift_start_time\">\n";
echo " &nbsp; Shift End Time: <input type=text name=shift_end_time size=5 maxlength=4 id=shift_end_time value=\"$shift_end\">\n";
echo "<input type=button name=shift_calc value=\"Calculate Shift Length\" onClick=\"shift_time();\"> $NWB#vicidial_shifts-shift_start_time$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Length: </td><td align=left><input type=text name=shift_length id=shift_length size=6 maxlength=5 value=\"$shift_length\"> $NWB#vicidial_shifts-shift_length$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Shift Weekdays: <BR>$NWB#vicidial_shifts-shift_weekdays$NWE</td><td align=left>\n";
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"0\"";
if (ereg('0',$shift_weekdays)) {echo " CHECKED";}
echo ">Sunday<BR>\n";
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"1\"";
if (ereg('1',$shift_weekdays)) {echo " CHECKED";}
echo ">Monday<BR>\n";
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"2\"";
if (ereg('2',$shift_weekdays)) {echo " CHECKED";}
echo ">Tuesday<BR>\n";
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"3\"";
if (ereg('3',$shift_weekdays)) {echo " CHECKED";}
echo ">Wednesday<BR>\n";
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"4\"";
if (ereg('4',$shift_weekdays)) {echo " CHECKED";}
echo ">Thursday<BR>\n";
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"5\"";
if (ereg('5',$shift_weekdays)) {echo " CHECKED";}
echo ">Friday<BR>\n";
echo "<input type=\"checkbox\" name=\"shift_weekdays[]\" value=\"6\"";
if (ereg('6',$shift_weekdays)) {echo " CHECKED";}
echo ">Saturday<BR>\n";
echo "</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
echo "</TABLE><BR><BR>\n";
echo "<B>USER GROUPS USING THIS SHIFT:</B><BR>\n";
echo "<TABLE>\n";
$stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\";";
$rslt=mysql_query($stmt, $link);
$camps_to_print = mysql_num_rows($rslt);
$o=0;
while ($camps_to_print > $o)
{
$row=mysql_fetch_row($rslt);
echo "<TR><TD><a href=\"$PHP_SELF?ADD=311111&user_group=$row[0]\">$row[0] </a></TD><TD> $row[1]<BR></TD></TR>\n";
$o++;
}
echo "</TABLE>\n";
echo "</center><BR><BR>\n";
if ($LOGdelete_call_times > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=531111111&shift_id=$shift_id\">DELETE THIS SHIFT DEFINITION</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=SHIFTS&stage=$shift_id\">Click here to see Admin changes to this shift</FONT>\n";
}
}
else
{
echo "You are not authorized to view this page. Please go back.";
}
}
######################
# ADD=31111111111 modify phone record in the system
######################
if ($ADD==31111111111)
{
if ($LOGast_admin_access==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=31111111111&extension=$extension&server_ip=$server_ip";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,delete_vm_after_email,is_webphone,use_external_server_ip,codecs_list,codecs_with_template,webphone_dialpad,on_hook_agent,webphone_auto_answer,voicemail_timezone,voicemail_options from phones where extension='$extension' and server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
echo "<br>MODIFY A PHONE RECORD: $row[1]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=41111111111>\n";
echo "<input type=hidden name=old_extension value=\"$row[0]\">\n";
echo "<input type=hidden name=old_server_ip value=\"$row[5]\">\n";
echo "<input type=hidden name=client_browser value=\"$row[34]\">\n";
echo "<input type=hidden name=install_directory value=\"$row[35]\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Extension: </td><td align=left><input type=text name=extension size=20 maxlength=100 value=\"$row[0]\">$NWB#phones-extension$NWE <i></i></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Dial Plan Number: </td><td align=left><input type=text name=dialplan_number size=15 maxlength=20 value=\"$row[1]\"> (digits only)$NWB#phones-dialplan_number$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Voicemail Box: </td><td align=left><input type=text name=voicemail_id size=10 maxlength=10 value=\"$row[2]\"> (digits only)$NWB#phones-voicemail_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Outbound CallerID: </td><td align=left><input type=text name=outbound_cid size=10 maxlength=20 value=\"$row[65]\"> (digits only)$NWB#phones-outbound_cid$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone IP address: </td><td align=left><input type=text name=phone_ip size=20 maxlength=15 value=\"$row[3]\"> (optional)$NWB#phones-phone_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Computer IP address: </td><td align=left><input type=text name=computer_ip size=20 maxlength=15 value=\"$row[4]\"> (optional)$NWB#phones-computer_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=311111111111&server_ip=$row[5]\">Server IP</a>: </td><td align=left><select size=1 name=server_ip>\n";
echo "$servers_list";
echo "<option SELECTED>$row[5]</option>\n";
echo "</select>$NWB#phones-server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Screen Login: </td><td align=left><input type=text name=login size=15 maxlength=15 value=\"$row[6]\">$NWB#phones-login$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Login Password: </td><td align=left><input type=text name=pass size=10 maxlength=10 value=\"$row[7]\">$NWB#phones-pass$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Registration Password: </td><td align=left style=\"display:table-cell; vertical-align:middle;\"><input type=text id=reg_pass name=conf_secret size=20 maxlength=20 value=\"$row[72]\" onkeyup=\"return pwdChanged('reg_pass','reg_pass_img');\">$NWB#phones-conf_secret$NWE &nbsp; &nbsp; Strength: <IMG id=reg_pass_img src='images/pixel.gif' style=\"vertical-align:middle;\" onLoad=\"return pwdChanged('reg_pass','reg_pass_img');\"></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Set As Webphone: </td><td align=left><select size=1 name=is_webphone><option>Y</option><option>N</option><option selected>$row[74]</option></select>$NWB#phones-is_webphone$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Webphone Dialpad: </td><td align=left><select size=1 name=webphone_dialpad><option>Y</option><option>N</option><option>TOGGLE</option><option>TOGGLE_OFF</option><option SELECTED>$row[78]</option></select>$NWB#phones-webphone_dialpad$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Webphone Auto-Answer: </td><td align=left><select size=1 name=webphone_auto_answer><option>Y</option><option>N</option><option SELECTED>$row[80]</option></select>$NWB#phones-webphone_auto_answer$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Use External Server IP: </td><td align=left><select size=1 name=use_external_server_ip><option>Y</option><option>N</option><option selected>$row[75]</option></select>$NWB#phones-use_external_server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Status: </td><td align=left><select size=1 name=status><option>ACTIVE</option><option>SUSPENDED</option><option>CLOSED</option><option>PENDING</option><option>ADMIN</option><option selected>$row[8]</option></select>$NWB#phones-status$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active Account: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option selected>$row[9]</option></select>$NWB#phones-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Type: </td><td align=left><input type=text name=phone_type size=20 maxlength=50 value=\"$row[10]\">$NWB#phones-phone_type$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Full Name: </td><td align=left><input type=text name=fullname size=20 maxlength=50 value=\"$row[11]\">$NWB#phones-fullname$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email: </td><td align=left><input type=text name=email size=50 maxlength=100 value=\"$row[67]\"> $NWB#phones-email$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Delete Voicemail After Email: </td><td align=left><select size=1 name=delete_vm_after_email><option>Y</option><option>N</option><option selected>$row[73]</option></select>$NWB#phones-delete_vm_after_email$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Voicemail Zone: </td><td align=left><select size=1 name=voicemail_timezone>";
$vm_zones = explode("\n",$SSvoicemail_timezones);
$z=0;
$vm_zones_ct = count($vm_zones);
while($vm_zones_ct > $z)
{
if (strlen($vm_zones[$z]) > 5)
{
$vm_specs = explode("=",$vm_zones[$z]);
$vm_abb = $vm_specs[0];
$vm_details = explode('|',$vm_specs[1]);
$vm_location = $vm_details[0];
echo "<option value=\"$vm_abb\">$vm_abb - $vm_location</option>\n";
}
$z++;
}
echo "<option selected>$row[81]</option></select> $NWB#phones-voicemail_timezone$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Voicemail Options: </td><td align=left><input type=text name=voicemail_options size=50 maxlength=100 value=\"$row[82]\">$NWB#phones-voicemail_options$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Company: </td><td align=left><input type=text name=company size=10 maxlength=10 value=\"$row[12]\">$NWB#phones-company$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Picture: </td><td align=left><input type=text name=picture size=20 maxlength=19 value=\"$row[13]\">$NWB#phones-picture$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>New Messages: </td><td align=left><b>$row[14]</b>$NWB#phones-messages$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Old Messages: </td><td align=left><b>$row[15]</b>$NWB#phones-old_messages$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Client Protocol: </td><td align=left><select size=1 name=protocol><option>SIP</option><option>Zap</option><option>IAX2</option><option>EXTERNAL</option><option selected>$row[16]</option></select>$NWB#phones-protocol$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Local GMT: </td><td align=left><select size=1 name=local_gmt><option>12.75</option><option>12.00</option><option>11.00</option><option>10.00</option><option>9.50</option><option>9.00</option><option>8.00</option><option>7.00</option><option>6.50</option><option>6.00</option><option>5.75</option><option>5.50</option><option>5.00</option><option>4.50</option><option>4.00</option><option>3.50</option><option>3.00</option><option>2.00</option><option>1.00</option><option>0.00</option><option>-1.00</option><option>-2.00</option><option>-3.00</option><option>-3.50</option><option>-4.00</option><option>-5.00</option><option>-6.00</option><option>-7.00</option><option>-8.00</option><option>-9.00</option><option>-10.00</option><option>-11.00</option><option>-12.00</option><option selected>$row[17]</option></select> (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Ring Timeout: </td><td align=left><input type=text name=phone_ring_timeout size=4 maxlength=5 value=\"$row[71]\">$NWB#phones-phone_ring_timeout$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>On-Hook Agent: </td><td align=left><select size=1 name=on_hook_agent><option>Y</option><option>N</option><option selected>$row[79]</option></select>$NWB#phones-on_hook_agent$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Manager Login: </td><td align=left><input type=text name=ASTmgrUSERNAME size=20 maxlength=20 value=\"$row[18]\">$NWB#phones-ASTmgrUSERNAME$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Manager Secret: </td><td align=left><input type=text name=ASTmgrSECRET size=20 maxlength=20 value=\"$row[19]\">$NWB#phones-ASTmgrSECRET$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>VICIDIAL Default User: </td><td align=left><input type=text name=login_user size=20 maxlength=20 value=\"$row[20]\">$NWB#phones-login_user$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>VICIDIAL Default Pass: </td><td align=left><input type=text name=login_pass size=20 maxlength=20 value=\"$row[21]\">$NWB#phones-login_pass$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>VICIDIAL Default Campaign: </td><td align=left><input type=text name=login_campaign size=10 maxlength=10 value=\"$row[22]\">$NWB#phones-login_campaign$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Park Exten: </td><td align=left><input type=text name=park_on_extension size=10 maxlength=10 value=\"$row[23]\">$NWB#phones-park_on_extension$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Conf Exten: </td><td align=left><input type=text name=conf_on_extension size=10 maxlength=10 value=\"$row[24]\">$NWB#phones-conf_on_extension$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>VICIDIAL Park Exten: </td><td align=left><input type=text name=VICIDIAL_park_on_extension size=10 maxlength=10 value=\"$row[25]\">$NWB#phones-VICIDIAL_park_on_extension$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>VICIDIAL Park File: </td><td align=left><input type=text name=VICIDIAL_park_on_filename size=10 maxlength=10 value=\"$row[26]\">$NWB#phones-VICIDIAL_park_on_filename$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Monitor Prefix: </td><td align=left><input type=text name=monitor_prefix size=10 maxlength=10 value=\"$row[27]\">$NWB#phones-monitor_prefix$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Recording Exten: </td><td align=left><input type=text name=recording_exten size=10 maxlength=10 value=\"$row[28]\">$NWB#phones-recording_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>VMailMain Exten: </td><td align=left><input type=text name=voicemail_exten size=10 maxlength=10 value=\"$row[29]\">$NWB#phones-voicemail_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>VMailDump Exten: </td><td align=left><input type=text name=voicemail_dump_exten size=20 maxlength=20 value=\"$row[30]\">$NWB#phones-voicemail_dump_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Exten Context: </td><td align=left><input type=text name=ext_context size=20 maxlength=20 value=\"$row[31]\">$NWB#phones-ext_context$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Context: </td><td align=left><input type=text name=phone_context size=20 maxlength=20 value=\"$row[70]\">$NWB#phones-phone_context$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Allowed Codecs: </td><td align=left><input type=text name=codecs_list size=40 maxlength=100 value=\"$row[76]\">$NWB#phones-codecs_list$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Allowed Codecs With Template: </td><td align=left><select size=1 name=codecs_with_template><option>1</option><option>0</option><option selected>$row[77]</option></select>$NWB#phones-codecs_with_template$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DTMFSend Channel: </td><td align=left><input type=text name=dtmf_send_extension size=40 maxlength=100 value=\"$row[32]\">$NWB#phones-dtmf_send_extension$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Outbound Call Group: </td><td align=left><input type=text name=call_out_number_group size=40 maxlength=100 value=\"$row[33]\">$NWB#phones-call_out_number_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>CallerID URL: </td><td align=left><input type=text name=local_web_callerID_URL size=40 maxlength=255 value=\"$row[36]\">$NWB#phones-local_web_callerID_URL$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>VICIDIAL Default URL: </td><td align=left><input type=text name=VICIDIAL_web_URL size=40 maxlength=255 value=\"$row[37]\">$NWB#phones-VICIDIAL_web_URL$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Call Logging: </td><td align=left><select size=1 name=AGI_call_logging_enabled><option>1</option><option>0</option><option selected>$row[38]</option></select>$NWB#phones-AGI_call_logging_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>User Switching: </td><td align=left><select size=1 name=user_switching_enabled><option>1</option><option>0</option><option selected>$row[39]</option></select>$NWB#phones-user_switching_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Conferencing: </td><td align=left><select size=1 name=conferencing_enabled><option>1</option><option>0</option><option selected>$row[40]</option></select>$NWB#phones-conferencing_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Admin Hang Up: </td><td align=left><select size=1 name=admin_hangup_enabled><option>1</option><option>0</option><option selected>$row[41]</option></select>$NWB#phones-admin_hangup_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Admin Hijack: </td><td align=left><select size=1 name=admin_hijack_enabled><option>1</option><option>0</option><option selected>$row[42]</option></select>$NWB#phones-admin_hijack_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Admin Monitor: </td><td align=left><select size=1 name=admin_monitor_enabled><option>1</option><option>0</option><option selected>$row[43]</option></select>$NWB#phones-admin_monitor_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Call Park: </td><td align=left><select size=1 name=call_parking_enabled><option>1</option><option>0</option><option selected>$row[44]</option></select>$NWB#phones-call_parking_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Updater Check: </td><td align=left><select size=1 name=updater_check_enabled><option>1</option><option>0</option><option selected>$row[45]</option></select>$NWB#phones-updater_check_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>AF Logging: </td><td align=left><select size=1 name=AFLogging_enabled><option>1</option><option>0</option><option selected>$row[46]</option></select>$NWB#phones-AFLogging_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Queue Enabled: </td><td align=left><select size=1 name=QUEUE_ACTION_enabled><option>1</option><option>0</option><option selected>$row[47]</option></select>$NWB#phones-QUEUE_ACTION_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>CallerID Popup: </td><td align=left><select size=1 name=CallerID_popup_enabled><option>1</option><option>0</option><option selected>$row[48]</option></select>$NWB#phones-CallerID_popup_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>VMail Button: </td><td align=left><select size=1 name=voicemail_button_enabled><option>1</option><option>0</option><option selected>$row[49]</option></select>$NWB#phones-voicemail_button_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Fast Refresh: </td><td align=left><select size=1 name=enable_fast_refresh><option>1</option><option>0</option><option selected>$row[50]</option></select>$NWB#phones-enable_fast_refresh$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Fast Refresh Rate: </td><td align=left><input type=text size=5 name=fast_refresh_rate value=\"$row[51]\">(in ms)$NWB#phones-fast_refresh_rate$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Persistant MySQL: </td><td align=left><select size=1 name=enable_persistant_mysql><option>1</option><option>0</option><option selected>$row[52]</option></select>$NWB#phones-enable_persistant_mysql$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Auto Dial Next Number: </td><td align=left><select size=1 name=auto_dial_next_number><option>1</option><option>0</option><option selected>$row[53]</option></select>$NWB#phones-auto_dial_next_number$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Stop Rec after each call: </td><td align=left><select size=1 name=VDstop_rec_after_each_call><option>1</option><option>0</option><option selected>$row[54]</option></select>$NWB#phones-VDstop_rec_after_each_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Enable SIPSAK Messages: </td><td align=left><select size=1 name=enable_sipsak_messages><option>1</option><option>0</option><option selected>$row[66]</option></select>$NWB#phones-enable_sipsak_messages$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DBX Server: </td><td align=left><input type=text name=DBX_server size=15 maxlength=15 value=\"$row[55]\"> (Primary DB Server)$NWB#phones-DBX_server$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DBX Database: </td><td align=left><input type=text name=DBX_database size=15 maxlength=15 value=\"$row[56]\"> (Primary Server Database)$NWB#phones-DBX_database$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DBX User: </td><td align=left><input type=text name=DBX_user size=15 maxlength=15 value=\"$row[57]\"> (Primary DB Login)$NWB#phones-DBX_user$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DBX Pass: </td><td align=left><input type=text name=DBX_pass size=15 maxlength=15 value=\"$row[58]\"> (Primary DB Secret)$NWB#phones-DBX_pass$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DBX Port: </td><td align=left><input type=text name=DBX_port size=6 maxlength=6 value=\"$row[59]\"> (Primary DB Port)$NWB#phones-DBX_port$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DBY Server: </td><td align=left><input type=text name=DBY_server size=15 maxlength=15 value=\"$row[60]\"> (Secondary DB Server)$NWB#phones-DBY_server$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DBY Database: </td><td align=left><input type=text name=DBY_database size=15 maxlength=15 value=\"$row[61]\"> (Secondary Server Database)$NWB#phones-DBY_database$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DBY User: </td><td align=left><input type=text name=DBY_user size=15 maxlength=15 value=\"$row[62]\"> (Secondary DB Login)$NWB#phones-DBY_user$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DBY Pass: </td><td align=left><input type=text name=DBY_pass size=15 maxlength=15 value=\"$row[63]\"> (Secondary DB Secret)$NWB#phones-DBY_pass$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DBY Port: </td><td align=left><input type=text name=DBY_port size=6 maxlength=6 value=\"$row[64]\"> (Secondary DB Port)$NWB#phones-DBY_port$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=331111111111&template_id=$row[68]\">Template ID</a>: </td><td align=left><select size=1 name=template_id>\n";
$stmt="SELECT template_id,template_name from vicidial_conf_templates order by template_id";
$rslt=mysql_query($stmt, $link);
$templates_to_print = mysql_num_rows($rslt);
$templates_list='<option SELECTED>--NONE--</option>';
$o=0;
while ($templates_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$templates_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "$templates_list";
echo "<option SELECTED>$row[68]</option>\n";
echo "</select>$NWB#phones-template_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Conf Override: </td><td align=left><TEXTAREA NAME=conf_override ROWS=10 COLS=70>$row[69]</TEXTAREA> $NWB#phones-conf_override$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
echo "<br><br><a href=\"./phone_stats.php?extension=$row[0]&server_ip=$row[5]\">Click here for phone stats</a>\n";
echo "<br><br><a href=\"./user_stats.php?user=$row[0]\">Click here for phone call recordings</a>\n";
if ($LOGast_delete_phones > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=51111111111&extension=$extension&server_ip=$server_ip\">DELETE THIS PHONE</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=PHONES&stage=$extension\">Click here to see Admin changes to this phone</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=32111111111 modify phone alias record in the system
######################
if ($ADD==32111111111)
{
if ($LOGast_admin_access==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=32111111111&alias_id=$alias_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT alias_id,alias_name,logins_list from phones_alias where alias_id='$alias_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
echo "<br>MODIFY A PHONE ALIAS RECORD: $row[0]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=42111111111>\n";
echo "<input type=hidden name=alias_id value=\"$row[0]\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Alias ID: </td><td align=left><B>$row[0]</B> $NWB#phones-alias_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Alias Name: </td><td align=left><input type=text name=alias_name size=30 maxlength=50 value=\"$row[1]\"> $NWB#phones-alias_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phones Logins List: </td><td align=left><input type=text name=logins_list size=50 maxlength=255 value=\"$row[2]\"> (comma separated)$NWB#phones-logins_list$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
### list of phones in this phones alias
$phone_alias_SQL = ereg_replace(',',"','",$row[2]);
echo "<center>\n";
echo "<br><b>PHONES WITHIN THIS PHONES ALIAS:</b><br>\n";
echo "<TABLE width=600 cellspacing=3>\n";
echo "<tr><td>LOGIN</td><td>EXTENSION</td><td>SERVER</td><td>PROTOCOL</td><td>IP</td></tr>\n";
$stmt="SELECT login,extension,server_ip,protocol,phone_ip from phones where login IN ('$phone_alias_SQL');";
if ($DB) {echo "|$stmt|";}
$rsltx=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rsltx);
$o=0;
while ($lists_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
$o++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=31111111111&extension=$rowx[1]&server_ip=$rowx[2]\">$rowx[0]</a></td><td><font size=1>$rowx[1]</td><td><font size=1>$rowx[2]</td><td><font size=1>$rowx[3]</td><td><font size=1>$rowx[4]</td></tr>\n";
}
echo "</table></center><br>\n";
if ($LOGast_delete_phones > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=52111111111&alias_id=$row[0]\">DELETE THIS PHONE ALIAS</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=PHONEALIASES&stage=$alias_id\">Click here to see Admin changes to this phone alias</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=33111111111 modify group alias record in the system
######################
if ($ADD==33111111111)
{
if ($LOGast_admin_access==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=33111111111&group_alias_id=$group_alias_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias where group_alias_id='$group_alias_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
echo "<br>MODIFY A GROUP ALIAS RECORD: $row[0]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=43111111111>\n";
echo "<input type=hidden name=group_alias_id value=\"$row[0]\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Group Alias ID: </td><td align=left><B>$row[0]</B> $NWB#phones-group_alias_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Group Alias Name: </td><td align=left><input type=text name=group_alias_name size=30 maxlength=50 value=\"$row[1]\"> $NWB#phones-group_alias_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>CallerID Number: </td><td align=left><input type=text name=caller_id_number size=20 maxlength=20 value=\"$row[2]\"> $NWB#phones-caller_id_number$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>CallerID Name: </td><td align=left><input type=text name=caller_id_name size=20 maxlength=20 value=\"$row[3]\"> $NWB#phones-caller_id_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option selected>$row[4]</option></select></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
if ($LOGast_delete_phones > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=53111111111&group_alias_id=$row[0]\">DELETE THIS GROUP ALIAS</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=GROUPALIASES&stage=$group_alias_id\">Click here to see Admin changes to this group alias</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=311111111111 modify server record in the system
######################
if ($ADD==311111111111)
{
if ($LOGmodify_servers==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=311111111111&server_id=$server_id&server_ip=$server_ip";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,telnet_host,telnet_port,ASTmgrUSERNAME,ASTmgrSECRET,ASTmgrUSERNAMEupdate,ASTmgrUSERNAMElisten,ASTmgrUSERNAMEsend,local_gmt,voicemail_dump_exten,answer_transfer_agent,ext_context,sys_perf_log,vd_server_logs,agi_output,vicidial_balance_active,balance_trunks_offlimits,recording_web_link,alt_server_ip,active_asterisk_server,generate_vicidial_conf,rebuild_conf_files,outbound_calls_per_second,sysload,channels_total,cpu_idle_percent,disk_usage,sounds_update,vicidial_recording_limit,carrier_logging_active,vicidial_balance_rank,rebuild_music_on_hold,active_agent_login_server,conf_secret,external_server_ip,custom_dialplan_entry,active_twin_server_ip from servers where server_id='$server_id' or server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$server_id = $row[0];
$server_description = $row[1];
$server_ip = $row[2];
$active = $row[3];
$asterisk_version = $row[4];
$max_vicidial_trunks = $row[5];
$telnet_host = $row[6];
$telnet_port = $row[7];
$ASTmgrUSERNAME = $row[8];
$ASTmgrSECRET = $row[9];
$ASTmgrUSERNAMEupdate = $row[10];
$ASTmgrUSERNAMElisten = $row[11];
$ASTmgrUSERNAMEsend = $row[12];
$local_gmt = $row[13];
$voicemail_dump_exten = $row[14];
$answer_transfer_agent = $row[15];
$ext_context = $row[16];
$sys_perf_log = $row[17];
$vd_server_logs = $row[18];
$agi_output = $row[19];
$vicidial_balance_active = $row[20];
$balance_trunks_offlimits = $row[21];
$recording_web_link = $row[22];
$alt_server_ip = $row[23];
$active_asterisk_server = $row[24];
$generate_vicidial_conf = $row[25];
$rebuild_conf_files = $row[26];
$outbound_calls_per_second = $row[27];
$sysload = $row[28];
$channels_total = $row[29];
$cpu_idle_percent = $row[30];
$disk_usage = $row[31];
$sounds_update = $row[32];
$vicidial_recording_limit = $row[33];
$carrier_logging_active = $row[34];
$vicidial_balance_rank = $row[35];
$rebuild_music_on_hold = $row[36];
$active_agent_login_server = $row[37];
$conf_secret = $row[38];
$external_server_ip = $row[39];
$custom_dialplan_entry = $row[40];
$active_twin_server_ip = $row[41];
$cpu = (100 - $cpu_idle_percent);
$disk_usage = preg_replace("/ /"," - ",$disk_usage);
$disk_usage = preg_replace("/\|/","% &nbsp; &nbsp; ",$disk_usage);
echo "<br>MODIFY A SERVER RECORD: $row[0]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=411111111111>\n";
echo "<input type=hidden name=old_server_id value=\"$server_id\">\n";
echo "<input type=hidden name=old_server_ip value=\"$server_ip\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server ID: </td><td align=left><input type=text name=server_id size=10 maxlength=10 value=\"$server_id\">$NWB#servers-server_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server Description: </td><td align=left><input type=text name=server_description size=30 maxlength=255 value=\"$server_description\">$NWB#servers-server_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server IP Address: </td><td align=left><input type=text name=server_ip size=20 maxlength=15 value=\"$server_ip\">$NWB#servers-server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option selected>$active</option></select>$NWB#servers-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>System Load: </td><td align=left>$sysload - $cpu% &nbsp; $NWB#servers-sysload$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Live Channels: </td><td align=left>$channels_total &nbsp; $NWB#servers-channels_total$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Disk Usage: </td><td align=left>$disk_usage &nbsp; $NWB#servers-disk_usage$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Asterisk Version: </td><td align=left><input type=text name=asterisk_version size=20 maxlength=20 value=\"$asterisk_version\">$NWB#servers-asterisk_version$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Max VICIDIAL Trunks: </td><td align=left><input type=text name=max_vicidial_trunks size=5 maxlength=4 value=\"$max_vicidial_trunks\">$NWB#servers-max_vicidial_trunks$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Max Calls per Second: </td><td align=left><input type=text name=outbound_calls_per_second size=5 maxlength=4 value=\"$outbound_calls_per_second\">$NWB#servers-outbound_calls_per_second$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>VICIDIAL Balance Dialing: </td><td align=left><select size=1 name=vicidial_balance_active><option>Y</option><option>N</option><option selected>$vicidial_balance_active</option></select>$NWB#servers-vicidial_balance_active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>VICIDIAL Balance Rank: </td><td align=left><input type=text name=vicidial_balance_rank size=4 maxlength=2 value=\"$vicidial_balance_rank\">$NWB#servers-vicidial_balance_rank$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>VICIDIAL Balance Offlimits: </td><td align=left><input type=text name=balance_trunks_offlimits size=5 maxlength=4 value=\"$balance_trunks_offlimits\">$NWB#servers-balance_trunks_offlimits$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Telnet Host: </td><td align=left><input type=text name=telnet_host size=20 maxlength=20 value=\"$telnet_host\">$NWB#servers-telnet_host$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Telnet Port: </td><td align=left><input type=text name=telnet_port size=6 maxlength=5 value=\"$telnet_port\">$NWB#servers-telnet_port$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Manager User: </td><td align=left><input type=text name=ASTmgrUSERNAME size=20 maxlength=20 value=\"$ASTmgrUSERNAME\">$NWB#servers-ASTmgrUSERNAME$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Manager Secret: </td><td align=left><input type=text name=ASTmgrSECRET size=20 maxlength=20 value=\"$ASTmgrSECRET\">$NWB#servers-ASTmgrSECRET$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Manager Update User: </td><td align=left><input type=text name=ASTmgrUSERNAMEupdate size=20 maxlength=20 value=\"$ASTmgrUSERNAMEupdate\">$NWB#servers-ASTmgrUSERNAMEupdate$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Manager Listen User: </td><td align=left><input type=text name=ASTmgrUSERNAMElisten size=20 maxlength=20 value=\"$ASTmgrUSERNAMElisten\">$NWB#servers-ASTmgrUSERNAMElisten$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Manager Send User: </td><td align=left><input type=text name=ASTmgrUSERNAMEsend size=20 maxlength=20 value=\"$ASTmgrUSERNAMEsend\">$NWB#servers-ASTmgrUSERNAMEsend$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Conf File Secret: </td><td align=left style=\"display:table-cell; vertical-align:middle;\"><input type=text id=reg_pass name=conf_secret size=20 maxlength=20 value=\"$conf_secret\" onkeyup=\"return pwdChanged('reg_pass','reg_pass_img');\">$NWB#servers-conf_secret$NWE &nbsp; &nbsp; Strength: <IMG id=reg_pass_img src='images/pixel.gif' style=\"vertical-align:middle;\" onLoad=\"return pwdChanged('reg_pass','reg_pass_img');\"></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Local GMT: </td><td align=left><select size=1 name=local_gmt><option>12.75</option><option>12.00</option><option>11.00</option><option>10.00</option><option>9.50</option><option>9.00</option><option>8.00</option><option>7.00</option><option>6.50</option><option>6.00</option><option>5.75</option><option>5.50</option><option>5.00</option><option>4.50</option><option>4.00</option><option>3.50</option><option>3.00</option><option>2.00</option><option>1.00</option><option>0.00</option><option>-1.00</option><option>-2.00</option><option>-3.00</option><option>-3.50</option><option>-4.00</option><option>-5.00</option><option>-6.00</option><option>-7.00</option><option>-8.00</option><option>-9.00</option><option>-10.00</option><option>-11.00</option><option>-12.00</option><option selected>$local_gmt</option></select> (Do NOT Adjust for DST)$NWB#servers-local_gmt$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>VMail Dump Exten: </td><td align=left><input type=text name=voicemail_dump_exten size=20 maxlength=20 value=\"$voicemail_dump_exten\">$NWB#servers-voicemail_dump_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>VICIDIAL AD extension: </td><td align=left><input type=text name=answer_transfer_agent size=20 maxlength=20 value=\"$answer_transfer_agent\">$NWB#servers-answer_transfer_agent$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Context: </td><td align=left><input type=text name=ext_context size=20 maxlength=20 value=\"$ext_context\">$NWB#servers-ext_context$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>System Performance: </td><td align=left><select size=1 name=sys_perf_log><option>Y</option><option>N</option><option selected>$sys_perf_log</option></select>$NWB#servers-sys_perf_log$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server Logs: </td><td align=left><select size=1 name=vd_server_logs><option>Y</option><option>N</option><option selected>$vd_server_logs</option></select>$NWB#servers-vd_server_logs$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>AGI Output: </td><td align=left><select size=1 name=agi_output><option>NONE</option><option>STDERR</option><option>FILE</option><option>BOTH</option><option selected>$agi_output</option></select>$NWB#servers-agi_output$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier Logging Active: </td><td align=left><select size=1 name=carrier_logging_active><option>Y</option><option>N</option><option selected>$carrier_logging_active</option></select>$NWB#servers-carrier_logging_active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Recording Web Link: </td><td align=left><select size=1 name=recording_web_link><option>SERVER_IP</option><option>ALT_IP</option><option>EXTERNAL_IP</option><option selected>$recording_web_link</option></select>$NWB#servers-recording_web_link$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Alternate Recording Server IP: </td><td align=left><input type=text name=alt_server_ip size=30 maxlength=100 value=\"$alt_server_ip\">$NWB#servers-alt_server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>External Server IP: </td><td align=left><input type=text name=external_server_ip size=30 maxlength=100 value=\"$external_server_ip\">$NWB#servers-external_server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active Twin Server IP: </td><td align=left><input type=text name=active_twin_server_ip size=16 maxlength=15 value=\"$active_twin_server_ip\">$NWB#servers-active_twin_server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active Asterisk Server: </td><td align=left><select size=1 name=active_asterisk_server><option>Y</option><option>N</option><option selected>$active_asterisk_server</option></select>$NWB#servers-active_asterisk_server$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active Agent Server: </td><td align=left><select size=1 name=active_agent_login_server><option>Y</option><option>N</option><option selected>$active_agent_login_server</option></select>$NWB#servers-active_agent_login_server$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Generate conf files: </td><td align=left><select size=1 name=generate_vicidial_conf><option>Y</option><option>N</option><option selected>$generate_vicidial_conf</option></select>$NWB#servers-generate_vicidial_conf$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Rebuild conf files: </td><td align=left><select size=1 name=rebuild_conf_files><option>Y</option><option>N</option><option selected>$rebuild_conf_files</option></select>$NWB#servers-rebuild_conf_files$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Rebuild Music On Hold: </td><td align=left><select size=1 name=rebuild_music_on_hold><option>Y</option><option>N</option><option selected>$rebuild_music_on_hold</option></select>$NWB#servers-rebuild_music_on_hold$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Sounds Update: </td><td align=left><select size=1 name=sounds_update><option>Y</option><option>N</option><option selected>$sounds_update</option></select>$NWB#servers-sounds_update$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>ViciDial Recording Limit: </td><td align=left><input type=text name=vicidial_recording_limit size=8 maxlength=6 value=\"$vicidial_recording_limit\">$NWB#servers-vicidial_recording_limit$NWE</td></tr>\n";
if ($SSallow_custom_dialplan > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>Custom Dialplan Entry: $NWB#servers-custom_dialplan_entry$NWE <TEXTAREA NAME=custom_dialplan_entry ROWS=5 COLS=80>$custom_dialplan_entry</TEXTAREA></td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>Custom Dialplan Entry: </td><td align=left>Disabled <input type=hidden name=custom_dialplan_entry value=\"\">$NWB#servers-custom_dialplan_entry$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center></form>\n";
### vicidial server trunk records for this server
echo "<br><br><b>VICIDIAL TRUNKS FOR THIS SERVER: &nbsp; $NWB#vicidial_server_trunks$NWE</b><br>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td> CAMPAIGN</td><td> TRUNKS </td><td> RESTRICTION </td><td> </td><td> DELETE </td></tr>\n";
$stmt="SELECT server_ip,campaign_id,dedicated_trunks,trunk_restriction from vicidial_server_trunks where server_ip='$server_ip' order by campaign_id";
$rslt=mysql_query($stmt, $link);
$recycle_to_print = mysql_num_rows($rslt);
$o=0;
while ($recycle_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$o++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1>$rowx[1]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=server_ip value=\"$server_ip\">\n";
echo "<input type=hidden name=campaign_id value=\"$rowx[1]\">\n";
echo "<input type=hidden name=ADD value=421111111111></td>\n";
echo "<td><font size=1><input size=6 maxlength=4 name=dedicated_trunks value=\"$rowx[2]\"></td>\n";
echo "<td><select size=1 name=trunk_restriction><option>MAXIMUM_LIMIT</option><option>OVERFLOW_ALLOWED</option><option SELECTED>$rowx[3]</option></select></td>\n";
echo "<td><font size=1><input type=submit name=submit value=MODIFY></form></td>\n";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=621111111111&campaign_id=$rowx[1]&server_ip=$server_ip\">DELETE</a></td></tr>\n";
}
echo "</table>\n";
echo "<br><b>ADD NEW SERVER VICIDIAL TRUNK RECORD</b><BR><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=221111111111>\n";
echo "<input type=hidden name=server_ip value=\"$server_ip\">\n";
echo "TRUNKS: <input size=6 maxlength=4 name=dedicated_trunks><BR>\n";
echo "CAMPAIGN: <select size=1 name=campaign_id>\n";
echo "$campaigns_list\n";
echo "</select><BR>\n";
echo "RESTRICTION: <select size=1 name=trunk_restriction><option>MAXIMUM_LIMIT</option><option>OVERFLOW_ALLOWED</option></select><BR>\n";
echo "<input type=submit name=submit value=ADD><BR>\n";
echo "</center></FORM><br>\n";
### list of carriers on this server
echo "<center>\n";
echo "<br><b>CARRIERS WITHIN THIS SERVER:</b><br>\n";
echo "<TABLE width=600 cellspacing=3>\n";
echo "<tr><td>CARRIER ID</td><td>NAME</td><td>REGISTRATION</td><td>ACTIVE</td></tr>\n";
$active_carriers = 0;
$inactive_carriers = 0;
$stmt="SELECT carrier_id,carrier_name,registration_string,active from vicidial_server_carriers where server_ip='$row[2]'";
$rsltx=mysql_query($stmt, $link);
$carriers_to_print = mysql_num_rows($rsltx);
$camp_lists='';
$o=0;
while ($carriers_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
$o++;
if (ereg("Y", $rowx[3])) {$active_carriers++;}
if (ereg("N", $rowx[3])) {$inactive_carriers++;}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=341111111111&carrier_id=$rowx[0]\">$rowx[0]</a></td><td><font size=1>$rowx[1]</td><td><font size=1>$rowx[2]</td><td><font size=1>$rowx[3]</td></tr>\n";
}
echo "</table></center><br>\n";
### list of phones on this server
echo "<center>\n";
echo "<br><b>PHONES WITHIN THIS SERVER:</b><br>\n";
echo "<TABLE width=400 cellspacing=3>\n";
echo "<tr><td>EXTENSION</td><td>NAME</td><td>ACTIVE</td></tr>\n";
$active_phones = 0;
$inactive_phones = 0;
$stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'";
$rsltx=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rsltx);
$camp_lists='';
$o=0;
while ($lists_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
$o++;
if (ereg("Y", $rowx[1])) {$active_phones++; $camp_lists .= "'$rowx[0]',";}
if (ereg("N", $rowx[1])) {$inactive_phones++;}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=31111111111&extension=$rowx[0]&server_ip=$row[2]\">$rowx[0]</a></td><td><font size=1>$rowx[2]</td><td><font size=1>$rowx[1]</td></tr>\n";
}
echo "</table></center><br>\n";
### list of conferences on this server
echo "<center>\n";
echo "<br><b>CONFERENCES WITHIN THIS SERVER:</b><br>\n";
echo "<TABLE width=400 cellspacing=3>\n";
echo "<tr><td>CONFERENCE</td><td>EXTENSION</td></tr>\n";
$active_confs = 0;
$stmt="SELECT conf_exten,extension from conferences where server_ip='$row[2]'";
$rsltx=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rsltx);
$camp_lists='';
$o=0;
while ($lists_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
$o++;
$active_confs++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3111111111111&conf_exten=$rowx[0]&server_ip=$row[2]\">$rowx[0]</a></td><td><font size=1>$rowx[2]</td></tr>\n";
}
echo "</table></center><br>\n";
### list of vicidial conferences on this server
echo "<center>\n";
echo "<br><b>VICIDIAL CONFERENCES WITHIN THIS SERVER:</b><br>\n";
echo "<TABLE width=400 cellspacing=3>\n";
echo "<tr><td>VD CONFERENCE</td><td>EXTENSION</td></tr>\n";
$active_vdconfs = 0;
$stmt="SELECT conf_exten,extension from vicidial_conferences where server_ip='$row[2]'";
$rsltx=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rsltx);
$camp_lists='';
$o=0;
while ($lists_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
$o++;
$active_vdconfs++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=31111111111111&conf_exten=$rowx[0]&server_ip=$row[2]\">$rowx[0]</a></td><td><font size=1>$rowx[2]</td></tr>\n";
}
echo "</table></center><br>\n";
echo "<center><b>\n";
$camp_lists = eregi_replace(".$","",$camp_lists);
echo "This server has $active_carriers active carriers and $inactive_carriers inactive carriers<br><br>\n";
echo "This server has $active_phones active phones and $inactive_phones inactive phones<br><br>\n";
echo "This server has $active_confs active conferences<br><br>\n";
echo "This server has $active_vdconfs active vicidial conferences<br><br>\n";
echo "</b></center>\n";
if ($LOGast_delete_phones > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=511111111111&server_id=$server_id&server_ip=$server_ip\">DELETE THIS SERVER</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=SERVERS&stage=$server_id\">Click here to see Admin changes to this server</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=331111111111 modify conf template record in the system
######################
if ($ADD==331111111111)
{
if ($LOGast_admin_access==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=331111111111&template_id=$template_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT template_id,template_name,template_contents from vicidial_conf_templates where template_id='$template_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$template_id = $row[0];
$template_name = $row[1];
$template_contents = $row[2];
echo "<br>MODIFY A CONF TEMPLATE RECORD: $row[0]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=431111111111>\n";
echo "<input type=hidden name=template_id value=\"$template_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Template ID: </td><td align=left><B>$template_id</B></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Template Name: </td><td align=left><input type=text name=template_name size=40 maxlength=50 value=\"$template_name\">$NWB#vicidial_conf_templates-template_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Template Contents: </td><td align=left><TEXTAREA NAME=template_contents ROWS=10 COLS=70>$template_contents</TEXTAREA> $NWB#vicidial_conf_templates-template_contents$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
echo "<center><b>\n";
### list of phones using this conf template
echo "<center>\n";
echo "<br><b>PHONES USING THIS CONF TEMPLATE:</b><br>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>EXTENSION</td><td>NAME</td><td>SERVER</td><td>ACTIVE</td></tr>\n";
$active_phones = 0;
$inactive_phones = 0;
$stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id'";
$rsltx=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rsltx);
$camp_lists='';
$o=0;
while ($lists_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
$o++;
if (ereg("Y", $rowx[1])) {$active_phones++; $camp_lists .= "'$rowx[0]',";}
if (ereg("N", $rowx[1])) {$inactive_phones++;}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=31111111111&extension=$rowx[0]&server_ip=$rowx[3]\">$rowx[0]</a></td><td><font size=1>$rowx[2]</td><td><font size=1>$rowx[3]</td><td><font size=1>$rowx[1]</td></tr>\n";
}
echo "</table></center><br>\n";
### list of carriers using this conf template
echo "<center>\n";
echo "<br><b>CARRIERS USING THIS CONF TEMPLATE:</b><br>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>CARRIER</td><td>NAME</td><td>SERVER</td><td>ACTIVE</td></tr>\n";
$active_phones = 0;
$inactive_phones = 0;
$stmt="SELECT carrier_id,active,carrier_name,server_ip from vicidial_server_carriers where template_id='$template_id'";
$rsltx=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rsltx);
$camp_lists='';
$o=0;
while ($lists_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
$o++;
if (ereg("Y", $rowx[1])) {$active_phones++; $camp_lists .= "'$rowx[0]',";}
if (ereg("N", $rowx[1])) {$inactive_phones++;}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=341111111111&carrier_id=$rowx[0]\">$rowx[0]</a></td><td><font size=1>$rowx[2]</td><td><font size=1>$rowx[3]</td><td><font size=1>$rowx[1]</td></tr>\n";
}
echo "</table></center><br>\n";
if ($LOGast_delete_phones > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=531111111111&template_id=$template_id&template_name=$template_name\">DELETE THIS CONF TEMPLATE</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=CONFTEMPLATES&stage=$template_id\">Click here to see Admin changes to this conf template</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=341111111111 modify carrier record in the system
######################
if ($ADD==341111111111)
{
if ($LOGast_admin_access==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=341111111111&carrier_id=$carrier_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active,carrier_description from vicidial_server_carriers where carrier_id='$carrier_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$carrier_id = $row[0];
$carrier_name = $row[1];
$registration_string = $row[2];
$template_id = $row[3];
$account_entry = $row[4];
$protocol = $row[5];
$globals_string = $row[6];
$dialplan_entry = $row[7];
$server_ip = $row[8];
$active = $row[9];
$carrier_description = $row[10];
echo "<br>MODIFY A CARRIER RECORD: $row[0]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=441111111111>\n";
echo "<input type=hidden name=carrier_id value=\"$carrier_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier ID: </td><td align=left><B>$carrier_id</B></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier Name: </td><td align=left><input type=text name=carrier_name size=40 maxlength=50 value=\"$carrier_name\">$NWB#vicidial_server_carriers-carrier_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier Description: </td><td align=left><input type=text name=carrier_description size=70 maxlength=255 value=\"$carrier_description\">$NWB#vicidial_server_carriers-carrier_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Registration String: </td><td align=left><input type=text name=registration_string size=50 maxlength=255 value=\"$registration_string\">$NWB#vicidial_server_carriers-registration_string$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=331111111111&template_id=$template_id\">Template ID</a>: </td><td align=left><select size=1 name=template_id>\n";
$stmt="SELECT template_id,template_name from vicidial_conf_templates order by template_id";
$rslt=mysql_query($stmt, $link);
$templates_to_print = mysql_num_rows($rslt);
$templates_list='<option SELECTED>--NONE--</option>';
$o=0;
while ($templates_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$templates_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "$templates_list";
echo "<option SELECTED>$template_id</option>\n";
echo "</select>$NWB#vicidial_server_carriers-template_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Account Entry: </td><td align=left><TEXTAREA NAME=account_entry ROWS=10 COLS=70>$account_entry</TEXTAREA> $NWB#vicidial_server_carriers-account_entry$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Protocol: </td><td align=left><select size=1 name=protocol><option>SIP</option><option>Zap</option><option>IAX2</option><option>EXTERNAL</option><option SELECTED>$protocol</option></select>$NWB#vicidial_server_carriers-protocol$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Globals String: </td><td align=left><input type=text name=globals_string size=50 maxlength=255 value=\"$globals_string\">$NWB#vicidial_server_carriers-globals_string$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Dialplan Entry: </td><td align=left><TEXTAREA NAME=dialplan_entry ROWS=10 COLS=70>$dialplan_entry</TEXTAREA> $NWB#vicidial_server_carriers-dialplan_entry$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server IP: </td><td align=left><select size=1 name=server_ip>\n";
echo "$servers_list";
echo "<option SELECTED>$server_ip</option>\n";
echo "</select>$NWB#vicidial_server_carriers-server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$active</option></select>$NWB#vicidial_server_carriers-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
echo "<center><b>\n";
if ($LOGast_delete_phones > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=541111111111&carrier_id=$carrier_id&carrier_name=$carrier_name\">DELETE THIS CARRIER</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=CARRIERS&stage=$carrier_id\">Click here to see Admin changes to this carrier</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=351111111111 modify tts record in the system
######################
if ($ADD==351111111111)
{
if ($LOGast_admin_access==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=351111111111&tts_id=$tts_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT tts_id,tts_name,active,tts_text,tts_voice from vicidial_tts_prompts where tts_id='$tts_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$tts_id = $row[0];
$tts_name = $row[1];
$active = $row[2];
$tts_text = $row[3];
$tts_voice = $row[4];
echo "<br>MODIFY A TTS RECORD: $tts_id<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=451111111111>\n";
echo "<input type=hidden name=tts_id value=\"$tts_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>TTS ID: </td><td align=left><B>$tts_id</B></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>TTS Name: </td><td align=left><input type=text name=tts_name size=50 maxlength=100 value=\"$tts_name\">$NWB#vicidial_tts_prompts-tts_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>N</option><option>Y</option><option SELECTED>$active</option></select>$NWB#vicidial_tts_prompts-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>TTS Voice: </td><td align=left><input type=text name=tts_voice size=20 maxlength=100 value=\"$tts_voice\">$NWB#vicidial_tts_prompts-tts_voice$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>TTS Text: </td><td align=left><TEXTAREA NAME=tts_text ROWS=20 COLS=70>$tts_text</TEXTAREA> $NWB#vicidial_tts_prompts-tts_text$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
echo "<center><b>\n";
if ($LOGast_delete_phones > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=551111111111&tts_id=$tts_id&tts_name=$tts_name\">DELETE THIS TTS ENTRY</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=TTS&stage=$tts_id\">Click here to see Admin changes to this TTS entry</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=361111111111 modify music on hold record in the system
######################
if ($ADD==361111111111)
{
if ($LOGast_admin_access==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=361111111111&moh_id=$moh_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where moh_id='$moh_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$moh_id = $row[0];
$moh_name = $row[1];
$active = $row[2];
$random = $row[3];
echo "<br>MODIFY A MUSIC ON HOLD RECORD: $moh_id<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=461111111111>\n";
echo "<input type=hidden name=moh_id value=\"$moh_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Music On Hold ID: </td><td align=left><B>$moh_id</B></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Music On Hold Name: </td><td align=left><input type=text name=moh_name size=50 maxlength=100 value=\"$moh_name\">$NWB#vicidial_music_on_hold-moh_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>N</option><option>Y</option><option SELECTED>$active</option></select>$NWB#vicidial_music_on_hold-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Random Order: </td><td align=left><select size=1 name=random><option>N</option><option>Y</option><option SELECTED>$random</option></select>$NWB#vicidial_music_on_hold-random$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Audio Files: </td><td align=left>\n";
##### get files listing for rank/delete options
$stmt="SELECT filename,rank from vicidial_music_on_hold_files where moh_id='$moh_id' order by rank;";
$rsltx=mysql_query($stmt, $link);
$mohfiles_to_print = mysql_num_rows($rsltx);
$ranks = ($mohfiles_to_print + 2);
$o=0;
while ($mohfiles_to_print > $o)
{
$rowx=mysql_fetch_row($rsltx);
echo "<font size=2>Rank: </font><select size=1 name=$rowx[0]>\n";
echo "<option SELECTED>$rowx[1]</option>\n";
$k=1;
while ($ranks > $k)
{
echo "<option>$k</option>\n";
$k++;
}
echo "</select>\n";
echo " &nbsp; <B>$rowx[0]</B> - <a href=\"$PHP_SELF?ADD=461111111111&moh_id=$moh_id&stage=FILEDELETE&filename=$rowx[0]\">DELETE</a><BR>\n";
$o++;
}
echo "</td></tr>\n";
echo "<tr bgcolor=#B9CBFD><td align=right>Add An Audio File: </td><td><input type=text size=50 maxlength=50 name=filename id=filename value=\"\"> <a href=\"javascript:launch_chooser('filename','date',30);\">audio chooser</a> $NWB#vicidial_music_on_hold-filename$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
echo "<center><b>\n";
if ($LOGast_delete_phones > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=561111111111&moh_id=$moh_id&moh_name=$moh_name\">DELETE MUSIC ON HOLD ENTRY</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=MOH&stage=$moh_id\">Click here to see Admin changes to this Music On Hold entry</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=371111111111 modify voicemail box in the system
######################
if ($ADD==371111111111)
{
if ($LOGast_admin_access==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=371111111111&voicemail_id=$voicemail_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email,voicemail_timezone,voicemail_options from vicidial_voicemail where voicemail_id='$voicemail_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$voicemail_id = $row[0];
$pass = $row[1];
$fullname = $row[2];
$active = $row[3];
$email = $row[4];
$messages = $row[5];
$old_messages = $row[6];
$delete_vm_after_email = $row[7];
$voicemail_timezone = $row[8];
$voicemail_options = $row[9];
echo "<br>MODIFY A VOICEMAIL BOX: $tts_id<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=471111111111>\n";
echo "<input type=hidden name=voicemail_id value=\"$voicemail_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Voicemail ID: </td><td align=left><B>$voicemail_id</B></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Password: </td><td align=left><input type=text name=pass size=12 maxlength=10 value=\"$pass\">$NWB#vicidial_voicemail-pass$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Name: </td><td align=left><input type=text name=fullname size=50 maxlength=100 value=\"$fullname\">$NWB#vicidial_voicemail-fullname$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email: </td><td align=left><input type=text name=email size=50 maxlength=100 value=\"$email\">$NWB#vicidial_voicemail-email$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>N</option><option>Y</option><option SELECTED>$active</option></select>$NWB#vicidial_voicemail-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Delete Voicemail After Email: </td><td align=left><select size=1 name=delete_vm_after_email><option>Y</option><option>N</option><option selected>$delete_vm_after_email</option></select>$NWB#vicidial_voicemail-delete_vm_after_email$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Voicemail Zone: </td><td align=left><select size=1 name=voicemail_timezone>";
$vm_zones = explode("\n",$SSvoicemail_timezones);
$z=0;
$vm_zones_ct = count($vm_zones);
while($vm_zones_ct > $z)
{
if (strlen($vm_zones[$z]) > 5)
{
$vm_specs = explode("=",$vm_zones[$z]);
$vm_abb = $vm_specs[0];
$vm_details = explode('|',$vm_specs[1]);
$vm_location = $vm_details[0];
echo "<option value=\"$vm_abb\">$vm_abb - $vm_location</option>\n";
}
$z++;
}
echo "<option selected>$voicemail_timezone</option></select> $NWB#vicidial_voicemail-voicemail_timezone$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Voicemail Options: </td><td align=left><input type=text name=voicemail_options size=50 maxlength=100 value=\"$voicemail_options\">$NWB#vicidial_voicemail-voicemail_options$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>New Messages: </td><td align=left><B>$messages</B></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Old Messages: </td><td align=left><B>$old_messages</B></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
echo "<center><b>\n";
if ($LOGast_delete_phones > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=571111111111&voicemail_id=$voicemail_id&fullname=$fullname\">DELETE THIS VOICEMAIL BOX</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=VOICEMAIL&stage=$voicemail_id\">Click here to see Admin changes to this voicemail box</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=381111111111 modify screen label in the system
######################
if ($ADD==381111111111)
{
if ($LOGast_admin_access==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=381111111111&label_id=$label_id";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT label_id,label_name,active,label_hide_field_logs,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 vicidial_screen_labels where label_id='$label_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$label_id = $row[0];
$label_name = $row[1];
$active = $row[2];
$label_hide_field_logs = $row[3];
$label_title = $row[4];
$label_first_name = $row[5];
$label_middle_initial = $row[6];
$label_last_name = $row[7];
$label_address1 = $row[8];
$label_address2 = $row[9];
$label_address3 = $row[10];
$label_city = $row[11];
$label_state = $row[12];
$label_province = $row[13];
$label_postal_code = $row[14];
$label_vendor_lead_code = $row[15];
$label_gender = $row[16];
$label_phone_number = $row[17];
$label_phone_code = $row[18];
$label_alt_phone = $row[19];
$label_security_phrase = $row[20];
$label_email = $row[21];
$label_comments = $row[22];
echo "<br>MODIFY SCREEN LABEL: $tts_id<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=481111111111>\n";
echo "<input type=hidden name=label_id value=\"$label_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label ID: </td><td align=left><B>$label_id</B></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Name: </td><td align=left><input type=text name=label_name size=50 maxlength=100 value=\"$label_name\">$NWB#vicidial_screen_labels-label_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>N</option><option>Y</option><option SELECTED>$active</option></select>$NWB#vicidial_screen_labels-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Hide Label in Call Logs: </td><td align=left><select size=1 name=label_hide_field_logs><option>N</option><option>Y</option><option SELECTED>$label_hide_field_logs</option></select>$NWB#vicidial_screen_labels-label_hide_field_logs$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Title: </td><td align=left><input type=text name=label_title size=20 maxlength=40 value=\"$label_title\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label First Name: </td><td align=left><input type=text name=label_first_name size=20 maxlength=40 value=\"$label_first_name\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Middle Initial: </td><td align=left><input type=text name=label_middle_initial size=20 maxlength=40 value=\"$label_middle_initial\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Last Name: </td><td align=left><input type=text name=label_last_name size=20 maxlength=40 value=\"$label_last_name\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Address1: </td><td align=left><input type=text name=label_address1 size=20 maxlength=40 value=\"$label_address1\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Address2: </td><td align=left><input type=text name=label_address2 size=20 maxlength=40 value=\"$label_address2\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Address3: </td><td align=left><input type=text name=label_address3 size=20 maxlength=40 value=\"$label_address3\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label City: </td><td align=left><input type=text name=label_city size=20 maxlength=40 value=\"$label_city\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label State: </td><td align=left><input type=text name=label_state size=20 maxlength=40 value=\"$label_state\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Province: </td><td align=left><input type=text name=label_province size=20 maxlength=40 value=\"$label_province\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Postal Code: </td><td align=left><input type=text name=label_postal_code size=20 maxlength=40 value=\"$label_postal_code\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Vendor Lead Code: </td><td align=left><input type=text name=label_vendor_lead_code size=20 maxlength=40 value=\"$label_vendor_lead_code\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Gender: </td><td align=left><input type=text name=label_gender size=20 maxlength=40 value=\"$label_gender\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Phone Number: </td><td align=left><input type=text name=label_phone_number size=20 maxlength=40 value=\"$label_phone_number\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Phone Code: </td><td align=left><input type=text name=label_phone_code size=20 maxlength=40 value=\"$label_phone_code\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Alt Phone: </td><td align=left><input type=text name=label_alt_phone size=20 maxlength=40 value=\"$label_alt_phone\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Security Phrase: </td><td align=left><input type=text name=label_security_phrase size=20 maxlength=40 value=\"$label_security_phrase\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Email: </td><td align=left><input type=text name=label_email size=20 maxlength=40 value=\"$label_email\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Label Comments: </td><td align=left><input type=text name=label_comments size=20 maxlength=40 value=\"$label_comments\">$NWB#vicidial_screen_labels-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
echo "<center><b>\n";
echo "</TABLE><BR><BR>\n";
echo "<B> CAMPAIGNS USING THIS SCREEN LABEL:</B><BR>\n";
echo "<TABLE>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where screen_labels='$label_id' $LOGallowed_campaignsSQL;";
$rslt=mysql_query($stmt, $link);
$camps_to_print = mysql_num_rows($rslt);
$o=0;
while ($camps_to_print > $o)
{
$row=mysql_fetch_row($rslt);
echo "<TR><TD><a href=\"$PHP_SELF?ADD=31&campaign_id=$row[0]\">$row[0] </a></TD><TD> $row[1]<BR></TD></TR>\n";
$o++;
}
echo "</TABLE><BR><BR>\n";
if ($LOGast_delete_phones > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=581111111111&label_id=$label_id&label_name=$label_name\">DELETE THIS SCREEN LABEL</a>\n";
}
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=LABEL&stage=$label_id\">Click here to see Admin changes to this screen label</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=3111111111111 modify conference record in the system
######################
if ($ADD==3111111111111)
{
if ($LOGast_admin_access==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=3111111111111&conf_exten=$conf_exten&server_ip=$server_ip";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT conf_exten,server_ip,extension from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$conf_exten = $row[0];
$server_ip = $row[1];
echo "<br>MODIFY A CONFERENCE RECORD: $row[0]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=4111111111111>\n";
echo "<input type=hidden name=old_conf_exten value=\"$row[0]\">\n";
echo "<input type=hidden name=old_server_ip value=\"$row[1]\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Conference: </td><td align=left><input type=text name=conf_exten size=10 maxlength=7 value=\"$row[0]\">$NWB#conferences-conf_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=311111111111&server_ip=$row[1]\">Server IP</a>: </td><td align=left><select size=1 name=server_ip>\n";
echo "$servers_list";
echo "<option SELECTED>$row[1]</option>\n";
echo "</select>$NWB#conferences-server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Current Extension: </td><td align=left><input type=text name=extension size=20 maxlength=20 value=\"$row[2]\"></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
echo "<center><b>\n";
if ($LOGast_delete_phones > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=5111111111111&conf_exten=$conf_exten&server_ip=$server_ip\">DELETE THIS CONFERENCE</a>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=31111111111111 modify vicidial conference record in the system
######################
if ($ADD==31111111111111)
{
if ($LOGast_admin_access==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=31111111111111&conf_exten=$conf_exten&server_ip=$server_ip";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT conf_exten,server_ip,extension,leave_3way,leave_3way_datetime from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$conf_exten = $row[0];
$server_ip = $row[1];
echo "<br>MODIFY A VICIDIAL CONFERENCE RECORD: $row[0]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=41111111111111>\n";
echo "<input type=hidden name=old_conf_exten value=\"$row[0]\">\n";
echo "<input type=hidden name=old_server_ip value=\"$row[1]\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Conference: </td><td align=left><input type=text name=conf_exten size=10 maxlength=7 value=\"$row[0]\">$NWB#conferences-conf_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=311111111111&server_ip=$row[1]\">Server IP</a>: </td><td align=left><select size=1 name=server_ip>\n";
echo "$servers_list";
echo "<option SELECTED>$row[1]</option>\n";
echo "</select>$NWB#conferences-server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Current Extension: </td><td align=left><input type=text name=extension size=20 maxlength=20 value=\"$row[2]\"></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
echo "<center><b>\n";
if ($LOGast_delete_phones > 0)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=51111111111111&conf_exten=$conf_exten&server_ip=$server_ip\">DELETE THIS VICIDIAL CONFERENCE</a>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=311111111111111 modify vicidial system settings
######################
if ($ADD==311111111111111)
{
if ($LOGmodify_servers==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=311111111111111";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,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,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset,default_voicemail_timezone,default_local_gmt from system_settings;";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$version = $row[0];
$install_date = $row[1];
$use_non_latin = $row[2];
$webroot_writable = $row[3];
$enable_queuemetrics_logging = $row[4];
$queuemetrics_server_ip = $row[5];
$queuemetrics_dbname = $row[6];
$queuemetrics_login = $row[7];
$queuemetrics_pass = $row[8];
$queuemetrics_url = $row[9];
$queuemetrics_log_id = $row[10];
$queuemetrics_eq_prepend = $row[11];
$vicidial_agent_disable = $row[12];
$allow_sipsak_messages = $row[13];
$admin_home_url = $row[14];
$enable_agc_xfer_log = $row[15];
$db_schema_version = $row[16];
$auto_user_add_value = $row[17];
$timeclock_end_of_day = $row[18];
$timeclock_last_reset_date = $row[19];
$vdc_header_date_format = $row[20];
$vdc_customer_date_format = $row[21];
$vdc_header_phone_format = $row[22];
$vdc_agent_api_active = $row[23];
$qc_last_pull_time = $row[24];
$enable_vtiger_integration = $row[25];
$vtiger_server_ip = $row[26];
$vtiger_dbname = $row[27];
$vtiger_login = $row[28];
$vtiger_pass = $row[29];
$vtiger_url = $row[30];
$qc_features_active = $row[31];
$outbound_autodial_active = $row[32];
$outbound_calls_per_second = $row[33];
$enable_tts_integration = $row[34];
$agentonly_callback_campaign_lock = $row[35];
$sounds_central_control_active = $row[36];
$sounds_web_server = $row[37];
$sounds_web_directory = $row[38];
$active_voicemail_server = $row[39];
$auto_dial_limit = $row[40];
$user_territories_active = $row[41];
$allow_custom_dialplan = $row[42];
$db_schema_update_date = $row[43];
$enable_second_webform = $row[44];
$default_webphone = $row[45];
$default_external_server_ip = $row[46];
$webphone_url = $row[47];
$enable_agc_dispo_log = $row[48];
$custom_dialplan_entry = $row[49];
$queuemetrics_loginout = $row[50];
$callcard_enabled = $row[51];
$queuemetrics_callstatus = $row[52];
$default_codecs = $row[53];
$admin_web_directory = $row[54];
$label_title = $row[55];
$label_first_name = $row[56];
$label_middle_initial = $row[57];
$label_last_name = $row[58];
$label_address1 = $row[59];
$label_address2 = $row[60];
$label_address3 = $row[61];
$label_city = $row[62];
$label_state = $row[63];
$label_province = $row[64];
$label_postal_code = $row[65];
$label_vendor_lead_code = $row[66];
$label_gender = $row[67];
$label_phone_number = $row[68];
$label_phone_code = $row[69];
$label_alt_phone = $row[70];
$label_security_phrase = $row[71];
$label_email = $row[72];
$label_comments = $row[73];
$custom_fields_enabled = $row[74];
$slave_db_server = $row[75];
$reports_use_slave_db = $row[76];
$webphone_systemkey = $row[77];
$first_login_trigger = $row[78];
$default_phone_registration_password = $row[79];
$default_phone_login_password = $row[80];
$default_server_password = $row[81];
$admin_modify_refresh = $row[82];
$nocache_admin = $row[83];
$generate_cross_server_exten = $row[84];
$queuemetrics_addmember_enabled = $row[85];
$queuemetrics_dispo_pause = $row[86];
$label_hide_field_logs = $row[87];
$queuemetrics_pe_phone_append = $row[88];
$test_campaign_calls = $row[89];
$agents_calls_reset = $row[90];
$default_voicemail_timezone = $row[91];
$default_local_gmt = $row[92];
echo "<br>MODIFY VICIDIAL SYSTEM SETTINGS<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=411111111111111>\n";
echo "<input type=hidden name=sounds_web_directory value=\"$sounds_web_directory\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Version: </td><td align=left> $version</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DB Schema Version: </td><td align=left> $db_schema_version</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DB Schema Update Date: </td><td align=left> $db_schema_update_date</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Auto User-add Value: </td><td align=left> $auto_user_add_value</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Install Date: </td><td align=left> $install_date</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Use Non-Latin: </td><td align=left><select size=1 name=use_non_latin><option>1</option><option>0</option><option selected>$use_non_latin</option></select>$NWB#settings-use_non_latin$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Webroot Writable: </td><td align=left><select size=1 name=webroot_writable><option>1</option><option>0</option><option selected>$webroot_writable</option></select>$NWB#settings-webroot_writable$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>VICIDIAL Agent Disable Display: </td><td align=left><select size=1 name=vicidial_agent_disable>\n";
echo "<option value=\"NOT_ACTIVE\">NOT_ACTIVE</option>\n";
echo "<option value=\"LIVE_AGENT\">LIVE_AGENT</option>\n";
echo "<option value=\"EXTERNAL\">EXTERNAL</option>\n";
echo "<option value=\"ALL\">ALL</option>\n";
echo "<option selected value=\"$vicidial_agent_disable\">$vicidial_agent_disable</option>\n";
echo "</select>$NWB#settings-vicidial_agent_disable$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Allow SIPSAK Messages: </td><td align=left><select size=1 name=allow_sipsak_messages><option>1</option><option>0</option><option selected>$allow_sipsak_messages</option></select>$NWB#settings-allow_sipsak_messages$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Admin Home URL: </td><td align=left><input type=text name=admin_home_url size=50 maxlength=255 value=\"$admin_home_url\">$NWB#settings-admin_home_url$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Admin Modify Auto-Refresh: </td><td align=left><input type=text name=admin_modify_refresh size=6 maxlength=5 value=\"$admin_modify_refresh\">$NWB#settings-admin_modify_refresh$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Admin No-Cache: </td><td align=left><select size=1 name=nocache_admin><option>1</option><option>0</option><option selected>$nocache_admin</option></select>$NWB#settings-nocache_admin$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Enable Agent Transfer Logfile: </td><td align=left><select size=1 name=enable_agc_xfer_log><option>1</option><option>0</option><option selected>$enable_agc_xfer_log</option></select>$NWB#settings-enable_agc_xfer_log$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Enable Agent Disposition Logfile: </td><td align=left><select size=1 name=enable_agc_dispo_log><option>1</option><option>0</option><option selected>$enable_agc_dispo_log</option></select>$NWB#settings-enable_agc_dispo_log$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Timeclock End Of Day: </td><td align=left><input type=text name=timeclock_end_of_day size=5 maxlength=4 value=\"$timeclock_end_of_day\">$NWB#settings-timeclock_end_of_day$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Local GMT: </td><td align=left><select size=1 name=default_local_gmt><option>12.75</option><option>12.00</option><option>11.00</option><option>10.00</option><option>9.50</option><option>9.00</option><option>8.00</option><option>7.00</option><option>6.50</option><option>6.00</option><option>5.75</option><option>5.50</option><option>5.00</option><option>4.50</option><option>4.00</option><option>3.50</option><option>3.00</option><option>2.00</option><option>1.00</option><option>0.00</option><option>-1.00</option><option>-2.00</option><option>-3.00</option><option>-3.50</option><option>-4.00</option><option>-5.00</option><option>-6.00</option><option>-7.00</option><option>-8.00</option><option>-9.00</option><option>-10.00</option><option>-11.00</option><option>-12.00</option><option selected>$default_local_gmt</option></select> (Do NOT Adjust for DST)$NWB#settings-default_local_gmt$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Voicemail Zone: </td><td align=left><select size=1 name=default_voicemail_timezone>";
$vm_zones = explode("\n",$SSvoicemail_timezones);
$z=0;
$vm_zones_ct = count($vm_zones);
while($vm_zones_ct > $z)
{
if (strlen($vm_zones[$z]) > 5)
{
$vm_specs = explode("=",$vm_zones[$z]);
$vm_abb = $vm_specs[0];
$vm_details = explode('|',$vm_specs[1]);
$vm_location = $vm_details[0];
echo "<option value=\"$vm_abb\">$vm_abb - $vm_location</option>\n";
}
$z++;
}
echo "<option selected>$default_voicemail_timezone</option></select> $NWB#settings-default_voicemail_timezone$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agents Calls Reset: </td><td align=left><select size=1 name=agents_calls_reset><option>1</option><option>0</option><option selected>$agents_calls_reset</option></select>$NWB#settings-agents_calls_reset$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Timeclock Last Auto Logout: </td><td align=left> $timeclock_last_reset_date</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Screen Header Date Format: </td><td align=left><select size=1 name=vdc_header_date_format>\n";
echo "<option>MS_DASH_24HR 2008-06-24 23:59:59</option>\n";
echo "<option>US_SLASH_24HR 06/24/2008 23:59:59</option>\n";
echo "<option>EU_SLASH_24HR 24/06/2008 23:59:59</option>\n";
echo "<option>AL_TEXT_24HR JUN 24 23:59:59</option>\n";
echo "<option>MS_DASH_AMPM 2008-06-24 11:59:59 PM</option>\n";
echo "<option>US_SLASH_AMPM 06/24/2008 11:59:59 PM</option>\n";
echo "<option>EU_SLASH_AMPM 24/06/2008 11:59:59 PM</option>\n";
echo "<option>AL_TEXT_AMPM JUN 24 11:59:59 PM</option>\n";
echo "<option selected value=\"$vdc_header_date_format\">$vdc_header_date_format</option>\n";
echo "</select>$NWB#settings-vdc_header_date_format$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Screen Customer Date Format: </td><td align=left><select size=1 name=vdc_customer_date_format>\n";
echo "<option>MS_DASH_24HR 2008-06-24 23:59:59</option>\n";
echo "<option>US_SLASH_24HR 06/24/2008 23:59:59</option>\n";
echo "<option>EU_SLASH_24HR 24/06/2008 23:59:59</option>\n";
echo "<option>AL_TEXT_24HR JUN 24 23:59:59</option>\n";
echo "<option>MS_DASH_AMPM 2008-06-24 11:59:59 PM</option>\n";
echo "<option>US_SLASH_AMPM 06/24/2008 11:59:59 PM</option>\n";
echo "<option>EU_SLASH_AMPM 24/06/2008 11:59:59 PM</option>\n";
echo "<option>AL_TEXT_AMPM JUN 24 11:59:59 PM</option>\n";
echo "<option selected value=\"$vdc_customer_date_format\">$vdc_customer_date_format</option>\n";
echo "</select>$NWB#settings-vdc_customer_date_format$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Screen Customer Phone Format: </td><td align=left><select size=1 name=vdc_header_phone_format>\n";
echo "<option>US_DASH 000-000-0000</option>\n";
echo "<option>US_PARN (000)000-0000</option>\n";
echo "<option>MS_NODS 0000000000</option>\n";
echo "<option>UK_DASH 00 0000-0000</option>\n";
echo "<option>AU_SPAC 000 000 000</option>\n";
echo "<option>IT_DASH 0000-000-000</option>\n";
echo "<option>FR_SPAC 00 00 00 00 00</option>\n";
echo "<option selected value=\"$vdc_header_phone_format\">$vdc_header_phone_format</option>\n";
echo "</select>$NWB#settings-vdc_header_phone_format$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent API Active: </td><td align=left><select size=1 name=vdc_agent_api_active><option>1</option><option>0</option><option selected>$vdc_agent_api_active</option></select>$NWB#settings-vdc_agent_api_active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Only Callback Campaign Lock: </td><td align=left><select size=1 name=agentonly_callback_campaign_lock><option>1</option><option>0</option><option selected>$agentonly_callback_campaign_lock</option></select>$NWB#settings-agentonly_callback_campaign_lock$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Central Sound Control Active: </td><td align=left><select size=1 name=sounds_central_control_active><option>1</option><option>0</option><option selected>$sounds_central_control_active</option></select>$NWB#settings-sounds_central_control_active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Sounds Web Server: </td><td align=left><input type=text name=sounds_web_server size=30 maxlength=50 value=\"$sounds_web_server\">$NWB#settings-sounds_web_server$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Sounds Web Directory: </td><td align=left><a href=\"http://$sounds_web_server/$sounds_web_directory\">$sounds_web_directory</a> $NWB#settings-sounds_web_directory$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Admin Web Directory: </td><td align=left><input type=text name=admin_web_directory size=50 maxlength=255 value=\"$admin_web_directory\">$NWB#settings-admin_web_directory$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active Voicemail Server: </td><td align=left><select size=1 name=active_voicemail_server>\n";
echo "$servers_list";
echo "<option SELECTED>$active_voicemail_server</option>\n";
echo "</select>$NWB#settings-active_voicemail_server$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Auto Dial Limit: </td><td align=left><select size=1 name=auto_dial_limit><option selected>$auto_dial_limit</option>\n";
$adl=1;
while($adl < 1000)
{
echo "<option>$adl</option>\n";
if ($adl < 3)
{$adl = ($adl + 0.1);}
else
{
if ($adl < 4)
{$adl = ($adl + 0.25);}
else
{
if ($adl < 5)
{$adl = ($adl + 0.5);}
else
{
if ($adl < 10)
{$adl = ($adl + 1);}
else
{
if ($adl < 20)
{$adl = ($adl + 2);}
else
{
if ($adl < 40)
{$adl = ($adl + 5);}
else
{
if ($adl < 200)
{$adl = ($adl + 10);}
else
{
if ($adl < 400)
{$adl = ($adl + 50);}
else
{
if ($adl < 1000)
{$adl = ($adl + 100);}
else
{$adl = ($adl + 1);}
}
}
}
}
}
}
}
}
}
echo "<option>$adl</option></select>$NWB#settings-auto_dial_limit$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Outbound Auto-Dial Active: </td><td align=left><select size=1 name=outbound_autodial_active><option>1</option><option>0</option><option selected>$outbound_autodial_active</option></select>$NWB#settings-outbound_autodial_active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Max FILL Calls per Second: </td><td align=left><input type=text name=outbound_calls_per_second size=4 maxlength=3 value=\"$outbound_calls_per_second\">$NWB#settings-outbound_calls_per_second$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Allow Custom Dialplan Entries: </td><td align=left><select size=1 name=allow_custom_dialplan><option>1</option><option>0</option><option selected>$allow_custom_dialplan</option></select>$NWB#settings-allow_custom_dialplan$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Generate Cross-Server Phone Extensions: </td><td align=left><select size=1 name=generate_cross_server_exten><option>1</option><option>0</option><option selected>$generate_cross_server_exten</option></select>$NWB#settings-generate_cross_server_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>User Territories Active: </td><td align=left><select size=1 name=user_territories_active><option>1</option><option>0</option><option selected>$user_territories_active</option></select>$NWB#settings-user_territories_active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Enable Second Webform: </td><td align=left><select size=1 name=enable_second_webform><option>1</option><option>0</option><option selected>$enable_second_webform</option></select>$NWB#settings-enable_second_webform$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Enable TTS Integration: </td><td align=left><select size=1 name=enable_tts_integration><option>1</option><option>0</option><option selected>$enable_tts_integration</option></select>$NWB#settings-enable_tts_integration$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Enable CallCard: </td><td align=left><select size=1 name=callcard_enabled><option>1</option><option>0</option><option selected>$callcard_enabled</option></select>$NWB#settings-callcard_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Enable Custom List Fields: </td><td align=left><select size=1 name=custom_fields_enabled><option>1</option><option>0</option><option selected>$custom_fields_enabled</option></select>$NWB#settings-custom_fields_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Enable Campaign Test Calls: </td><td align=left><select size=1 name=test_campaign_calls><option>1</option><option>0</option><option selected>$test_campaign_calls</option></select>$NWB#settings-test_campaign_calls$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>First Login Trigger: </td><td align=left><input type=hidden name=first_login_trigger value=\"$first_login_trigger\"> $first_login_trigger &nbsp; $NWB#settings-first_login_trigger$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Phone Registration Password: </td><td align=left style=\"display:table-cell; vertical-align:middle;\"><input type=text id=reg_passX name=default_phone_registration_password size=20 maxlength=20 value=\"$default_phone_registration_password\" onkeyup=\"return pwdChanged('reg_passX','reg_pass_imgX');\">$NWB#settings-default_phone_registration_password$NWE &nbsp; &nbsp; Strength: <IMG id=reg_pass_imgX src='images/pixel.gif' style=\"vertical-align:middle;\" onLoad=\"return pwdChanged('reg_passX','reg_pass_imgX');\"></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Phone Login Password: </td><td align=left style=\"display:table-cell; vertical-align:middle;\"><input type=text id=reg_passY name=default_phone_login_password size=20 maxlength=20 value=\"$default_phone_login_password\" onkeyup=\"return pwdChanged('reg_passY','reg_pass_imgY');\">$NWB#settings-default_phone_login_password$NWE &nbsp; &nbsp; Strength: <IMG id=reg_pass_imgY src='images/pixel.gif' style=\"vertical-align:middle;\" onLoad=\"return pwdChanged('reg_passY','reg_pass_imgY');\"></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Server Password: </td><td align=left style=\"display:table-cell; vertical-align:middle;\"><input type=text id=reg_passZ name=default_server_password size=20 maxlength=20 value=\"$default_server_password\" onkeyup=\"return pwdChanged('reg_passZ','reg_pass_imgZ');\">$NWB#settings-default_server_password$NWE &nbsp; &nbsp; Strength: <IMG id=reg_pass_imgZ src='images/pixel.gif' style=\"vertical-align:middle;\" onLoad=\"return pwdChanged('reg_passZ','reg_pass_imgZ');\"></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Slave Database Server: </td><td align=left><input type=text name=slave_db_server size=30 maxlength=50 value=\"$slave_db_server\">$NWB#settings-slave_db_server$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Reports to use Slave DB: </td><td align=left><select MULTIPLE size=4 name=reports_use_slave_db[]>\n";
$Vreports_ARY = explode(',',$Vreports);
$Vreports_ct = count($Vreports_ARY);
$b=0;
while ($b < $Vreports_ct)
{
$field_selected='';
trim($Vreports_ARY[$b]);
if (preg_match("/$Vreports_ARY[$b]/",$reports_use_slave_db))
{$field_selected = 'SELECTED';}
echo "<option value=\"$Vreports_ARY[$b]\" $field_selected>$Vreports_ARY[$b]</option>\n";
$b++;
}
echo "</select>$NWB#settings-reports_use_slave_db$NWE</td></tr>\n";
if ($SSallow_custom_dialplan > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>Custom Dialplan Entry: $NWB#settings-custom_dialplan_entry$NWE <TEXTAREA NAME=custom_dialplan_entry ROWS=5 COLS=80>$custom_dialplan_entry</TEXTAREA></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Reload Dialplan On Servers: </td><td align=left><select size=1 name=reload_dialplan_on_servers><option>1</option><option selected>0</option></select>$NWB#settings-reload_dialplan_on_servers$NWE</td></tr>\n";
}
else
{
echo "<tr bgcolor=#B6D3FC><td align=right>Custom Dialplan Entry: </td><td align=left>Disabled <input type=hidden name=custom_dialplan_entry value=\"\">$NWB#settings-custom_dialplan_entry$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Hide Label in Call Logs: </td><td align=left><select size=1 name=label_hide_field_logs><option>N</option><option>Y</option><option SELECTED>$label_hide_field_logs</option></select>$NWB#settings-label_hide_field_logs$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Title: </td><td align=left><input type=text name=label_title size=20 maxlength=40 value=\"$label_title\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label First Name: </td><td align=left><input type=text name=label_first_name size=20 maxlength=40 value=\"$label_first_name\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Middle Initial: </td><td align=left><input type=text name=label_middle_initial size=20 maxlength=40 value=\"$label_middle_initial\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Last Name: </td><td align=left><input type=text name=label_last_name size=20 maxlength=40 value=\"$label_last_name\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Address1: </td><td align=left><input type=text name=label_address1 size=20 maxlength=40 value=\"$label_address1\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Address2: </td><td align=left><input type=text name=label_address2 size=20 maxlength=40 value=\"$label_address2\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Address3: </td><td align=left><input type=text name=label_address3 size=20 maxlength=40 value=\"$label_address3\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label City: </td><td align=left><input type=text name=label_city size=20 maxlength=40 value=\"$label_city\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label State: </td><td align=left><input type=text name=label_state size=20 maxlength=40 value=\"$label_state\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Province: </td><td align=left><input type=text name=label_province size=20 maxlength=40 value=\"$label_province\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Postal Code: </td><td align=left><input type=text name=label_postal_code size=20 maxlength=40 value=\"$label_postal_code\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Vendor Lead Code: </td><td align=left><input type=text name=label_vendor_lead_code size=20 maxlength=40 value=\"$label_vendor_lead_code\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Gender: </td><td align=left><input type=text name=label_gender size=20 maxlength=40 value=\"$label_gender\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Phone Number: </td><td align=left><input type=text name=label_phone_number size=20 maxlength=40 value=\"$label_phone_number\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Phone Code: </td><td align=left><input type=text name=label_phone_code size=20 maxlength=40 value=\"$label_phone_code\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Alt Phone: </td><td align=left><input type=text name=label_alt_phone size=20 maxlength=40 value=\"$label_alt_phone\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Security Phrase: </td><td align=left><input type=text name=label_security_phrase size=20 maxlength=40 value=\"$label_security_phrase\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Email: </td><td align=left><input type=text name=label_email size=20 maxlength=40 value=\"$label_email\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#CCCCCC><td align=right>Label Comments: </td><td align=left><input type=text name=label_comments size=20 maxlength=40 value=\"$label_comments\">$NWB#settings-default_field_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>QC Features Active: </td><td align=left><select size=1 name=qc_features_active><option>1</option><option>0</option><option selected>$qc_features_active</option></select>$NWB#settings-qc_features_active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>QC Last Pull Time: </td><td align=left> $qc_last_pull_time</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Default Codecs: </td><td align=left><input type=text name=default_codecs size=40 maxlength=100 value=\"$default_codecs\">$NWB#settings-default_codecs$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Default Webphone: </td><td align=left><select size=1 name=default_webphone><option>1</option><option>0</option><option selected>$default_webphone</option></select>$NWB#settings-default_webphone$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Default External Server IP: </td><td align=left><select size=1 name=default_external_server_ip><option>1</option><option>0</option><option selected>$default_external_server_ip</option></select>$NWB#settings-default_external_server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Webphone URL: </td><td align=left><input type=text name=webphone_url size=50 maxlength=255 value=\"$webphone_url\">$NWB#settings-webphone_url$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Webphone System Key: </td><td align=left><input type=text name=webphone_systemkey size=50 maxlength=100 value=\"$webphone_systemkey\">$NWB#settings-webphone_systemkey$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>Enable QueueMetrics Logging: </td><td align=left><select size=1 name=enable_queuemetrics_logging><option>1</option><option>0</option><option selected>$enable_queuemetrics_logging</option></select>$NWB#settings-enable_queuemetrics_logging$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Server IP: </td><td align=left><input type=text name=queuemetrics_server_ip size=18 maxlength=15 value=\"$queuemetrics_server_ip\">$NWB#settings-queuemetrics_server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics DB Name: </td><td align=left><input type=text name=queuemetrics_dbname size=18 maxlength=50 value=\"$queuemetrics_dbname\">$NWB#settings-queuemetrics_dbname$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics DB Login: </td><td align=left><input type=text name=queuemetrics_login size=18 maxlength=50 value=\"$queuemetrics_login\">$NWB#settings-queuemetrics_login$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics DB Password: </td><td align=left><input type=text name=queuemetrics_pass size=18 maxlength=50 value=\"$queuemetrics_pass\">$NWB#settings-queuemetrics_pass$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics URL: </td><td align=left><input type=text name=queuemetrics_url size=50 maxlength=255 value=\"$queuemetrics_url\">$NWB#settings-queuemetrics_url$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Log ID: </td><td align=left><input type=text name=queuemetrics_log_id size=12 maxlength=10 value=\"$queuemetrics_log_id\">$NWB#settings-queuemetrics_log_id$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics EnterQueue Prepend: </td><td align=left><select size=1 name=queuemetrics_eq_prepend>\n";
echo "<option value=\"NONE\">NONE</option>\n";
echo "<option value=\"lead_id\">lead_id</option>\n";
echo "<option value=\"list_id\">list_id</option>\n";
echo "<option value=\"source_id\">source_id</option>\n";
echo "<option value=\"vendor_lead_code\">vendor_lead_code</option>\n";
echo "<option value=\"address3\">address3</option>\n";
echo "<option value=\"security_phrase\">security_phrase</option>\n";
echo "<option selected value=\"$queuemetrics_eq_prepend\">$queuemetrics_eq_prepend</option>\n";
echo "</select>$NWB#settings-queuemetrics_eq_prepend$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Login-Out: </td><td align=left><select size=1 name=queuemetrics_loginout>\n";
echo "<option value=\"STANDARD\">STANDARD</option>\n";
echo "<option value=\"CALLBACK\">CALLBACK</option>\n";
echo "<option value=\"NONE\">NONE</option>\n";
echo "<option selected value=\"$queuemetrics_loginout\">$queuemetrics_loginout</option>\n";
echo "</select>$NWB#settings-queuemetrics_loginout$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics CallStatus: </td><td align=left><select size=1 name=queuemetrics_callstatus><option>1</option><option>0</option><option selected>$queuemetrics_callstatus</option></select>$NWB#settings-queuemetrics_callstatus$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Addmember Enabled: </td><td align=left><select size=1 name=queuemetrics_addmember_enabled><option>1</option><option>0</option><option selected>$queuemetrics_addmember_enabled</option></select>$NWB#settings-queuemetrics_addmember_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Dispo Pause Code: </td><td align=left><input type=text name=queuemetrics_dispo_pause size=8 maxlength=6 value=\"$queuemetrics_dispo_pause\">$NWB#settings-queuemetrics_dispo_pause$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Phone Environment Phone Append: </td><td align=left><select size=1 name=queuemetrics_pe_phone_append><option>1</option><option>0</option><option selected>$queuemetrics_pe_phone_append</option></select>$NWB#settings-queuemetrics_pe_phone_append$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Enable Vtiger Integration: </td><td align=left><select size=1 name=enable_vtiger_integration><option>1</option><option>0</option><option selected>$enable_vtiger_integration</option></select>$NWB#settings-enable_vtiger_integration$NWE\n";
echo " &nbsp; <a href=\"./vtiger_user.php\" target=\"_blank\">Click here to Synchronize users with Vtiger</a>\n";
echo "</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Vtiger DB Server IP: </td><td align=left><input type=text name=vtiger_server_ip size=18 maxlength=15 value=\"$vtiger_server_ip\">$NWB#settings-vtiger_server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Vtiger DB Name: </td><td align=left><input type=text name=vtiger_dbname size=18 maxlength=50 value=\"$vtiger_dbname\">$NWB#settings-vtiger_dbname$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Vtiger DB Login: </td><td align=left><input type=text name=vtiger_login size=18 maxlength=50 value=\"$vtiger_login\">$NWB#settings-vtiger_login$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Vtiger DB Password: </td><td align=left><input type=text name=vtiger_pass size=18 maxlength=50 value=\"$vtiger_pass\">$NWB#settings-vtiger_pass$NWE</td></tr>\n";
echo "<tr bgcolor=#CCFFFF><td align=right>Vtiger URL: </td><td align=left><input type=text name=vtiger_url size=50 maxlength=255 value=\"$vtiger_url\">$NWB#settings-vtiger_url$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
echo "</form>\n";
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=SYSTEMSETTINGS&stage=system_settings\">Click here to see Admin changes to the system settings</FONT>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=321111111111111 modify vicidial system statuses
######################
if ($ADD==321111111111111)
{
if ($LOGmodify_servers==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=321111111111111";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br><center>\n";
echo "<b>VICIDIAL STATUSES WITHIN THIS SYSTEM: &nbsp; $NWB#vicidial_statuses$NWE</b><br>\n";
echo "<TABLE width=700 cellspacing=3>\n";
echo "<tr><td align=center valign=bottom><font size=2><b>S<br>T<br>A<br>T<br>U<br>S</td>\n";
echo "<td align=center valign=bottom><font size=2><b>DESCRIPTION</td>\n";
echo "<td align=center valign=bottom><font size=2><b>CATEGORY</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#ccffff\"><font size=2><b><br>A<br>G<br>E<br>N<br>T<br>&nbsp;<BR>S<br>E<br>L<br>E<br>C<br>T<br>A<br>B<br>L<br>E</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#99ffcc\"><font size=2><b>H<br>U<br>M<br>A<br>N<br>&nbsp;<BR>A<br>N<br>S<br>W<br>E<br>R</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#ccffff\"><font size=2><b>S<br>A<br>L<br>E</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#99ffcc\"><font size=2><b>D<br>N<br>C</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#ccffff\"><font size=2><b>C<br>U<br>S<br>T<br>O<br>M<br>E<br>R<br>&nbsp;<br>C<br>O<br>N<br>T<br>A<br>C<br>T</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#99ffcc\"><font size=2><b>N<br>O<br>T<br>&nbsp;<br>I<br>N<br>T<br>E<br>R<br>E<br>S<br>T<br>E<br>D</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#ccffff\"><font size=2><b>U<br>N<br>W<br>O<br>R<br>K<br>A<br>B<br>L<br>E</td>\n";
echo "<td align=center valign=bottom bgcolor=\"#99ffcc\"><font size=2><b>S<br>C<br>H<br>E<br>D<br>U<br>L<br>E<br>D<br>&nbsp;<br>C<br>A<br>L<br>L<br>B<br>A<br>C<br>K</td>\n";
echo "<td align=center valign=bottom><font size=2><b>MODIFY/DELETE</td></tr>\n";
##### get status category listings for dynamic pulldown
$stmt="SELECT vsc_id,vsc_name from vicidial_status_categories order by vsc_id desc";
$rslt=mysql_query($stmt, $link);
$cats_to_print = mysql_num_rows($rslt);
$cats_list="";
$o=0;
while ($cats_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$cats_list .= "<option value=\"$rowx[0]\">$rowx[0] - " . substr($rowx[1],0,20) . "</option>\n";
$catsname_list["$rowx[0]"] = substr($rowx[1],0,20);
$o++;
}
$stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback from vicidial_statuses order by status;";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$AScategory = $rowx[4];
$o++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=421111111111111>\n";
echo "<input type=hidden name=stage value=modify>\n";
echo "<input type=hidden name=status value=\"$rowx[0]\">\n";
echo "<font size=2><B>$rowx[0]</B></td>\n";
echo "<td><input type=text name=status_name size=20 maxlength=30 value=\"$rowx[1]\"></td>\n";
echo "<td>\n";
echo "<select size=1 name=category>\n";
echo "$cats_list";
echo "<option selected value=\"$AScategory\">$AScategory - $catsname_list[$AScategory]</option>\n";
echo "</select>\n";
echo "\n";
echo "</td><td bgcolor=\"#ccffff\"><select size=1 name=selectable><option>Y</option><option>N</option><option selected>$rowx[2]</option></select>\n";
echo "</td><td bgcolor=\"#99ffcc\"><select size=1 name=human_answered><option>Y</option><option>N</option><option selected>$rowx[3]</option></select>\n";
echo "</td><td bgcolor=\"#ccffff\"><select size=1 name=sale><option>Y</option><option>N</option><option selected>$rowx[5]</option></select>\n";
echo "</td><td bgcolor=\"#99ffcc\"><select size=1 name=dnc><option>Y</option><option>N</option><option selected>$rowx[6]</option></select>\n";
echo "</td><td bgcolor=\"#ccffff\"><select size=1 name=customer_contact><option>Y</option><option>N</option><option selected>$rowx[7]</option></select>\n";
echo "</td><td bgcolor=\"#99ffcc\"><select size=1 name=not_interested><option>Y</option><option>N</option><option selected>$rowx[8]</option></select>\n";
echo "</td><td bgcolor=\"#ccffff\"><select size=1 name=unworkable><option>Y</option><option>N</option><option selected>$rowx[9]</option></select>\n";
echo "</td><td bgcolor=\"#99ffcc\"><select size=1 name=scheduled_callbacks><option>Y</option><option>N</option><option selected>$rowx[10]</option></select>\n";
echo "</td><td align=center nowrap><font size=1><input type=submit name=submit value=MODIFY> &nbsp; &nbsp; &nbsp; &nbsp; \n";
echo " &nbsp; \n";
if (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$rowx[0]))
{
echo "<DEL>DELETE</DEL>\n";
}
else
{
echo "<a href=\"$PHP_SELF?ADD=421111111111111&status=$rowx[0]&stage=delete\">DELETE</a>\n";
}
echo "</form></td></tr>\n";
}
echo "</table>\n";
echo "<br>ADD NEW SYSTEM STATUS<BR><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=221111111111111>\n";
echo "Status: <input type=text name=status_id size=7 maxlength=6> &nbsp; \n";
echo "Description: <input type=text name=status_name size=30 maxlength=30><BR>\n";
echo "Selectable: <select size=1 name=selectable><option>Y</option><option>N</option></select> &nbsp; \n";
echo "Human Answer: <select size=1 name=human_answered><option>Y</option><option>N</option></select> &nbsp; \n";
echo "Sale: <select size=1 name=sale><option>Y</option><option SELECTED>N</option></select> &nbsp; \n";
echo "DNC: <select size=1 name=dnc><option>Y</option><option SELECTED>N</option></select> &nbsp; \n";
echo "Customer Contact: <select size=1 name=customer_contact><option>Y</option><option SELECTED>N</option></select> &nbsp; <BR>\n";
echo "Not Interested: <select size=1 name=not_interested><option>Y</option><option SELECTED>N</option></select> &nbsp; \n";
echo "Unworkable: <select size=1 name=unworkable><option>Y</option><option SELECTED>N</option></select> &nbsp; \n";
echo "Callback: <select size=1 name=scheduled_callbacks><option>Y</option><option SELECTED>N</option></select> &nbsp; \n";
echo "Category: \n";
echo "<select size=1 name=category>\n";
echo "$cats_list";
echo "<option selected value=\"$AScategory\">$AScategory - $catsname_list[$AScategory]</option>\n";
echo "</select> &nbsp; <BR>\n";
echo "<input type=submit name=submit value=ADD><BR>\n";
echo "</FORM><br>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=331111111111111 modify vicidial status categories
######################
if ($ADD==331111111111111)
{
if ($LOGmodify_servers==1)
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=331111111111111";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br><center>\n";
echo "<b>VICIDIAL STATUS CATEGORIES: &nbsp; $NWB#vicidial_status_categories$NWE</b><br>\n";
echo "<TABLE width=700 cellspacing=3>\n";
echo "<tr><td>CATEGORY</td><td>NAME</td><td>STATUSES IN THIS CATEGORY</td></tr>\n";
$stmt="SELECT vsc_id,vsc_name,vsc_description,tovdad_display,sale_category,dead_lead_category from vicidial_status_categories order by vsc_id;";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$Avsc_id[$o] = $rowx[0];
$Avsc_name[$o] = $rowx[1];
$Avsc_description[$o] = $rowx[2];
$Atovdad_display[$o] = $rowx[3];
$Asale_category[$o] = $rowx[4];
$Adead_lead_category[$o] = $rowx[5];
$o++;
}
$p=0;
while ($o > $p)
{
if (eregi("1$|3$|5$|7$|9$", $p))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
$CATstatuses='';
$stmt="SELECT status from vicidial_statuses where category='$Avsc_id[$p]' order by status;";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$q=0;
while ($statuses_to_print > $q)
{
$rowx=mysql_fetch_row($rslt);
$CATstatuses.=" $rowx[0]";
$q++;
}
$stmt="SELECT status from vicidial_campaign_statuses where category='$Avsc_id[$p]' order by status;";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$q=0;
while ($statuses_to_print > $q)
{
$rowx=mysql_fetch_row($rslt);
$CATstatuses.=" $rowx[0]";
$q++;
}
echo "<tr $bgcolor><td><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=431111111111111>\n";
echo "<input type=hidden name=stage value=modify>\n";
echo "<input type=hidden name=vsc_id value=\"$Avsc_id[$p]\">\n";
echo "<font size=2><B>$Avsc_id[$p]</B></td>\n";
echo "<td><input type=text name=vsc_name size=30 maxlength=50 value=\"$Avsc_name[$p]\"></td>\n";
echo "<td><font size=1>\n";
echo "$CATstatuses";
echo "</td></tr>\n";
echo "<tr $bgcolor>\n";
echo "<td colspan=3>TO VDAD Display: <select size=1 name=tovdad_display><option>Y</option><option>N</option><option selected>$Atovdad_display[$p]</option></select> &nbsp; &nbsp; Sale Category: <select size=1 name=sale_category><option>Y</option><option>N</option><option selected>$Asale_category[$p]</option></select> &nbsp; &nbsp; Dead Lead Category: <select size=1 name=dead_lead_category><option>Y</option><option>N</option><option selected>$Adead_lead_category[$p]</option></select> &nbsp; </td></tr>\n";
echo "<tr $bgcolor><td colspan=3><font size=1>Description: <input type=text name=vsc_description size=90 maxlength=255 value=\"$Avsc_description[$p]\"></td></tr>\n";
echo "<tr $bgcolor><td colspan=3 align=center><font size=1><input type=submit name=submit value=MODIFY> &nbsp; &nbsp; &nbsp; &nbsp; \n";
echo " &nbsp; <a href=\"$PHP_SELF?ADD=431111111111111&vsc_id=$Avsc_id[$p]&stage=delete\">DELETE</a></td></tr>\n";
echo "<tr><td colspan=4><font size=1> &nbsp; </form></td></tr>\n";
$p++;
}
echo "</table>\n";
echo "<br>ADD NEW STATUS CATEGORY<BR><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=231111111111111>\n";
echo "Category ID: <input type=text name=vsc_id size=20 maxlength=20> &nbsp; \n";
echo "Name: <input type=text name=vsc_name size=20 maxlength=50> &nbsp; <BR>\n";
echo "TimeOnVDAD Display: <select size=1 name=tovdad_display><option>Y</option><option selected>N</option></select> &nbsp; \n";
echo "Sale Category: <select size=1 name=sale_category><option>Y</option><option selected>N</option></select> &nbsp; \n";
echo "Dead Lead Category: <select size=1 name=dead_lead_category><option>Y</option><option selected>N</option></select> &nbsp; <BR>\n";
echo "Description: <input type=text name=vsc_description size=80 maxlength=255> &nbsp; \n";
echo "<input type=submit name=submit value=ADD><BR>\n";
echo "</FORM><br>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=341111111111111 modify vicidial QC status code
######################
if ($ADD==341111111111111)
{
if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) )
{
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
{
$modify_url = "$PHP_SELF?ADD=341111111111111";
$modify_footer_refresh=1;
}
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br><center>\n";
echo "<b>VICIDIAL QC STATUS CODES WITHIN THIS SYSTEM: &nbsp; $NWB#vicidial_qc_status_codes$NWE</b><br>\n";
echo "<TABLE width=600 cellspacing=3>\n";
echo "<tr><td>STATUS CODE</td><td>DESCRIPTION</td><td>MODIFY/DELETE</td></tr>\n";
##### go through each QC status code
$stmt="SELECT count(*) from vicidial_qc_codes;";
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
if ($rowx[0] > 0)
{
$stmt="SELECT code,code_name from vicidial_qc_codes order by code;";
$rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rslt);
$o=0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$o++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=441111111111111>\n";
echo "<input type=hidden name=stage value=modify>\n";
echo "<input type=hidden name=code value=\"$rowx[0]\">\n";
echo "<font size=2><B>$rowx[0]</B></td>\n";
echo "<td><input type=text name=code_name size=20 maxlength=30 value=\"$rowx[1]\"></td>\n";
echo "<td align=center nowrap><font size=1><input type=submit name=submit value=MODIFY> &nbsp; &nbsp; &nbsp; &nbsp; \n";
echo " &nbsp; \n";
if (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$rowx[0]))
{
echo "<DEL>DELETE</DEL>\n";
}
else
{
echo "<a href=\"$PHP_SELF?ADD=441111111111111&status=$rowx[0]&stage=delete\">DELETE</a>\n";
}
echo "</form></td></tr>\n";
}
}
echo "</table>\n";
echo "<br>ADD NEW QC STATUS CODE<BR><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=241111111111111>\n";
echo "Status: <input type=text name=code size=9 maxlength=8> &nbsp; \n";
echo "Description: <input type=text name=code_name size=30 maxlength=30><BR>\n";
echo "<input type=submit name=submit value=ADD><BR>\n";
echo "</FORM><br>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=550 user search form
######################
if ($ADD==550)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>SEARCH FOR A USER<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=660>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>User Number: </td><td align=left><input type=text name=user size=20 maxlength=20></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Full Name: </td><td align=left><input type=text name=full_name size=30 maxlength=30></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>User Level: </td><td align=left><select size=1 name=user_level><option selected>0</option><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option></select></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>User Group: </td><td align=left><select size=1 name=user_group>\n";
$stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group";
$rslt=mysql_query($stmt, $link);
$groups_to_print = mysql_num_rows($rslt);
$o=0;
$groups_list='';
while ($groups_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$groups_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
echo "$groups_list</select></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=search value=search></td></tr>\n";
echo "</TABLE></center>\n";
}
######################
# ADD=660 user search results
######################
if ($ADD==660)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$SQL = '';
if ($user) {$SQL .= " user LIKE \"%$user%\" and";}
if ($full_name) {$SQL .= " full_name LIKE \"%$full_name%\" and";}
if ($user_level > 0) {$SQL .= " user_level LIKE \"%$user_level%\" and";}
if ($user_group) {$SQL .= " user_group = '$user_group' and";}
$SQL = eregi_replace(" and$", "", $SQL);
if (strlen($SQL)>5) {$SQL = "and $SQL";}
$stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts from vicidial_users where user_level <= $LOGuser_level $SQL order by full_name desc;";
# echo "\n|$stmt|\n";
$rslt=mysql_query($stmt, $link);
$people_to_print = mysql_num_rows($rslt);
echo "<br>SEARCH RESULTS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
$o=0;
while ($people_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1>$row[1]</td><td><font size=1>$row[3]</td><td><font size=1>$row[4]</td><td><font size=1>$row[5]</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=3&user=$row[1]\">MODIFY</a> | <a href=\"./user_stats.php?user=$row[1]\">STATS</a> | <a href=\"./user_status.php?user=$row[1]\">STATUS</a> | <a href=\"./AST_agent_time_sheet.php?agent=$row[1]\">TIME</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################################################################################################
######################################################################################################
####### 8 series, Callback lists
######################################################################################################
######################################################################################################
######################
# ADD=8 find all callbacks on hold by a User
######################
if ($ADD==8)
{
if ($LOGmodify_users==1)
{
if ($SUB==89)
{
$stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where user='$user' and status IN('LIVE','ACTIVE') and callback_time < '$past_month_date';";
$rslt=mysql_query($stmt, $link);
echo "<br>User($user) callback listings LIVE for more than one month have been made INACTIVE\n";
}
if ($SUB==899)
{
$stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where user='$user' and status IN('LIVE','ACTIVE') and callback_time < '$past_week_date';";
$rslt=mysql_query($stmt, $link);
echo "<br>User($user) callback listings LIVE for more than one week have been made INACTIVE\n";
}
}
$CBinactiveLINK = "<BR><a href=\"$PHP_SELF?ADD=8&SUB=89&user=$user\">Remove LIVE Callbacks older than one month for this user</a><BR><a href=\"$PHP_SELF?ADD=8&SUB=899&user=$user\">Remove LIVE Callbacks older than one week for this user</a><BR>";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$CBquerySQLwhere = "and user='$user'";
echo "<br>USER CALLBACK HOLD LISTINGS: $user\n";
$oldADD = "ADD=8&user=$user";
$ADD='82';
}
######################
# ADD=81 find all callbacks on hold within a Campaign
######################
if ($ADD==81)
{
if ($LOGmodify_campaigns==1)
{
if ($SUB==89)
{
$stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where campaign_id='$campaign_id' and status IN('LIVE','ACTIVE') and callback_time < '$past_month_date';";
$rslt=mysql_query($stmt, $link);
echo "<br>campaign($campaign_id) callback listings LIVE for more than one month have been made INACTIVE\n";
}
if ($SUB==899)
{
$stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where campaign_id='$campaign_id' and status IN('LIVE','ACTIVE') and callback_time < '$past_week_date';";
$rslt=mysql_query($stmt, $link);
echo "<br>campaign($campaign_id) callback listings LIVE for more than one week have been made INACTIVE\n";
}
}
$CBinactiveLINK = "<BR><a href=\"$PHP_SELF?ADD=81&SUB=89&campaign_id=$campaign_id\">Remove LIVE Callbacks older than one month for this campaign</a><BR><a href=\"$PHP_SELF?ADD=81&SUB=899&campaign_id=$campaign_id\">Remove LIVE Callbacks older than one week for this campaign</a><BR>";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$CBquerySQLwhere = "and campaign_id='$campaign_id'";
echo "<br>CAMPAIGN CALLBACK HOLD LISTINGS: $campaign_id\n";
$oldADD = "ADD=81&campaign_id=$campaign_id";
$ADD='82';
}
######################
# ADD=811 find all callbacks on hold within a List
######################
if ($ADD==811)
{
if ($LOGmodify_lists==1)
{
if ($SUB==89)
{
$stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where list_id='$list_id' and status IN('LIVE','ACTIVE') and callback_time < '$past_month_date';";
$rslt=mysql_query($stmt, $link);
echo "<br>list($list_id) callback listings LIVE for more than one month have been made INACTIVE\n";
}
if ($SUB==899)
{
$stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where list_id='$list_id' and status IN('LIVE','ACTIVE') and callback_time < '$past_week_date';";
$rslt=mysql_query($stmt, $link);
echo "<br>list($list_id) callback listings LIVE for more than one week have been made INACTIVE\n";
}
}
$CBinactiveLINK = "<BR><a href=\"$PHP_SELF?ADD=811&SUB=89&list_id=$list_id\">Remove LIVE Callbacks older than one month for this list</a><BR><a href=\"$PHP_SELF?ADD=811&SUB=899&list_id=$list_id\">Remove LIVE Callbacks older than one week for this list</a><BR>";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$CBquerySQLwhere = "and list_id='$list_id'";
echo "<br>LIST CALLBACK HOLD LISTINGS: $list_id\n";
$oldADD = "ADD=811&list_id=$list_id";
$ADD='82';
}
######################
# ADD=8111 find all callbacks on hold within a user group
######################
if ($ADD==8111)
{
if ($LOGmodify_usergroups==1)
{
if ($SUB==89)
{
$stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where user_group='$user_group' and status IN('LIVE','ACTIVE') and callback_time < '$past_month_date';";
$rslt=mysql_query($stmt, $link);
echo "<br>user group($user_group) callback listings LIVE for more than one month have been made INACTIVE\n";
}
if ($SUB==899)
{
$stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where user_group='$user_group' and status IN('LIVE','ACTIVE') and callback_time < '$past_week_date';";
$rslt=mysql_query($stmt, $link);
echo "<br>user group($user_group) callback listings LIVE for more than one week have been made INACTIVE\n";
}
}
$CBinactiveLINK = "<BR><a href=\"$PHP_SELF?ADD=8111&SUB=89&user_group=$user_group\">Remove LIVE Callbacks older than one month for this user group</a><BR><a href=\"$PHP_SELF?ADD=8111&SUB=899&user_group=$user_group\">Remove LIVE Callbacks older than one week for this user group</a><BR>";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$CBquerySQLwhere = "and user_group='$user_group'";
echo "<br>USER GROUP CALLBACK HOLD LISTINGS: $list_id\n";
$oldADD = "ADD=8111&user_group=$user_group";
$ADD='82';
}
######################
# ADD=82 display all callbacks on hold
######################
if ($ADD==82)
{
$USERlink='stage=USERIDDOWN';
$GROUPlink='stage=GROUPDOWN';
$ENDATElink='stage=ENDATEDOWN';
$SQLorder='order by ';
if (eregi("USERIDDOWN",$stage)) {$SQLorder='order by user desc,'; $USERlink='stage=USERIDUP';}
if (eregi("GROUPDOWN",$stage)) {$SQLorder='order by user_group desc,'; $NAMElink='stage=NAMEUP';}
if (eregi("ENDATEDOWN",$stage)) {$SQLorder='order by entry_time desc,'; $LEVELlink='stage=LEVELUP';}
$stmt="SELECT callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where status IN('ACTIVE','LIVE') $CBquerySQLwhere $SQLorder recipient,status desc,callback_time";
$rslt=mysql_query($stmt, $link);
$cb_to_print = mysql_num_rows($rslt);
echo "<TABLE><TR><TD>\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>\n";
echo "<td><font size=1 color=white>LEAD</td><td><font size=1 color=white>LIST</td>\n";
echo "<td><font size=1 color=white> CAMPAIGN</td>\n";
echo "<td><a href=\"$PHP_SELF?$oldADD&$ENDATElink\"><font size=1 color=white><B>ENTRY DATE</B></a></td>\n";
echo "<td><font size=1 color=white>CALLBACK DATE</td>\n";
echo "<td><a href=\"$PHP_SELF?$oldADD&$USERlink\"><font size=1 color=white><B>USER</B></a></td>\n";
echo "<td><font size=1 color=white>RECIPIENT</td>\n";
echo "<td><font size=1 color=white>STATUS</td>\n";
echo "<td><a href=\"$PHP_SELF?$oldADD&$GROUPlink\"><font size=1 color=white><B>GROUP</B></a></td></tr>\n";
$o=0;
while ($cb_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor>";
echo "<td><font size=1><A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A></td>";
echo "<td><font size=1><A HREF=\"$PHP_SELF?ADD=311&list_id=$row[2]\">$row[2]</A></td>";
echo "<td><font size=1><A HREF=\"$PHP_SELF?ADD=31&campaign_id=$row[3]\">$row[3]</A></td>";
echo "<td><font size=1>$row[5]</td>";
echo "<td><font size=1>$row[6]</td>";
echo "<td><font size=1><A HREF=\"$PHP_SELF?ADD=3&user=$row[8]\">$row[8]</A></td>";
echo "<td><font size=1>$row[9]</td>";
echo "<td><font size=1>$row[4]</td>";
echo "<td><font size=1><A HREF=\"$PHP_SELF?ADD=311111&user_group=$row[11]\">$row[11]</A></td>";
echo "</tr>\n";
$o++;
}
echo "</TABLE></center>\n";
echo "$CBinactiveLINK";
}
######################################################################################################
######################################################################################################
####### 0 series, displays and searches
######################################################################################################
######################################################################################################
######################
# ADD=0 display all active users
######################
if ($ADD==0)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>USER LISTINGS: ";
if (ereg('display_all',$status))
{
$SQLstatus = '';
echo " &nbsp; <a href=\"$PHP_SELF?ADD=0\"><font size=1 color=black>show only active users</a>\n";
}
else
{
$SQLstatus = "and active='Y'";
echo " &nbsp; <a href=\"$PHP_SELF?ADD=0&status=display_all\"><font size=1 color=black>show all users</a>\n";
}
$USERlink='stage=USERIDDOWN';
$NAMElink='stage=NAMEDOWN';
$LEVELlink='stage=LEVELDOWN';
$GROUPlink='stage=GROUPDOWN';
$SQLorder='order by full_name';
if (eregi("USERIDUP",$stage)) {$SQLorder='order by user asc'; $USERlink='stage=USERIDDOWN';}
if (eregi("USERIDDOWN",$stage)) {$SQLorder='order by user desc'; $USERlink='stage=USERIDUP';}
if (eregi("NAMEUP",$stage)) {$SQLorder='order by full_name asc'; $NAMElink='stage=NAMEDOWN';}
if (eregi("NAMEDOWN",$stage)) {$SQLorder='order by full_name desc'; $NAMElink='stage=NAMEUP';}
if (eregi("LEVELUP",$stage)) {$SQLorder='order by user_level asc'; $LEVELlink='stage=LEVELDOWN';}
if (eregi("LEVELDOWN",$stage)) {$SQLorder='order by user_level desc'; $LEVELlink='stage=LEVELUP';}
if (eregi("GROUPUP",$stage)) {$SQLorder='order by user_group asc'; $GROUPlink='stage=GROUPDOWN';}
if (eregi("GROUPDOWN",$stage)) {$SQLorder='order by user_group desc'; $GROUPlink='stage=GROUPUP';}
$stmt="SELECT user,full_name,user_level,user_group,active from vicidial_users where user_level <= $LOGuser_level $SQLstatus $SQLorder";
$rslt=mysql_query($stmt, $link);
$people_to_print = mysql_num_rows($rslt);
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><a href=\"$PHP_SELF?ADD=0&status=$status&$USERlink\"><font size=1 color=white><B>USER ID</B></a></td>";
echo "<td><a href=\"$PHP_SELF?ADD=0&status=$status&$NAMElink\"><font size=1 color=white><B>FULL NAME</B></a></td>";
echo "<td><a href=\"$PHP_SELF?ADD=0&status=$status&$LEVELlink\"><font size=1 color=white><B>LEVEL</B></a></td>";
echo "<td><a href=\"$PHP_SELF?ADD=0&status=$status&$GROUPlink\"><font size=1 color=white><B>GROUP</B></a></td>";
echo "<td><font size=1 color=white><B>ACTIVE</B></td>";
echo "<td align=center><font size=1 color=white><B>LINKS</B></td></tr>\n";
$o=0;
while ($people_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><a href=\"$PHP_SELF?ADD=3&user=$row[0]\"><font size=1 color=black>$row[0]</a></td>";
echo "<td><font size=1>$row[1]</td>";
echo "<td><font size=1>$row[2]</td>";
echo "<td><font size=1>$row[3]</td>";
echo "<td><font size=1>$row[4]</td>";
echo "<td><font size=1><CENTER><a href=\"$PHP_SELF?ADD=3&user=$row[0]\">MODIFY</a> | <a href=\"./user_stats.php?user=$row[0]\">STATS</a> | <a href=\"./user_status.php?user=$row[0]\">STATUS</a> | <a href=\"./AST_agent_time_sheet.php?agent=$row[0]\">TIME</a></CENTER></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=10 display all campaigns
######################
if ($ADD==10)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT campaign_id,campaign_name,active,dial_method,auto_dial_level,lead_order,dial_statuses from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
echo "<br>CAMPAIGN LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>CAMPAIGN ID</B></td>";
echo "<td><font size=1 color=white><CENTER><B>NAME</B></CENTER></td>";
echo "<td><font size=1 color=white><B>ACTIVE &nbsp; </B></td>";
if ($SSoutbound_autodial_active > 0)
{
echo "<td><font size=1 color=white><B>DIAL METHOD &nbsp; </B></td>";
echo "<td><font size=1 color=white><B> LEVEL &nbsp; </B></td>";
echo "<td><font size=1 color=white><B>LEAD ORDER &nbsp; </B></td>";
echo "<td><font size=1 color=white><B>DIAL STATUSES &nbsp; </B></td>";
}
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($campaigns_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=34&campaign_id=$row[0]\">$row[0]</a> &nbsp; </td>";
echo "<td><font size=1>$row[1] &nbsp; </td>";
echo "<td><font size=1>$row[2] &nbsp; </td>";
if ($SSoutbound_autodial_active > 0)
{
echo "<td><font size=1>$row[3] &nbsp; </td>";
echo "<td><font size=1>$row[4] &nbsp; </td>";
echo "<td><font size=1>$row[5] &nbsp; </td>";
echo "<td><font size=1>$row[6]</td>";
}
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=31&campaign_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=100 display all lists
######################
if ($ADD==100)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$LISTlink='stage=LISTIDDOWN';
$NAMElink='stage=LISTNAMEDOWN';
$TALLYlink='stage=TALLYDOWN';
$ACTIVElink='stage=ACTIVEDOWN';
$CAMPAIGNlink='stage=CAMPAIGNDOWN';
$CALLDATElink='stage=CALLDATEDOWN';
$SQLorder='order by list_id';
if (eregi("LISTIDUP",$stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';}
if (eregi("LISTIDDOWN",$stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';}
if (eregi("LISTNAMEUP",$stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';}
if (eregi("LISTNAMEDOWN",$stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';}
if (eregi("TALLYUP",$stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';}
if (eregi("TALLYDOWN",$stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';}
if (eregi("ACTIVEUP",$stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';}
if (eregi("ACTIVEDOWN",$stage)) {$SQLorder='order by active desc'; $ACTIVElink='stage=ACTIVEUP';}
if (eregi("CAMPAIGNUP",$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';}
if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';}
if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';}
if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';}
$stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id $LOGallowed_campaignsSQL group by list_id $SQLorder";
$rslt=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rslt);
echo "<br>LIST LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><a href=\"$PHP_SELF?ADD=100&$LISTlink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST ID</B></a></TD>";
echo "<TD><a href=\"$PHP_SELF?ADD=100&$NAMElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST NAME</B></a></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</B></TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>RTIME</B></TD>\n";
echo "<TD><a href=\"$PHP_SELF?ADD=100&$TALLYlink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LEADS COUNT</B></a></TD>\n";
echo "<TD><a href=\"$PHP_SELF?ADD=100&$ACTIVElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACTIVE</B></a></TD>";
echo "<TD><a href=\"$PHP_SELF?ADD=100&$CALLDATElink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LAST CALL DATE</B></a></TD>";
echo "<TD><a href=\"$PHP_SELF?ADD=100&$CAMPAIGNlink\"><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CAMPAIGN</B></a></TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>MODIFY</TD>\n";
echo "</TR>\n";
$lists_printed = '';
$o=0;
while ($lists_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=311&list_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td><font size=1> $row[7]</td>";
echo "<td><font size=1> $row[3]</td>";
echo "<td><font size=1> $row[4]</td>";
echo "<td><font size=1> $row[5]</td>";
echo "<td><font size=1> $row[6]</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=311&list_id=$row[0]\">MODIFY</a></td></tr>\n";
$lists_printed .= "'$row[0]',";
$o++;
}
$stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'') $LOGallowed_campaignsSQL;";
$rslt=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rslt);
$o=0;
while ($lists_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=311&list_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td><font size=1> $row[7]</td>";
echo "<td><font size=1> $row[3]</td>";
echo "<td><font size=1> $row[4]</td>";
echo "<td><font size=1> $row[5]</td>";
echo "<td><font size=1> $row[6]</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=311&list_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=1000 display all inbound groups
######################
if ($ADD==1000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT group_id,group_name,queue_priority,active,call_time_id,group_color from vicidial_inbound_groups order by group_id";
$rslt=mysql_query($stmt, $link);
$ingroups_to_print = mysql_num_rows($rslt);
echo "<br>INBOUND GROUP LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><font size=1 color=white>IN-GROUP</TD>";
echo "<TD><font size=1 color=white>NAME</TD>";
echo "<TD><font size=1 color=white>PRIORITY</TD>\n";
echo "<TD><font size=1 color=white>ACTIVE</TD>";
echo "<TD><font size=1 color=white>TIME</TD>";
echo "<TD><font size=1 color=white>COLOR</TD>\n";
echo "<TD><font size=1 color=white>MODIFY</TD>\n";
echo "</TR>\n";
$o=0;
while ($ingroups_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3111&group_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td><font size=1> $row[3]</td>";
echo "<td><font size=1> $row[4]</td>";
echo "<td bgcolor=\"$row[5]\"><font size=1> &nbsp;</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=3111&group_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=1300 display all inbound dids
######################
if ($ADD==1300)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT did_id,did_pattern,did_description,did_active,did_route,record_call from vicidial_inbound_dids order by did_pattern";
$rslt=mysql_query($stmt, $link);
$dids_to_print = mysql_num_rows($rslt);
echo "<br>INBOUND DID LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><font size=1 color=white>#</TD>";
echo "<TD><font size=1 color=white>DID</TD>";
echo "<TD><font size=1 color=white>DESCRIPTION</TD>\n";
echo "<TD><font size=1 color=white>ACTIVE</TD>";
echo "<TD><font size=1 color=white>ROUTE</TD>";
echo "<TD><font size=1 color=white>REC</TD>";
echo "<TD><font size=1 color=white>MODIFY</TD>\n";
echo "</TR>\n";
$o=0;
while ($dids_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3311&did_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td><font size=1> $row[3]</td>";
echo "<td><font size=1> $row[4]</td>";
echo "<td><font size=1> $row[5]</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=3311&did_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=1500 display all call menus
######################
if ($ADD==1500)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT menu_id,menu_name,menu_prompt,menu_timeout from vicidial_call_menu order by menu_id";
$rslt=mysql_query($stmt, $link);
$menus_to_print = mysql_num_rows($rslt);
echo "<br>CALL MENU LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><font size=1 color=white>MENU ID</TD>";
echo "<TD><font size=1 color=white>NAME</TD>";
echo "<TD><font size=1 color=white>PROMPT</TD>\n";
echo "<TD><font size=1 color=white>TIMEOUT</TD>";
echo "<TD><font size=1 color=white>OPTIONS</TD>";
echo "<TD><font size=1 color=white>MODIFY</TD>\n";
echo "</TR>\n";
$o=0;
$menu_id = $MT;
while ($menus_to_print > $o)
{
$row=mysql_fetch_row($rslt);
$menu_id[$o] = $row[0];
$menu_name[$o] = $row[1];
$menu_prompt[$o] = $row[2];
$menu_timeout[$o] = $row[3];
$o++;
}
$o=0;
while ($menus_to_print > $o)
{
$stmt="SELECT count(*) from vicidial_call_menu_options where menu_id=\"$menu_id[$o]\";";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3511&menu_id=$menu_id[$o]\">$menu_id[$o]</a></td>";
echo "<td><font size=1> $menu_name[$o]</td>";
echo "<td><font size=1> $menu_prompt[$o]</td>";
echo "<td><font size=1> $menu_timeout[$o]</td>";
echo "<td><font size=1> $row[0]</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=3511&menu_id=$menu_id[$o]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=1700 display all filter phone groups
######################
if ($ADD==1700)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT vfpg.filter_phone_group_id,filter_phone_group_name,filter_phone_group_description,count(*) as tally from vicidial_filter_phone_groups vfpg,vicidial_filter_phone_numbers vfpn where vfpg.filter_phone_group_id=vfpn.filter_phone_group_id group by filter_phone_group_id order by filter_phone_group_id";
$rslt=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rslt);
echo "<br>FILTER PHONE GROUP LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>FPG ID</B></a></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>FPG NAME</B></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</B></TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>PHONES COUNT</B></a></TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>MODIFY</TD>\n";
echo "</TR>\n";
$lists_printed = '';
$o=0;
while ($lists_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3711&filter_phone_group_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td><font size=1> $row[3]</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=3711&filter_phone_group_id=$row[0]\">MODIFY</a></td></tr>\n";
$groups_printed .= "'$row[0]',";
$o++;
}
$stmt="SELECT filter_phone_group_id,filter_phone_group_name,filter_phone_group_description,0 from vicidial_filter_phone_groups where filter_phone_group_id NOT IN($groups_printed'') order by filter_phone_group_id;";
$rslt=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rslt);
$o=0;
while ($lists_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3711&filter_phone_group_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td><font size=1> $row[3]</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=3711&filter_phone_group_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=10000 display all remote agents
######################
if ($ADD==10000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,extension_group,status,campaign_id from vicidial_remote_agents $whereLOGallowed_campaignsSQL order by server_ip,campaign_id,user_start";
$rslt=mysql_query($stmt, $link);
$remoteagents_to_print = mysql_num_rows($rslt);
echo "<br>REMOTE AGENTS LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>USER</B></td>";
echo "<td><font size=1 color=white><B>LINES</B></td>";
echo "<td><font size=1 color=white><B>SERVER &nbsp; </B></td>";
echo "<td><font size=1 color=white><B>CONF-EXTEN &nbsp; </B></td>";
echo "<td><font size=1 color=white><B>GROUP &nbsp; </B></td>";
echo "<td><font size=1 color=white><B>STATUS &nbsp; </B></td>";
echo "<td><font size=1 color=white><B>CAMPAIGN &nbsp; </B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($remoteagents_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=31111&remote_agent_id=$row[0]\">$row[1]</a></td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td><font size=1> $row[3]</td>";
echo "<td><font size=1> $row[4]</td>";
echo "<td><font size=1> $row[5]</td>";
echo "<td><font size=1> $row[6]</td>";
echo "<td><font size=1> $row[7]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=31111&remote_agent_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=12000 display all extension group entries
######################
if ($ADD==12000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT extension_id,extension_group_id,extension,rank,campaign_groups,call_count_today,last_call_time,last_callerid from vicidial_extension_groups order by extension_group_id,rank,extension";
$rslt=mysql_query($stmt, $link);
$extensiongroups_to_print = mysql_num_rows($rslt);
echo "<br>EXTENSION GROUP LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white><B>GROUP</B></td>";
echo "<td><font size=1 color=white><B>EXTENSION</B></td>";
echo "<td><font size=1 color=white><B>RANK &nbsp; </B></td>";
echo "<td><font size=1 color=white><B>RESTRICT &nbsp; </B></td>";
echo "<td><font size=1 color=white><B>COUNT &nbsp; </B></td>";
echo "<td><font size=1 color=white><B>LAST CALL &nbsp; </B></td>";
echo "<td><font size=1 color=white><B>LAST ID &nbsp; </B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($extensiongroups_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=32111&extension_id=$row[0]\">$row[1]</a></td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td><font size=1> $row[3]</td>";
echo "<td><font size=1> $row[4]</td>";
echo "<td><font size=1> $row[5]</td>";
echo "<td><font size=1> $row[6]</td>";
echo "<td><font size=1> $row[7]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=32111&extension_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=100000 display all user groups
######################
if ($ADD==100000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups order by user_group";
$rslt=mysql_query($stmt, $link);
$usergroups_to_print = mysql_num_rows($rslt);
echo "<br>USER GROUPS LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>USER GROUP</B></td>";
echo "<td><font size=1 color=white><B>GROUP NAME</B></td>";
echo "<td><font size=1 color=white><B>FORCE TIMECLOCK &nbsp; </B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($usergroups_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=311111&user_group=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=311111&user_group=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=1000000 display all scripts
######################
if ($ADD==1000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT script_id,script_name,active from vicidial_scripts order by script_id";
$rslt=mysql_query($stmt, $link);
$scripts_to_print = mysql_num_rows($rslt);
echo "<br>SCRIPTS LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>SCRIPT ID</B></td>";
echo "<td><font size=1 color=white><B>SCRIPT NAME</B></td>";
echo "<td><font size=1 color=white><B>ACTIVE &nbsp; </B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($scripts_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3111111&script_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=3111111&script_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=10000000 display all filters
######################
if ($ADD==10000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT lead_filter_id,lead_filter_name from vicidial_lead_filters order by lead_filter_id";
$rslt=mysql_query($stmt, $link);
$filters_to_print = mysql_num_rows($rslt);
echo "<br>LEAD FILTER LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>FILTER ID</B></td>";
echo "<td><font size=1 color=white><B>FILTER NAME</B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($filters_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=31111111&lead_filter_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=31111111&lead_filter_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=100000000 display all call times
######################
if ($ADD==100000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT call_time_id,call_time_name,ct_default_start,ct_default_stop from vicidial_call_times order by call_time_id";
$rslt=mysql_query($stmt, $link);
$calltimes_to_print = mysql_num_rows($rslt);
echo "<br>CALL TIME LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>CALLTIME ID</B></td>";
echo "<td><font size=1 color=white><B>CALLTIME NAME</B></td>";
echo "<td><font size=1 color=white><B>DEFAULT START</B></td>";
echo "<td><font size=1 color=white><B>DEFAULT STOP</B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($calltimes_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=311111111&call_time_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2] </td>";
echo "<td><font size=1> $row[3] </td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=311111111&call_time_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=1000000000 display all state call times
######################
if ($ADD==1000000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,sct_default_start,sct_default_stop from vicidial_state_call_times order by state_call_time_id";
$rslt=mysql_query($stmt, $link);
$statecalltimes_to_print = mysql_num_rows($rslt);
echo "<br>STATE CALL TIME LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>CALLTIME ID</B></td>";
echo "<td><font size=1 color=white><B>CALLTIME STATE</B></td>";
echo "<td><font size=1 color=white><B>CALLTIME NAME</B></td>";
echo "<td><font size=1 color=white><B>DEFAULT START</B></td>";
echo "<td><font size=1 color=white><B>DEFAULT STOP</B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($statecalltimes_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3111111111&call_time_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td><font size=1> $row[3] </td>";
echo "<td><font size=1> $row[4] </td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=3111111111&call_time_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=130000000 display all shifts
######################
if ($ADD==130000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays from vicidial_shifts order by shift_id";
$rslt=mysql_query($stmt, $link);
$shifts_to_print = mysql_num_rows($rslt);
echo "<br>SHIFT LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>SHIFT ID</B></td>";
echo "<td><font size=1 color=white><B>SHIFT NAME</B></td>";
echo "<td><font size=1 color=white><B>SHIFT START</B></td>";
echo "<td><font size=1 color=white><B>SHIFT LENGTH</B></td>";
echo "<td><font size=1 color=white><B>WEEKDAYS</B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($shifts_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=331111111&shift_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2] </td>";
echo "<td><font size=1> $row[3] </td>";
echo "<td><font size=1> $row[4] </td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=331111111&shift_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=10000000000 display all phones
######################
if ($ADD==10000000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$EXTENlink='stage=EXTENDOWN';
$PROTOlink='stage=PROTODOWN';
$SERVERlink='stage=SERVERDOWN';
$STATUSlink='stage=STATUSDOWN';
$SQLorder='order by extension,server_ip';
if (eregi("EXTENUP",$stage)) {$SQLorder='order by extension asc'; $EXTENlink='stage=EXTENDOWN';}
if (eregi("EXTENDOWN",$stage)) {$SQLorder='order by extension desc'; $EXTENlink='stage=EXTENUP';}
if (eregi("PROTOUP",$stage)) {$SQLorder='order by protocol asc'; $PROTOlink='stage=PROTODOWN';}
if (eregi("PROTODOWN",$stage)) {$SQLorder='order by protocol desc'; $PROTOlink='stage=PROTOUP';}
if (eregi("SERVERUP",$stage)) {$SQLorder='order by server_ip asc'; $SERVERlink='stage=SERVERDOWN';}
if (eregi("SERVERDOWN",$stage)) {$SQLorder='order by server_ip desc'; $SERVERlink='stage=SERVERUP';}
if (eregi("STATUSUP",$stage)) {$SQLorder='order by status asc'; $STATUSlink='stage=STATUSDOWN';}
if (eregi("STATUSDOWN",$stage)) {$SQLorder='order by status desc'; $STATUSlink='stage=STATUSUP';}
$stmt="SELECT extension,protocol,server_ip,dialplan_number,voicemail_id,status,fullname,messages,old_messages from phones $SQLorder";
$rslt=mysql_query($stmt, $link);
$phones_to_print = mysql_num_rows($rslt);
echo "<br>PHONE LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><a href=\"$PHP_SELF?ADD=10000000000&$EXTENlink\"><font size=1 color=white><B>EXTEN</B></a></td>";
echo "<td><a href=\"$PHP_SELF?ADD=10000000000&$PROTOlink\"><font size=1 color=white><B>PROTO</B></a></td>";
echo "<td><a href=\"$PHP_SELF?ADD=10000000000&$SERVERlink\"><font size=1 color=white><B>SERVER</B></a></td>";
echo "<td colspan=2><font size=1 color=white><B>DIAL PLAN</B></td>";
echo "<td><a href=\"$PHP_SELF?ADD=10000000000&$STATUSlink\"><font size=1 color=white><B>STATUS</B></a></td>";
echo "<td><font size=1 color=white><B>NAME</B></td>";
echo "<td colspan=2><font size=1 color=white><B>VMAIL</B></td>";
echo "<td align=center><font size=1 color=white><B>LINKS</B></td></tr>\n";
$o=0;
while ($phones_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><a href=\"$PHP_SELF?ADD=31111111111&extension=$row[0]&server_ip=$row[2]\"><font size=1 color=black>$row[0]</font></a></td>
<td><font size=1>$row[1]</td>
<td><font size=1>$row[2]</td>
<td><font size=1>$row[3]</td>
<td><font size=1>$row[4]</td>
<td><font size=1>$row[5]</td>
<td><font size=1>$row[6]</td>
<td><font size=1>$row[7]</td>
<td><font size=1>$row[8]</td>";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=31111111111&extension=$row[0]&server_ip=$row[2]\">MODIFY</a> | <a href=\"./phone_stats.php?extension=$row[0]&server_ip=$row[2]\">STATS</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=12000000000 display all phones alias
######################
if ($ADD==12000000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT alias_id,alias_name,logins_list from phones_alias order by alias_id;";
$rslt=mysql_query($stmt, $link);
$phonealias_to_print = mysql_num_rows($rslt);
echo "<br>PHONE ALIAS LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white><B>ALIAS ID</B></a></td>";
echo "<td><font size=1 color=white><B>ALIAS NAME</B></a></td>";
echo "<td><font size=1 color=white><B>PHONE LOGINS LIST</B></a></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($phonealias_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><a href=\"$PHP_SELF?ADD=32111111111&alias_id=$row[0]\"><font size=1 color=black>$row[0]</font></a></td>";
echo "<td><font size=1>$row[1]</td>";
echo "<td><font size=1>$row[2]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=32111111111&alias_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=13000000000 display all group alias
######################
if ($ADD==13000000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active from groups_alias order by group_alias_id;";
$rslt=mysql_query($stmt, $link);
$phonealias_to_print = mysql_num_rows($rslt);
echo "<br>GROUP ALIAS LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white><B>GROUP ALIAS ID</B></a></td>";
echo "<td><font size=1 color=white><B>GROUP ALIAS NAME</B></a></td>";
echo "<td><font size=1 color=white><B>CID NUMBER</B></a></td>";
echo "<td><font size=1 color=white><B>CID NAME</B></a></td>";
echo "<td><font size=1 color=white><B>ACTIVE</B></a></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($phonealias_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><a href=\"$PHP_SELF?ADD=33111111111&group_alias_id=$row[0]\"><font size=1 color=black>$row[0]</font></a></td>";
echo "<td><font size=1>$row[1]</td>";
echo "<td><font size=1>$row[2]</td>";
echo "<td><font size=1>$row[3]</td>";
echo "<td><font size=1>$row[4]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=33111111111&group_alias_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=100000000000 display all servers
######################
if ($ADD==100000000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,local_gmt from servers order by server_id";
$rslt=mysql_query($stmt, $link);
$servers_to_print = mysql_num_rows($rslt);
echo "<br>SERVER LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>SERVER ID</B></td>";
echo "<td><font size=1 color=white><B>NAME</B></td>";
echo "<td><font size=1 color=white><B>SERVER IP</B></td>";
echo "<td><font size=1 color=white><B>ACTIVE</B></td>";
echo "<td><font size=1 color=white><B>ASTERISK</B></td>";
echo "<td><font size=1 color=white><B>TRUNKS</B></td>";
echo "<td><font size=1 color=white><B>GMT</B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($servers_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=311111111111&server_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1>$row[1]</td>";
echo "<td><font size=1>$row[2]</td>";
echo "<td><font size=1>$row[3]</td>";
echo "<td><font size=1>$row[4]</td>";
echo "<td><font size=1>$row[5]</td>";
echo "<td><font size=1>$row[6]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=311111111111&server_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=130000000000 display all conf templates
######################
if ($ADD==130000000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT template_id,template_name from vicidial_conf_templates order by template_id";
$rslt=mysql_query($stmt, $link);
$templates_to_print = mysql_num_rows($rslt);
echo "<br>CONF TEMPLATE LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>Template ID</B></td>";
echo "<td><font size=1 color=white><B>Template Name</B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($templates_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=331111111111&template_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1>$row[1]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=331111111111&template_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=140000000000 display all carriers
######################
if ($ADD==140000000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT carrier_id,carrier_name,server_ip,protocol,registration_string,active from vicidial_server_carriers order by carrier_id";
$rslt=mysql_query($stmt, $link);
$carriers_to_print = mysql_num_rows($rslt);
echo "<br>CARRIER LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>Carrier ID</B></td>";
echo "<td><font size=1 color=white><B>Carrier Name</B></td>";
echo "<td><font size=1 color=white><B>Server IP</B></td>";
echo "<td><font size=1 color=white><B>Protocol</B></td>";
echo "<td><font size=1 color=white><B>Registration</B></td>";
echo "<td><font size=1 color=white><B>Active</B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($carriers_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=341111111111&carrier_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1>$row[1]</td>";
echo "<td><font size=1>$row[2]</td>";
echo "<td><font size=1>$row[3]</td>";
echo "<td><font size=1>$row[4]</td>";
echo "<td><font size=1>$row[5]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=341111111111&carrier_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=150000000000 display all tts entries
######################
if ($ADD==150000000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT tts_id,tts_name,active,tts_text,tts_voice from vicidial_tts_prompts order by tts_id";
$rslt=mysql_query($stmt, $link);
$tts_to_print = mysql_num_rows($rslt);
echo "<br>TEXT-TO-SPEECH(TTS) LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>TTS ID</B></td>";
echo "<td><font size=1 color=white><B>TTS Name</B></td>";
echo "<td><font size=1 color=white><B>Active</B></td>";
echo "<td><font size=1 color=white><B>TTS Voice</B></td>";
echo "<td><font size=1 color=white><B>TTS Text</B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($tts_to_print > $o)
{
$row=mysql_fetch_row($rslt);
$row[3]=ereg_replace(";|<|>","",$row[3]);
while(strlen($row[3]) > 50) {$row[3] = substr("$row[3]", 0, -1);}
if(strlen($row[3]) > 47) {$row[3] = "$row[3]...";}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=351111111111&tts_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1>$row[1]</td>";
echo "<td><font size=1>$row[2]</td>";
echo "<td><font size=1>$row[4]</td>";
echo "<td><font size=1>$row[3]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=351111111111&tts_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=160000000000 display all music on hold entries
######################
if ($ADD==160000000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT moh_id,moh_name,active,random from vicidial_music_on_hold where remove='N' order by moh_id";
$rslt=mysql_query($stmt, $link);
$moh_to_print = mysql_num_rows($rslt);
echo "<br>MUSIC-ON-HOLD(MOH) LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>MOH ID</B></td>";
echo "<td><font size=1 color=white><B>MOH Name</B></td>";
echo "<td><font size=1 color=white><B>Active</B></td>";
echo "<td><font size=1 color=white><B>Random Order</B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($moh_to_print > $o)
{
$row=mysql_fetch_row($rslt);
$row[3]=ereg_replace(";|<|>","",$row[3]);
while(strlen($row[3]) > 50) {$row[3] = substr("$row[3]", 0, -1);}
if(strlen($row[3]) > 47) {$row[3] = "$row[3]...";}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=361111111111&moh_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1>$row[1]</td>";
echo "<td><font size=1>$row[2]</td>";
echo "<td><font size=1>$row[3]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=361111111111&moh_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=170000000000 display all voicemail entries
######################
if ($ADD==170000000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT voicemail_id,fullname,active,messages,old_messages,delete_vm_after_email from vicidial_voicemail order by voicemail_id";
$rslt=mysql_query($stmt, $link);
$vm_to_print = mysql_num_rows($rslt);
echo "<br>VOICEMAIL BOXES:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>VOICEMAIL ID</B></td>";
echo "<td><font size=1 color=white><B>Name</B></td>";
echo "<td><font size=1 color=white><B>Active</B></td>";
echo "<td><font size=1 color=white><B>New Messages</B></td>";
echo "<td><font size=1 color=white><B>Old Messages</B></td>";
echo "<td><font size=1 color=white><B>Delete</B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($vm_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=371111111111&voicemail_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1>$row[1]</td>";
echo "<td><font size=1>$row[2]</td>";
echo "<td><font size=1>$row[3]</td>";
echo "<td><font size=1>$row[4]</td>";
echo "<td><font size=1>$row[5]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=371111111111&voicemail_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=180000000000 display all screen label entries
######################
if ($ADD==180000000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT label_id,label_name,active from vicidial_screen_labels order by label_id";
$rslt=mysql_query($stmt, $link);
$lb_to_print = mysql_num_rows($rslt);
echo "<br>Agent Screen Labels:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>LABEL ID</B></td>";
echo "<td><font size=1 color=white><B>Name</B></td>";
echo "<td><font size=1 color=white><B>Active</B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($lb_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=381111111111&label_id=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1>$row[1]</td>";
echo "<td><font size=1>$row[2]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=381111111111&label_id=$row[0]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=1000000000000 display all conferences
######################
if ($ADD==1000000000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT conf_exten,server_ip,extension from conferences order by conf_exten";
$rslt=mysql_query($stmt, $link);
$conferences_to_print = mysql_num_rows($rslt);
echo "<br>CONFERENCE LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>CONFERENCE</B></td>";
echo "<td><font size=1 color=white><B>SERVER IP</B></td>";
echo "<td><font size=1 color=white><B>EXTENSION</B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($conferences_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3111111111111&conf_exten=$row[0]&server_ip=$row[1]\">$row[0]</a></td>";
echo "<td><font size=1>$row[1]</td>";
echo "<td><font size=1>$row[2]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=3111111111111&conf_exten=$row[0]&server_ip=$row[1]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=10000000000000 display all vicidial conferences
######################
if ($ADD==10000000000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT conf_exten,server_ip,extension from vicidial_conferences order by conf_exten";
$rslt=mysql_query($stmt, $link);
$vicidialconf_to_print = mysql_num_rows($rslt);
echo "<br>VICIDIAL CONFERENCE LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><font size=1 color=white align=left><B>CONFERENCE</B></td>";
echo "<td><font size=1 color=white><B>SERVER IP</B></td>";
echo "<td><font size=1 color=white><B>EXTENSION</B></td>";
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
$o=0;
while ($vicidialconf_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=31111111111111&conf_exten=$row[0]&server_ip=$row[1]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> $row[2]</td>";
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=31111111111111&conf_exten=$row[0]&server_ip=$row[1]\">MODIFY</a></td></tr>\n";
$o++;
}
echo "</TABLE></center>\n";
}
######################
# ADD=700000000000000 view all activity in the admin log
######################
if ($ADD==700000000000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ($stage > 9999)
{
$next_limit = ($stage + 10000);
$limitSQL = "10000 offset $stage";
}
else
{
$next_limit = "10000";
$limitSQL = "10000";
}
$stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log order by event_date desc limit $limitSQL;";
$rslt=mysql_query($stmt, $link);
$logs_to_print = mysql_num_rows($rslt);
echo "<br>ADMIN CHANGE LOG: (Last 10000 records)\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ID</B></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DATE TIME</B></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>USER</B></TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>IP</TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>SECTION</TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>TYPE</TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>RECORD ID</TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>GOTO</TD>\n";
echo "</TR>\n";
$logs_printed = '';
$o=0;
while ($logs_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";}
if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";}
if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";}
if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";}
if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";}
if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";}
if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";}
if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";}
if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";}
if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";}
if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";}
if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";}
if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";}
if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";}
if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";}
if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";}
if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";}
if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";}
if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=730000000000000&stage=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> <a href=\"$PHP_SELF?ADD=710000000000000&stage=$row[2]\">$row[2]</a></td>";
echo "<td><font size=1> $row[3]</td>";
echo "<td><font size=1> $row[4]</td>";
echo "<td><font size=1> $row[5]</td>";
echo "<td><font size=1> <a href=\"$PHP_SELF?ADD=720000000000000&category=$row[4]&stage=$row[6]\">$row[6]</a></td>";
echo "<td><font size=1> $row[7]</td>";
echo "<td><font size=1> <a href=\"$PHP_SELF?$record_link\">GOTO</a></td>";
echo "</tr>\n";
$logs_printed .= "'$row[0]',";
$o++;
}
echo "</TABLE><BR><BR>\n";
echo "<a href=\"$PHP_SELF?ADD=700000000000000&stage=$next_limit\">NEXT</a>\n";
echo "</center>\n";
}
######################
# ADD=710000000000000 view all activity in the admin log made by one user
######################
if ($ADD==710000000000000)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT full_name from vicidial_users where user='$stage';";
$rslt=mysql_query($stmt, $link);
$names_to_print = mysql_num_rows($rslt);
if ($names_to_print > 0)
{
$row=mysql_fetch_row($rslt);
$user_name = $row[0];
}
$stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where user='$stage' order by event_date desc limit 10000;";
$rslt=mysql_query($stmt, $link);
$logs_to_print = mysql_num_rows($rslt);
echo "<br>ADMIN CHANGE LOG: Changes made by $stage - $user_name\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ID</B></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DATE TIME</B></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>USER</B></TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>IP</TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>SECTION</TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>TYPE</TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>RECORD ID</TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>GOTO</TD>\n";
echo "</TR>\n";
$logs_printed = '';
$o=0;
while ($logs_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";}
if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";}
if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";}
if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";}
if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";}
if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";}
if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";}
if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";}
if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";}
if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";}
if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";}
if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";}
if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";}
if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";}
if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";}
if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";}
if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";}
if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";}
if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=730000000000000&stage=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> <a href=\"$PHP_SELF?ADD=710000000000000&stage=$row[2]\">$row[2]</a></td>";
echo "<td><font size=1> $row[3]</td>";
echo "<td><font size=1> $row[4]</td>";
echo "<td><font size=1> $row[5]</td>";
echo "<td><font size=1> <a href=\"$PHP_SELF?ADD=720000000000000&category=$row[4]&stage=$row[6]\">$row[6]</a></td>";
echo "<td><font size=1> $row[7]</td>";
echo "<td><font size=1> <a href=\"$PHP_SELF?$record_link\">GOTO</a></td>";
echo "</tr>\n";
$logs_printed .= "'$row[0]',";
$o++;
}
echo "</TABLE><BR><BR>\n";
echo "\n";
echo "</center>\n";
}
######################
# ADD=720000000000000 view all activity in the admin log made to one section/value
######################
if ($ADD==720000000000000)
{
if ($LOGuser_level >= 9)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$sectionSQL = "event_section='$category'";
if (preg_match("/CAMPAIGNS/",$category))
{$sectionSQL = "event_section IN('CAMPAIGNS','CAMPAIGN_SURVEY','CAMPAIGN_LISTMIX','CAMPAIGN_PRESET','CAMPAIGN_QC','CAMPAIGN_PAUSECODE','CAMPAIGN_RECYCLE','CAMPAIGN_HOTKEY','CAMPAIGN_STATUS')";}
$stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where $sectionSQL and record_id='$stage' order by event_date desc limit 10000;";
$rslt=mysql_query($stmt, $link);
$logs_to_print = mysql_num_rows($rslt);
echo "<br>ADMIN CHANGE LOG: Section Records - $category - $stage\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ID</B></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DATE TIME</B></TD>";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>USER</B></TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>IP</TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>SECTION</TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>TYPE</TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>RECORD ID</TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DESCRIPTION</TD>\n";
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>GOTO</TD>\n";
echo "</TR>\n";
$logs_printed = '';
$o=0;
while ($logs_to_print > $o)
{
$row=mysql_fetch_row($rslt);
if (eregi("USER|AGENT",$row[4])) {$record_link = "$PHP_SELF?ADD=3&user=$row[6]";}
if (eregi('CAMPAIGN',$row[4])) {$record_link = "$PHP_SELF?ADD=31&campaign_id=$row[6]";}
if (eregi('LIST',$row[4])) {$record_link = "$PHP_SELF?ADD=311&list_id=$row[6]";}
if (eregi('SCRIPT',$row[4])) {$record_link = "$PHP_SELF?ADD=3111111&script_id=$row[6]";}
if (eregi('FILTER',$row[4])) {$record_link = "$PHP_SELF?ADD=31111111&lead_filter_id=$row[6]";}
if (eregi('INGROUP',$row[4])) {$record_link = "$PHP_SELF?ADD=3111&group_id=$row[6]";}
if (eregi('DID',$row[4])) {$record_link = "$PHP_SELF?ADD=3311&did_id=$row[6]";}
if (eregi('USERGROUP',$row[4])) {$record_link = "$PHP_SELF?ADD=311111&user_group=$row[6]";}
if (eregi('REMOTEAGENT',$row[4])) {$record_link = "$PHP_SELF?ADD=31111&remote_agent_id=$row[6]";}
if (eregi('PHONE',$row[4])) {$record_link = "$PHP_SELF?ADD=10000000000";}
if (eregi('CALLTIME',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111&call_time_id=$row[6]";}
if (eregi('SHIFT',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111&shift_id=$row[6]";}
if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111111&template_id=$row[6]";}
if (eregi('CARRIER',$row[4])) {$record_link = "$PHP_SELF?ADD=341111111111&carrier_id=$row[6]";}
if (eregi('SERVER',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111111&server_id=$row[6]";}
if (eregi('CONFERENCE',$row[4])) {$record_link = "$PHP_SELF?ADD=1000000000000";}
if (eregi('SYSTEM',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111111111";}
if (eregi('CATEGOR',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111111111";}
if (eregi('GROUPALIAS',$row[4])) {$record_link = "$PHP_SELF?ADD=33111111111&group_alias_id=$row[6]";}
if (eregi('LEADS',$row[4])) {$record_link = "./admin_modify_lead.php?lead_id=$row[6]";}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=730000000000000&stage=$row[0]\">$row[0]</a></td>";
echo "<td><font size=1> $row[1]</td>";
echo "<td><font size=1> <a href=\"$PHP_SELF?ADD=710000000000000&stage=$row[2]\">$row[2]</a></td>";
echo "<td><font size=1> $row[3]</td>";
echo "<td><font size=1> $row[4]</td>";
echo "<td><font size=1> $row[5]</td>";
echo "<td><font size=1> $row[6]</td>";
echo "<td><font size=1> $row[7]</td>";
echo "<td><font size=1> <a href=\"$record_link\">GOTO</a></td>";
echo "</tr>\n";
$logs_printed .= "'$row[0]',";
$o++;
}
echo "</TABLE><BR><BR>\n";
echo "\n";
echo "</center>\n";
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=730000000000000 detail view of one admin log entry
######################
if ($ADD==730000000000000)
{
if ($LOGuser_level >= 9)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;";
$rslt=mysql_query($stmt, $link);
$logs_to_print = mysql_num_rows($rslt);
if ($logs_to_print > 0)
{
$row=mysql_fetch_row($rslt);
echo "<br>ADMIN CHANGE LOG: Record Detail - $stage<BR><BR>\n";
echo "<center><TABLE width=$section_width cellspacing=5 cellpadding=0>\n";
echo "<TR>";
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>ID: </B></TD>";
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=2>$row[0]</TD>";
echo "</TR><TR>\n";
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>DATE TIME: </B></TD>";
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=2>$row[1]</TD>";
echo "</TR><TR>\n";
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>USER: </B></TD>";
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=2>$row[2] - $row[10]</TD>";
echo "</TR><TR>\n";
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>IP: </B></TD>";
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=2>$row[3]</TD>";
echo "</TR><TR>\n";
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>SECTION: </B></TD>";
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=2>$row[4]</TD>";
echo "</TR><TR>\n";
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>TYPE: </B></TD>";
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=2>$row[5]</TD>";
echo "</TR><TR>\n";
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>RECORD ID: </B></TD>";
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=2>$row[6]</TD>";
echo "</TR><TR>\n";
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>DESCRIPTION: </B></TD>";
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=1>$row[7]</TD>";
echo "</TR><TR>\n";
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>NOTES: </B></TD>";
echo "<TD ALIGN=LEFT><FONT FACE=\"Arial,Helvetica\" size=1>$row[8]</TD>";
echo "</TR><TR>\n";
$row[9] = eregi_replace("',","' ,",$row[9]);
$row[9] = preg_replace("/\|/","<BR>",$row[9]);
echo "<TD ALIGN=RIGHT><B><FONT FACE=\"Arial,Helvetica\" size=2>SQL: </B></TD>";
echo "<TD ALIGN=LEFT width=700><p style=\"width: 700; text-wrap: normal; word-wrap: break-word\"><FONT FACE=\"Arial,Helvetica\" size=1>$row[9]</TD>";
echo "</TR>\n";
echo "</TABLE><BR><BR>\n";
echo "\n";
echo "</center>\n";
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
######################
# ADD=999999 display reports section
######################
if ($ADD==999999)
{
if ($LOGview_reports==1)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="select server_id,server_description,server_ip,active,sysload,channels_total,cpu_idle_percent,disk_usage from servers order by server_id;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$servers_to_print = mysql_num_rows($rslt);
$i=0;
while ($i < $servers_to_print)
{
$row=mysql_fetch_row($rslt);
$server_id[$i] = $row[0];
$server_description[$i] = $row[1];
$server_ip[$i] = $row[2];
$active[$i] = $row[3];
$sysload[$i] = $row[4];
$channels_total[$i] = $row[5];
$cpu_idle_percent[$i] = $row[6];
$disk_usage[$i] = $row[7];
$i++;
}
$stmt="SELECT queuemetrics_url,vtiger_url from system_settings;";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$queuemetrics_url_LU = $row[0];
$vtiger_url_LU = $row[1];
$stmt="SELECT count(*) from vicidial_list_update_log;";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$list_update_count = $row[0];
?>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>Server Stats and Reports</TITLE></HEAD><BODY BGCOLOR=WHITE>
<FONT SIZE=4><B>Server Stats and Reports</B></FONT><BR><BR>
<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0><TR><TD VALIGN=TOP>
&nbsp; &nbsp; &nbsp;
</TD><TD VALIGN=TOP>
<?php
echo "<B>Real-Time Reports</B><BR>\n";
echo "<UL>\n";
if ( (preg_match("/Real-Time Main Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"realtime_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Real-Time Main Report</a></FONT>\n";}
# echo "<BR> &nbsp; Real-Time SIP: <a href=\"AST_timeonVDADall.php?SIPmonitorLINK=1\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Listen</a></FONT> - <a href=\"AST_timeonVDADall.php?SIPmonitorLINK=2\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Barge</a></FONT>\n";
# echo "<BR> &nbsp; Real-Time IAX: <a href=\"AST_timeonVDADall.php?IAXmonitorLINK=1\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Listen</a></FONT> - <a href=\"AST_timeonVDADall.php?IAXmonitorLINK=2\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Barge</a></FONT><BR><BR>\n";
if ( (preg_match("/Real-Time Campaign Summary/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_timeonVDADallSUMMARY.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Real-Time Campaign Summary</a></FONT>\n";}
echo "</UL><BR>\n";
echo "<B>Inbound and Outbound Calling Reports</B><BR>\n";
echo "<UL>\n";
if ( (preg_match("/Inbound Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_CLOSERstats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inbound Report</a></FONT>\n";}
if ( ( (preg_match("/Inbound Report/",$LOGallowed_reports)) and (preg_match("/Inbound DID Report/",$LOGallowed_reports)) ) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_CLOSERstats.php?DID=Y\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inbound Report by DID</a></FONT>\n";}
if ( (preg_match("/Inbound Service Level Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_CLOSER_service_level.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inbound Service Level Report</a></FONT>\n";}
if ( (preg_match("/Inbound Summary Hourly Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_CLOSERsummary_hourly.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inbound Summary Hourly Report</a></FONT>\n";}
if ( (preg_match("/Inbound DID Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_DIDstats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inbound DID Report</a></FONT>\n";}
if ( (preg_match("/Inbound IVR Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_IVRstats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inbound IVR Report</a></FONT>\n";}
if ( (preg_match("/Outbound Calling Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_VDADstats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Outbound Calling Report</a></FONT>\n";}
if ( (preg_match("/Outbound Summary Interval Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_OUTBOUNDsummary_interval.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Outbound Summary Interval Report</a></FONT>\n";}
if ( (preg_match("/Outbound IVR Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{
echo "<LI><a href=\"AST_IVRstats.php?type=outbound\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Outbound IVR Report</a>";
if ($LOGexport_reports >= 1)
{
if ( (preg_match("/Export Calls Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo " - <a href=\"call_report_export.php?ivr_export=YES\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Export</a>";}
}
echo "</FONT>\n";
}
if ( (preg_match("/Fronter - Closer Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"fcstats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Fronter - Closer Report</a></FONT>\n";}
if ( (preg_match("/Lists Campaign Statuses Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_LISTS_campaign_stats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Lists Campaign Statuses Report</a></FONT>\n";}
# echo "<LI><a href=\"vicidial_sales_viewer.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>AGENT SPREADSHEET PERFORMANCE</a></FONT>\n";
if ($LOGexport_reports >= 1)
{
if ( (preg_match("/Export Calls Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"call_report_export.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Export Calls Report</a></FONT>\n";}
if ( (preg_match("/Export Leads Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"lead_report_export.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Export Leads Report</a></FONT>\n";}
}
echo "</UL>\n";
echo "</TD><TD VALIGN=TOP>\n";
echo " &nbsp; &nbsp; &nbsp;\n";
echo "</TD><TD VALIGN=TOP>\n";
echo "<B>Agent Reports</B><BR>\n";
echo "<UL>\n";
if ( (preg_match("/Agent Time Detail/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_agent_time_detail.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Agent Time Detail</a></FONT>\n";}
if ( (preg_match("/Agent Status Detail/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_agent_status_detail.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Agent Status Detail</a></FONT>\n";}
if ( (preg_match("/Agent Performance Detail/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_agent_performance_detail.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Agent Performance Detail</a></FONT>\n";}
if ( (preg_match("/Single Agent Daily/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_agent_days_detail.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Single Agent Daily</a></FONT>\n";}
if ( (preg_match("/User Stats/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"user_stats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>User Stats</a></FONT>\n";}
if ( (preg_match("/User Time Sheet/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_agent_time_sheet.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>User Time Sheet</a></FONT>\n";}
echo "</UL><BR>\n";
echo "<B>Time Clock Reports</B><BR>\n";
echo "<UL>\n";
if ( (preg_match("/User Timeclock Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"timeclock_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>User Timeclock Report</a></FONT>\n";}
if ( (preg_match("/User Group Timeclock Status Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"timeclock_status.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>User Group Timeclock Status Report</a></FONT>\n";}
if ( (preg_match("/User Timeclock Detail Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_agent_timeclock_detail.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>User Timeclock Detail Report</a></FONT>\n";}
echo "</UL><BR>\n";
echo "<B>Other Reports and Links</B><BR>\n";
echo "<UL>\n";
if ( (preg_match("/Server Performance Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_server_performance.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Server Performance Report</a></FONT>\n";}
if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) )
{
echo "<LI><a href=\"$PHP_SELF?ADD=700000000000000\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Administration Change Log</a></FONT>\n";
}
if ($SSenable_queuemetrics_logging > 0)
{
echo "<LI><a href=\"$queuemetrics_url_LU\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>QueueMetrics Reports</a></FONT>\n";
}
if ($SSenable_vtiger_integration > 0)
{
echo "<LI><a href=\"$vtiger_url_LU\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>VtigerCRM Home</a></FONT>\n";
}
if ( ($list_update_count > 0) and ( (preg_match("/List Update Stats/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) )
{
echo "<LI><a href=\"./AST_LIST_UPDATEstats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>List Update Stats</a></FONT>\n";
}
if ($SScallcard_enabled > 0)
{
if ( (preg_match("/CallCard Search/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"callcard_admin.php?action=SEARCH\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>CallCard Search</a></FONT>\n";}
}
echo "</UL>\n";
echo "</TD></TR></TABLE>\n";
if ( (file_exists('custom_report_links.html')) and ( (preg_match("/Custom Reports Links/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) )
{
readfile('custom_report_links.html');
}
if ($reports_only_user < 1)
{
echo "<PRE><TABLE BORDER=1 CELLPADDING=2 cellspacing=0>\n";
if ($stage == 'TIME')
{
echo "<TR><TD>SERVER <a href=\"$PHP_SELF?ADD=999999\">-</a></TD>";
echo "<TD>DESCRIPTION</TD><TD>IP</TD><TD>ACT</TD><TD>LOAD</TD><TD>CHAN</TD><TD>DISK</TD><TD>TIME</TD></TR>\n";
}
else
{
echo "<TR><TD>SERVER <a href=\"$PHP_SELF?ADD=999999&stage=TIME\">+</a></TD>";
echo "<TD>DESCRIPTION</TD><TD>IP</TD><TD>ACT</TD><TD>LOAD</TD><TD>CHAN</TD><TD>DISK</TD><TD>OUTBOUND</TD><TD>INBOUND</TD></TR>\n";
}
$o=0;
while ($servers_to_print > $o)
{
$cpu = (100 - $cpu_idle_percent[$o]);
$disk = '';
$disk_ary = explode('|',$disk_usage[$o]);
$disk_ary_ct = count($disk_ary);
$k=0;
while ($k < $disk_ary_ct)
{
$disk_ary[$k] = preg_replace("/^\d* /","",$disk_ary[$k]);
if ($k<1) {$disk = "$disk_ary[$k]";}
else
{
if ($disk_ary[$k] > $disk) {$disk = "$disk_ary[$k]";}
}
$k++;
}
$disk = "$disk%";
echo "<TR>\n";
echo "<TD><a href=\"$PHP_SELF?ADD=311111111111&server_id=$server_id[$o]\">$server_id[$o]</a></TD>\n";
echo "<TD>$server_description[$o]</TD>\n";
echo "<TD>$server_ip[$o]</TD>\n";
echo "<TD>$active[$o]</TD>\n";
echo "<TD>$sysload[$o] - $cpu%</TD>\n";
echo "<TD>$channels_total[$o]</TD>\n";
echo "<TD ALIGN=RIGHT>$disk</TD>\n";
if ($stage == 'TIME')
{
$stmt="select last_update from server_updater where server_ip='$server_ip[$o]';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$servertime_to_print = mysql_num_rows($rslt);
if ($servertime_to_print)
{
$row=mysql_fetch_row($rslt);
echo "<TD NOWRAP>$row[0]</TD>";
}
}
else
{
if ( (preg_match("/Real-Time Main Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{
echo "<TD><a href=\"AST_timeonVDAD.php?server_ip=$server_ip[$o]\">LINK</a></TD>\n";
echo "<TD><a href=\"AST_timeonVDAD.php?server_ip=$server_ip[$o]&closer_display=1\">LINK</a></TD>\n";
}
else
{
echo "<TD> &nbsp; </TD>\n";
echo "<TD> &nbsp; </TD>\n";
}
}
echo "</TR>\n";
$o++;
}
if ($stage == 'TIME')
{
echo "<TR><TD COLSPAN=2> &nbsp; </TD><TD>PHP Time</TD><TD COLSPAN=4> &nbsp; </TD><TD NOWRAP>" . date("Y-m-d H:i:s") . "</TD></TR>";
$stmt="select NOW();";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$dbtime_to_print = mysql_num_rows($rslt);
if ($dbtime_to_print)
{
$row=mysql_fetch_row($rslt);
echo "<TR><TD COLSPAN=2> &nbsp; </TD><TD>DB Time</TD><TD COLSPAN=4> &nbsp; </TD><TD NOWRAP>$row[0]</TD></TR>";
}
}
echo "</TABLE>\n";
if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) )
{
echo "<BR><BR> &nbsp; <a href=\"$PHP_SELF?ADD=999994\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLUE SIZE=1>Admin Utilities</a></FONT>\n";
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
}
##### END report links #####
######################
# ADD=999998 display admin links page
######################
if ($ADD==999998)
{
?>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>Administration: Admin</TITLE></HEAD><BODY BGCOLOR=WHITE>
<FONT SIZE=4><B>Administration</B></FONT><BR><BR><CENTER>
<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0><TR><TD VALIGN=TOP>
<UL>
<?php
echo "<LI><a href=\"$PHP_SELF?ADD=100000000\"><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3> Call Times </a>\n";
echo "<LI><a href=\"$PHP_SELF?ADD=130000000\"><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3> Shifts </a>\n";
echo "<LI><a href=\"$PHP_SELF?ADD=10000000000\"><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3> Phones </a>\n";
echo "<LI><a href=\"$PHP_SELF?ADD=130000000000\"><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3> Templates </a>\n";
echo "<LI><a href=\"$PHP_SELF?ADD=140000000000\"><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3> Carriers </a>\n";
echo "<LI><a href=\"$PHP_SELF?ADD=100000000000\"><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3> Servers </a>\n";
echo "<LI><a href=\"$PHP_SELF?ADD=1000000000000\"><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3> Conferences </a>\n";
echo "<LI><a href=\"$PHP_SELF?ADD=311111111111111\"><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3> System Settings </a>\n";
echo "<LI><a href=\"$PHP_SELF?ADD=180000000000\"><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3> Agent Screen Labels </a>\n";
echo "<LI><a href=\"$PHP_SELF?ADD=321111111111111\"><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3> System Statuses </a>\n";
echo "<LI><a href=\"$PHP_SELF?ADD=170000000000\"><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3> Voicemail </a>\n";
if ( ($sounds_central_control_active > 0) or ($SSsounds_central_control_active > 0) )
{
echo "<LI><a href=\"audio_store.php\"><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3> Audio Store </a>\n";
echo "<LI><a href=\"$PHP_SELF?ADD=160000000000\"><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3> Music On Hold </a>\n";
}
if ($SSenable_tts_integration > 0)
{
echo "<LI><a href=\"$PHP_SELF?ADD=150000000000\"><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3> Text To Speech </a>\n";
}
if ($SScallcard_enabled > 0)
{
echo "<LI><a href=\"callcard_admin.php\"><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3> CallCard Admin </a>\n";
}
echo "</UL>\n";
echo "</TD><TD WIDTH=400> &nbsp; \n";
}
##### END admin links #####
######################
# ADD=999997 - user force change password page
######################
if ($ADD==999997)
{
$show_form=1;
if ($stage=='SUBMIT')
{
if ( (strlen($pass) > 20) or (strlen($pass) < 2) or ($pass==$PHP_AUTH_PW) )
{echo "Password has not been changed, please try again |1|" . strlen($pass);}
else
{
$stmt="select count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and force_change_password='Y' and active='Y' and user_level > 6;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$userpass_to_print = mysql_num_rows($rslt);
if ($userpass_to_print < 1)
{echo "Password has not been changed, please try again |2|$userpass_to_print";}
else
{
$row=mysql_fetch_row($rslt);
if ($row[0] < 1)
{echo "Password has not been changed, please try again |3|$row[0]";}
else
{
$show_form=0;
$stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and force_change_password='Y' and active='Y' and user_level > 6;";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='MODIFY', record_id='$user', event_code='USER FORCE CHANGE PASSWORD', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "Password has been updated, you may now continue\n";
}
}
}
}
if ($show_form > 0)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>CHANGE PASSWORD<form action=$PHP_SELF method=POST name=userform id=userform>\n";
echo "<input type=hidden name=ADD value=999997>\n";
echo "<input type=hidden name=DB value=\"$DB\">\n";
echo "<input type=hidden name=stage value=SUBMIT>\n";
echo "<input type=hidden name=user value=\"$PHP_AUTH_USER\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>New Password: </td><td align=left style=\"display:table-cell; vertical-align:middle;\"><input type=text id=reg_pass name=pass size=20 maxlength=20 onkeyup=\"return pwdChanged('reg_pass','reg_pass_img');\"> &nbsp; &nbsp; Strength: <IMG id=reg_pass_img src='images/pixel.gif' style=\"vertical-align:middle;\" onLoad=\"return pwdChanged('reg_pass','reg_pass_img');\"></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=left colspan=2>You are required to change your password before you can continue on to Administration. A strong password has both lower case and upper case letters as well as at least one number. Your password must be from 2 to 20 characters in length and cannot contain any characters that are not letters or numbers. Be sure that this password is something that you can remember, because as soon as you make this change you will be prompted to enter your new password to log back in to Administration</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center></form>\n";
}
}
##### END user force change password page #####
######################
# ADD=999996 - initial install welcome page
######################
if ($ADD==999996)
{
if ($SSfirst_login_trigger=='Y')
{
$show_form=1;
if ($stage=='SUBMIT')
{
if ( (strlen($pass) > 20) or (strlen($pass) < 2) or ($pass==$PHP_AUTH_PW) )
{echo "Password has not been changed, please try again |1|" . strlen($pass);}
else
{
$stmt="select count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and active='Y' and user_level > 6;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$userpass_to_print = mysql_num_rows($rslt);
if ($userpass_to_print < 1)
{echo "Password has not been changed, please try again |2|$userpass_to_print";}
else
{
$row=mysql_fetch_row($rslt);
if ($row[0] < 1)
{echo "Password has not been changed, please try again |3|$row[0]";}
else
{
$show_form=0;
if (strlen($default_phone_registration_password) < 2) {$default_phone_registration_password = $SSdefault_phone_registration_password;}
if (strlen($default_phone_login_password) < 2) {$default_phone_login_password = $SSdefault_phone_login_password;}
if (strlen($default_server_password) < 2) {$default_server_password = $SSdefault_server_password;}
if (strlen($default_local_gmt) < 2) {$default_local_gmt = $SSdefault_local_gmt;}
if (strlen($default_voicemail_timezone) < 2) {$default_voicemail_timezone = $SSdefault_voicemail_timezone;}
$stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and active='Y' and user_level > 6;";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE system_settings SET first_login_trigger='N',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',default_local_gmt='$default_local_gmt',default_voicemail_timezone='$default_voicemail_timezone';";
$rslt=mysql_query($stmtA, $link);
$stmtB="UPDATE phones SET conf_secret='$default_phone_registration_password',pass='$default_phone_login_password',local_gmt='$default_local_gmt',voicemail_timezone='$default_voicemail_timezone';";
$rslt=mysql_query($stmtB, $link);
$stmtC="UPDATE servers SET conf_secret='$default_server_password',rebuild_conf_files='Y';";
$rslt=mysql_query($stmtC, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtA|$stmtB|$stmtC|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='MODIFY', record_id='$user', event_code='INITIAL SETTINGS UPDATE', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "Passwords have been updated, you may now continue on into Administration. <BR><BR>You may want to start by reading the ViciDial Manager Manual available at <a href=\"http://www.vicidial.org/store.php#MANAGER\" target=\"_blank\">vicidial.org</a> (there is a free version available)\n";
}
}
}
}
if ($show_form > 0)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br><b>Welcome to ViciDial, initial setup screen</b><br><br><form action=$PHP_SELF method=POST name=userform id=userform>\n";
echo "<input type=hidden name=ADD value=999996>\n";
echo "<input type=hidden name=DB value=\"$DB\">\n";
echo "<input type=hidden name=stage value=SUBMIT>\n";
echo "<input type=hidden name=user value=\"$PHP_AUTH_USER\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=left colspan=2>You are required to change your password before you can continue on to Administration. A strong password has both lower case and upper case letters as well as at least one number. Your password must be from 2 to 20 characters in length and cannot contain any characters that are not letters or numbers. Be sure that this password is something that you can remember, because as soon as you complete this initial setup screen you will be prompted to enter your new password in again to log back in to Administration</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>New Password: </td><td align=left style=\"display:table-cell; vertical-align:middle;\"><input type=text id=reg_pass name=pass size=20 maxlength=20 onkeyup=\"return pwdChanged('reg_pass','reg_pass_img');\"> &nbsp; &nbsp; Strength: <IMG id=reg_pass_img src='images/pixel.gif' style=\"vertical-align:middle;\" onLoad=\"return pwdChanged('reg_pass','reg_pass_img');\"></td></tr>\n";
echo "<tr><td colspan=2> &nbsp; </td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=left colspan=2>The next three default passwords are defined in the System Settings section, and you can change them after you define them here. It is a good idea to make these passwords strong so that no one can hack into your phone accounts and place phone calls without you knowing. The default registration password used when new phones are added to the system as the SIP or IAX VOIP phone password. The default phone web login password used when new phones are added to the system, as the phone password that an agent would use in the ViciDial Agent Interface. The default server password used when new servers are added to the system for servers to communicate with each other.</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Phone Registration Password: </td><td align=left style=\"display:table-cell; vertical-align:middle;\"><input type=text id=reg_passX name=default_phone_registration_password size=20 maxlength=20 value=\"$SSdefault_phone_registration_password\" onkeyup=\"return pwdChanged('reg_passX','reg_pass_imgX');\"> &nbsp; &nbsp; Strength: <IMG id=reg_pass_imgX src='images/pixel.gif' style=\"vertical-align:middle;\" onLoad=\"return pwdChanged('reg_passX','reg_pass_imgX');\"></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Phone Login Password: </td><td align=left style=\"display:table-cell; vertical-align:middle;\"><input type=text id=reg_passY name=default_phone_login_password size=20 maxlength=20 value=\"$SSdefault_phone_login_password\" onkeyup=\"return pwdChanged('reg_passY','reg_pass_imgY');\"> &nbsp; &nbsp; Strength: <IMG id=reg_pass_imgY src='images/pixel.gif' style=\"vertical-align:middle;\" onLoad=\"return pwdChanged('reg_passY','reg_pass_imgY');\"></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Server Password: </td><td align=left style=\"display:table-cell; vertical-align:middle;\"><input type=text id=reg_passZ name=default_server_password size=20 maxlength=20 value=\"$SSdefault_server_password\" onkeyup=\"return pwdChanged('reg_passZ','reg_pass_imgZ');\"> &nbsp; &nbsp; Strength: <IMG id=reg_pass_imgZ src='images/pixel.gif' style=\"vertical-align:middle;\" onLoad=\"return pwdChanged('reg_passZ','reg_pass_imgZ');\"></td></tr>\n";
echo "<tr><td colspan=2> &nbsp; </td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=left colspan=2>The next two settings are also defined in the System Settings section, and you can change them after you define them here. You should set the Default Local GMT to the timezone that your agents want to be in. The Voicemail zone is the listing of voicemail timezones that voicemail messages will be time logged with when new messages are left.</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Local GMT: </td><td align=left><select size=1 name=default_local_gmt><option>12.75</option><option>12.00</option><option>11.00</option><option>10.00</option><option>9.50</option><option>9.00</option><option>8.00</option><option>7.00</option><option>6.50</option><option>6.00</option><option>5.75</option><option>5.50</option><option>5.00</option><option>4.50</option><option>4.00</option><option>3.50</option><option>3.00</option><option>2.00</option><option>1.00</option><option>0.00</option><option>-1.00</option><option>-2.00</option><option>-3.00</option><option>-3.50</option><option>-4.00</option><option>-5.00</option><option>-6.00</option><option>-7.00</option><option>-8.00</option><option>-9.00</option><option>-10.00</option><option>-11.00</option><option>-12.00</option><option selected>$SSdefault_local_gmt</option></select> (Do NOT Adjust for DST)$NWB#settings-default_local_gmt$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Default Voicemail Zone: </td><td align=left><select size=1 name=default_voicemail_timezone>";
$vm_zones = explode("\n",$SSvoicemail_timezones);
$z=0;
$vm_zones_ct = count($vm_zones);
while($vm_zones_ct > $z)
{
if (strlen($vm_zones[$z]) > 5)
{
$vm_specs = explode("=",$vm_zones[$z]);
$vm_abb = $vm_specs[0];
$vm_details = explode('|',$vm_specs[1]);
$vm_location = $vm_details[0];
echo "<option value=\"$vm_abb\">$vm_abb - $vm_location</option>\n";
}
$z++;
}
echo "<option selected>$SSdefault_voicemail_timezone</option></select> $NWB#settings-default_voicemail_timezone$NWE</td></tr>\n";
echo "<tr><td colspan=2> &nbsp; </td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center></form>\n";
}
}
}
##### END initial install welcome page #####
######################
# ADD=999995 - copyright trademark license page
######################
if ($ADD==999995)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br><B> Welcome to ViciDial: copyright, trademark and license page</B><BR><BR>\n";
echo "<center><TABLE width=$section_width cellspacing=5 cellpadding=2>\n";
echo "<tr bgcolor=#B6D3FC><td align=right valign=top><B><font size=3>Copyright: </B></td><td align=left> &nbsp; The ViciDial Call Center Suite is maintained by the <a href=\"http://www.vicidial.com/\" target=\"_blank\">ViciDial Group</a>, &copy; 2011</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right valign=top><B><font size=3>Trademark: </B></td><td align=left> &nbsp; \"VICIDIAL\" is a registered trademark of the <a href=\"http://www.vicidial.com/\" target=\"_blank\">ViciDial Group</a>. Here is our <a href=\"http://www.vicidial.com/trademark.html\" target=\"_blank\">trademark use policy</a></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right valign=top><B><font size=3>License: </B></td><td align=left> &nbsp; The ViciDial Call Center Suite is released under the <a href=\"http://www.vicidial.com/agpl.html\" target=\"_blank\">AGPLv2 open source license</a></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right valign=top nowrap><B><font size=3>Source Code: </B></td><td align=left> &nbsp; The ViciDial Call Center Suite software is available for download, and for use, free of cost. You can download the easy to install <a href=\"http://www.vicibox.com/server/index.html\" target=\"_blank\">ViciBox CD ISO version</a>, or only the <a href=\"http://sourceforge.net/projects/astguiclient/files/\" target=\"_blank\">source code</a></td></tr>\n";
echo "</TABLE></center></form>\n";
if ($first_login_link > 0)
{
echo "<BR><BR>";
echo "<BR><center><a href=\"$PHP_SELF?ADD=999996\"><B><font size=4>Continue on to the Initial Setup</font></b></a></center><BR> &nbsp; \n";
}
}
##### END copyright trademark license page #####
######################
# ADD=999994 - admin hidden utilities page
######################
if ($ADD==999994)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br><B> Administration: hidden utilities page - If you do not know what these utilities do, you probably should not use them</B><BR><BR>\n";
echo "<center><TABLE width=$section_width cellspacing=5 cellpadding=2><tr bgcolor=#B6D3FC><td align=left valign=top>\n";
if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) )
{
echo "<UL>\n";
echo "<LI><a href=\"welcome_languages.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Welcome Languages Page</a></FONT>\n";
echo "<LI><a href=\"campaign_debug.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Campaign Debug Page</a></FONT>\n";
echo "<LI><a href=\"admin_phones_bulk_insert.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Bulk Phone Insert Page</a></FONT>\n";
echo "<LI><a href=\"send_CID_call.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Send a Call With Custom CID Page</a></FONT>\n";
echo "<LI><a href=\"voice_lab.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Speech Voice Lab Page</a></FONT>\n";
echo "<LI><a href=\"../agc/phone_only.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Webphone Only Page</a></FONT>\n";
echo "</UL>\n<BR>&nbsp;\n";
}
echo "</td></tr></TABLE></center>\n";
}
##### END admin hidden utilities page #####
echo "</TD></TR></TABLE></center>\n";
echo "</TD></TR></TABLE></center>\n";
$ENDtime = date("U");
$RUNtime = ($ENDtime - $STARTtime);
echo "</TD></TR>\n";
echo "<TR><TD BGCOLOR=#015B91 ALIGN=CENTER>\n";
echo "<font size=0 color=white><br><br><!-- RUNTIME: $RUNtime seconds<BR> -->";
echo "VERSION: $admin_version<BR>";
echo "BUILD: $build\n";
if (!preg_match("/_BUILD_/",$SShosted_settings))
{echo "<BR><a href=\"$PHP_SELF?ADD=999995\"><font color=white>&copy; 2011 ViciDial Group</font></a><BR><img src=\"images/pixel.gif\">";}
echo "</font>\n";
?>
</TD><TD BGCOLOR=#D9E6FE>
</TD></TR><TABLE>
</body>
<?php
if ( ($SSnocache_admin=='1') or ( ($SSadmin_modify_refresh > 1) and ($modify_footer_refresh > 0) and (strlen($modify_url)>10) ) )
{
echo "<head>\n";
if ($SSnocache_admin=='1')
{
echo "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n";
echo "<META HTTP-EQUIV=\"Expires\" CONTENT=\"-1\">\n";
echo "<META HTTP-EQUIV=\"CACHE-CONTROL\" CONTENT=\"NO-CACHE\">\n";
}
if ( ($SSadmin_modify_refresh > 1) and ($modify_footer_refresh > 0) and (strlen($modify_url)>10) )
{
echo "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"$SSadmin_modify_refresh;URL=$modify_url\">\n";
}
echo "</head>\n";
}
echo "</html>\n";
exit;
##### CALCULATE DIALABLE LEADS #####
function dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$fSQL)
{
##### BEGIN calculate what gmt_offset_now values are within the allowed local_call_time setting ###
if (isset($camp_lists))
{
if (strlen($camp_lists)>1)
{
if (strlen($dial_statuses)>2)
{
$g=0;
$p='13';
$GMT_gmt[0] = '';
$GMT_hour[0] = '';
$GMT_day[0] = '';
while ($p > -13)
{
$pzone=3600 * $p;
$pmin=(gmdate("i", time() + $pzone));
$phour=( (gmdate("G", time() + $pzone)) * 100);
$pday=gmdate("w", time() + $pzone);
$tz = sprintf("%.2f", $p);
$GMT_gmt[$g] = "$tz";
$GMT_day[$g] = "$pday";
$GMT_hour[$g] = ($phour + $pmin);
$p = ($p - 0.25);
$g++;
}
$stmt="SELECT call_time_id,call_time_name,call_time_comments,ct_default_start,ct_default_stop,ct_sunday_start,ct_sunday_stop,ct_monday_start,ct_monday_stop,ct_tuesday_start,ct_tuesday_stop,ct_wednesday_start,ct_wednesday_stop,ct_thursday_start,ct_thursday_stop,ct_friday_start,ct_friday_stop,ct_saturday_start,ct_saturday_stop,ct_state_call_times FROM vicidial_call_times where call_time_id='$local_call_time';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);
$Gct_default_start = "$rowx[3]";
$Gct_default_stop = "$rowx[4]";
$Gct_sunday_start = "$rowx[5]";
$Gct_sunday_stop = "$rowx[6]";
$Gct_monday_start = "$rowx[7]";
$Gct_monday_stop = "$rowx[8]";
$Gct_tuesday_start = "$rowx[9]";
$Gct_tuesday_stop = "$rowx[10]";
$Gct_wednesday_start = "$rowx[11]";
$Gct_wednesday_stop = "$rowx[12]";
$Gct_thursday_start = "$rowx[13]";
$Gct_thursday_stop = "$rowx[14]";
$Gct_friday_start = "$rowx[15]";
$Gct_friday_stop = "$rowx[16]";
$Gct_saturday_start = "$rowx[17]";
$Gct_saturday_stop = "$rowx[18]";
$Gct_state_call_times = "$rowx[19]";
$ct_states = '';
$ct_state_gmt_SQL = '';
$ct_srs=0;
$b=0;
if (strlen($Gct_state_call_times)>2)
{
$state_rules = explode('|',$Gct_state_call_times);
$ct_srs = ((count($state_rules)) - 2);
}
while($ct_srs >= $b)
{
if (strlen($state_rules[$b])>1)
{
$stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,state_call_time_comments,sct_default_start,sct_default_stop,sct_sunday_start,sct_sunday_stop,sct_monday_start,sct_monday_stop,sct_tuesday_start,sct_tuesday_stop,sct_wednesday_start,sct_wednesday_stop,sct_thursday_start,sct_thursday_stop,sct_friday_start,sct_friday_stop,sct_saturday_start,sct_saturday_stop from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$Gstate_call_time_id = "$row[0]";
$Gstate_call_time_state = "$row[1]";
$Gsct_default_start = "$row[4]";
$Gsct_default_stop = "$row[5]";
$Gsct_sunday_start = "$row[6]";
$Gsct_sunday_stop = "$row[7]";
$Gsct_monday_start = "$row[8]";
$Gsct_monday_stop = "$row[9]";
$Gsct_tuesday_start = "$row[10]";
$Gsct_tuesday_stop = "$row[11]";
$Gsct_wednesday_start = "$row[12]";
$Gsct_wednesday_stop = "$row[13]";
$Gsct_thursday_start = "$row[14]";
$Gsct_thursday_stop = "$row[15]";
$Gsct_friday_start = "$row[16]";
$Gsct_friday_stop = "$row[17]";
$Gsct_saturday_start = "$row[18]";
$Gsct_saturday_stop = "$row[19]";
$ct_states .="'$Gstate_call_time_state',";
$r=0;
$state_gmt='';
while($r < $g)
{
if ($GMT_day[$r]==0) #### Sunday local time
{
if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0))
{
if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) )
{$state_gmt.="'$GMT_gmt[$r]',";}
}
else
{
if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) )
{$state_gmt.="'$GMT_gmt[$r]',";}
}
}
if ($GMT_day[$r]==1) #### Monday local time
{
if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0))
{
if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) )
{$state_gmt.="'$GMT_gmt[$r]',";}
}
else
{
if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) )
{$state_gmt.="'$GMT_gmt[$r]',";}
}
}
if ($GMT_day[$r]==2) #### Tuesday local time
{
if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0))
{
if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) )
{$state_gmt.="'$GMT_gmt[$r]',";}
}
else
{
if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) )
{$state_gmt.="'$GMT_gmt[$r]',";}
}
}
if ($GMT_day[$r]==3) #### Wednesday local time
{
if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0))
{
if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) )
{$state_gmt.="'$GMT_gmt[$r]',";}
}
else
{
if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) )
{$state_gmt.="'$GMT_gmt[$r]',";}
}
}
if ($GMT_day[$r]==4) #### Thursday local time
{
if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0))
{
if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) )
{$state_gmt.="'$GMT_gmt[$r]',";}
}
else
{
if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) )
{$state_gmt.="'$GMT_gmt[$r]',";}
}
}
if ($GMT_day[$r]==5) #### Friday local time
{
if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0))
{
if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) )
{$state_gmt.="'$GMT_gmt[$r]',";}
}
else
{
if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) )
{$state_gmt.="'$GMT_gmt[$r]',";}
}
}
if ($GMT_day[$r]==6) #### Saturday local time
{
if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0))
{
if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) )
{$state_gmt.="'$GMT_gmt[$r]',";}
}
else
{
if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) )
{$state_gmt.="'$GMT_gmt[$r]',";}
}
}
$r++;
}
$state_gmt = "$state_gmt'99'";
$ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) ";
}
$b++;
}
if (strlen($ct_states)>2)
{
$ct_states = eregi_replace(",$",'',$ct_states);
$ct_statesSQL = "and state NOT IN($ct_states)";
}
else
{
$ct_statesSQL = "";
}
$r=0;
$default_gmt='';
while($r < $g)
{
if ($GMT_day[$r]==0) #### Sunday local time
{
if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0))
{
if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) )
{$default_gmt.="'$GMT_gmt[$r]',";}
}
else
{
if ( ($GMT_hour[$r]>=$Gct_sunday_start) and ($GMT_hour[$r]<$Gct_sunday_stop) )
{$default_gmt.="'$GMT_gmt[$r]',";}
}
}
if ($GMT_day[$r]==1) #### Monday local time
{
if (($Gct_monday_start==0) and ($Gct_monday_stop==0))
{
if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) )
{$default_gmt.="'$GMT_gmt[$r]',";}
}
else
{
if ( ($GMT_hour[$r]>=$Gct_monday_start) and ($GMT_hour[$r]<$Gct_monday_stop) )
{$default_gmt.="'$GMT_gmt[$r]',";}
}
}
if ($GMT_day[$r]==2) #### Tuesday local time
{
if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0))
{
if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) )
{$default_gmt.="'$GMT_gmt[$r]',";}
}
else
{
if ( ($GMT_hour[$r]>=$Gct_tuesday_start) and ($GMT_hour[$r]<$Gct_tuesday_stop) )
{$default_gmt.="'$GMT_gmt[$r]',";}
}
}
if ($GMT_day[$r]==3) #### Wednesday local time
{
if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0))
{
if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) )
{$default_gmt.="'$GMT_gmt[$r]',";}
}
else
{
if ( ($GMT_hour[$r]>=$Gct_wednesday_start) and ($GMT_hour[$r]<$Gct_wednesday_stop) )
{$default_gmt.="'$GMT_gmt[$r]',";}
}
}
if ($GMT_day[$r]==4) #### Thursday local time
{
if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0))
{
if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) )
{$default_gmt.="'$GMT_gmt[$r]',";}
}
else
{
if ( ($GMT_hour[$r]>=$Gct_thursday_start) and ($GMT_hour[$r]<$Gct_thursday_stop) )
{$default_gmt.="'$GMT_gmt[$r]',";}
}
}
if ($GMT_day[$r]==5) #### Friday local time
{
if (($Gct_friday_start==0) and ($Gct_friday_stop==0))
{
if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) )
{$default_gmt.="'$GMT_gmt[$r]',";}
}
else
{
if ( ($GMT_hour[$r]>=$Gct_friday_start) and ($GMT_hour[$r]<$Gct_friday_stop) )
{$default_gmt.="'$GMT_gmt[$r]',";}
}
}
if ($GMT_day[$r]==6) #### Saturday local time
{
if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0))
{
if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) )
{$default_gmt.="'$GMT_gmt[$r]',";}
}
else
{
if ( ($GMT_hour[$r]>=$Gct_saturday_start) and ($GMT_hour[$r]<$Gct_saturday_stop) )
{$default_gmt.="'$GMT_gmt[$r]',";}
}
}
$r++;
}
$default_gmt = "$default_gmt'99'";
$all_gmtSQL = "(gmt_offset_now IN($default_gmt) $ct_statesSQL) $ct_state_gmt_SQL";
$dial_statuses = preg_replace("/ -$/","",$dial_statuses);
$Dstatuses = explode(" ", $dial_statuses);
$Ds_to_print = (count($Dstatuses) - 0);
$Dsql = '';
$o=0;
while ($Ds_to_print > $o)
{
$o++;
$Dsql .= "'$Dstatuses[$o]',";
}
$Dsql = preg_replace("/,$/","",$Dsql);
if (strlen($Dsql) < 2) {$Dsql = "''";}
$DLTsql='';
if ($drop_lockout_time > 0)
{
$DLseconds = ($drop_lockout_time * 3600);
$DLseconds = floor($DLseconds);
$DLseconds = intval("$DLseconds");
$DLTsql = "and ( ( (status IN('DROP','XDROP')) and (last_local_call_time < CONCAT(DATE_ADD(NOW(), INTERVAL -$DLseconds SECOND),' ',CURTIME()) ) ) or (status NOT IN('DROP','XDROP')) )";
}
$stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $DLTsql $fSQL";
#$DB=1;
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$rslt_rows = mysql_num_rows($rslt);
if ($rslt_rows)
{
$rowx=mysql_fetch_row($rslt);
$active_leads = "$rowx[0]";
}
else {$active_leads = '0';}
if ($DB > 0) {echo "|$DB|\n";}
echo "This campaign has $active_leads leads to be dialed in those lists\n";
}
else
{
echo "no dial statuses selected for this campaign\n";
}
}
else
{
echo "no active lists selected for this campaign\n";
}
}
else
{
echo "no active lists selected for this campaign\n";
}
##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ###
}
?>