LICENSE: AGPLv2 # $startMS = microtime(); require("dbconnect_mysqli.php"); require("functions.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=''; $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'; $cc_color = '#FF33FF'; $cts_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'; $cc_font = 'BLACK'; $cts_font = 'BLACK'; $subcamp_font = 'BLACK'; ### QC font and color variables require_once('qc/QC_admin_variables.php'); ### 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'; $cc_color = '#C6C6C6'; $cts_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 Daily Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Single Agent Daily, User Group Login Report, 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, Dialer Inventory Report, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Carrier Log Report, Campaign Debug, Hangup Cause Report, Lists Pass Report'; $UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound Email Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Campaign Status List Report, Export Calls Report , Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Single Agent Daily, User Group Login Report, 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, Dialer Inventory Report, Custom Reports Links, CallCard Search, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Lists Pass Report'; $Vtables = 'NONE,log_noanswer,did_agent_log,contact_information'; ###################################################################################################### ###################################################################################################### ####### 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["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["audit_comments"])) {$audit_comments=$_GET["audit_comments"];} elseif (isset($_POST["audit_comments"])) {$audit_comments=$_POST["audit_comments"];} 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($_GET["na_call_url"])) {$na_call_url=$_GET["na_call_url"];} elseif (isset($_POST["na_call_url"])) {$na_call_url=$_POST["na_call_url"];} if (isset($_GET["on_hook_cid"])) {$on_hook_cid=$_GET["on_hook_cid"];} elseif (isset($_POST["on_hook_cid"])) {$on_hook_cid=$_POST["on_hook_cid"];} if (isset($_GET["form_end"])) {$form_end=$_GET["form_end"];} elseif (isset($_POST["form_end"])) {$form_end=$_POST["form_end"];} if (isset($_GET["noanswer_log"])) {$noanswer_log=$_GET["noanswer_log"];} elseif (isset($_POST["noanswer_log"])) {$noanswer_log=$_POST["noanswer_log"];} if (isset($_GET["alt_log_server_ip"])) {$alt_log_server_ip=$_GET["alt_log_server_ip"];} elseif (isset($_POST["alt_log_server_ip"])) {$alt_log_server_ip=$_POST["alt_log_server_ip"];} if (isset($_GET["alt_log_dbname"])) {$alt_log_dbname=$_GET["alt_log_dbname"];} elseif (isset($_POST["alt_log_dbname"])) {$alt_log_dbname=$_POST["alt_log_dbname"];} if (isset($_GET["alt_log_login"])) {$alt_log_login=$_GET["alt_log_login"];} elseif (isset($_POST["alt_log_login"])) {$alt_log_login=$_POST["alt_log_login"];} if (isset($_GET["alt_log_pass"])) {$alt_log_pass=$_GET["alt_log_pass"];} elseif (isset($_POST["alt_log_pass"])) {$alt_log_pass=$_POST["alt_log_pass"];} if (isset($_GET["tables_use_alt_log_db"])) {$tables_use_alt_log_db=$_GET["tables_use_alt_log_db"];} elseif (isset($_POST["tables_use_alt_log_db"])) {$tables_use_alt_log_db=$_POST["tables_use_alt_log_db"];} if (isset($_GET["did_agent_log"])) {$did_agent_log=$_GET["did_agent_log"];} elseif (isset($_POST["did_agent_log"])) {$did_agent_log=$_POST["did_agent_log"];} if (isset($_GET["survey_recording"])) {$survey_recording=$_GET["survey_recording"];} elseif (isset($_POST["survey_recording"])) {$survey_recording=$_POST["survey_recording"];} if (isset($_GET["campaign_cid_areacodes_enabled"])) {$campaign_cid_areacodes_enabled=$_GET["campaign_cid_areacodes_enabled"];} elseif (isset($_POST["campaign_cid_areacodes_enabled"])) {$campaign_cid_areacodes_enabled=$_POST["campaign_cid_areacodes_enabled"];} if (isset($_GET["areacode"])) {$areacode=$_GET["areacode"];} elseif (isset($_POST["areacode"])) {$areacode=$_POST["areacode"];} if (isset($_GET["cid_description"])) {$cid_description=$_GET["cid_description"];} elseif (isset($_POST["cid_description"])) {$cid_description=$_POST["cid_description"];} if (isset($_GET["pllb_grouping"])) {$pllb_grouping=$_GET["pllb_grouping"];} elseif (isset($_POST["pllb_grouping"])) {$pllb_grouping=$_POST["pllb_grouping"];} if (isset($_GET["pllb_grouping_limit"])) {$pllb_grouping_limit=$_GET["pllb_grouping_limit"];} elseif (isset($_POST["pllb_grouping_limit"])) {$pllb_grouping_limit=$_POST["pllb_grouping_limit"];} if (isset($_GET["description"])) {$description=$_GET["description"];} elseif (isset($_POST["description"])) {$description=$_POST["description"];} if (isset($_GET["did_ra_extensions_enabled"])) {$did_ra_extensions_enabled=$_GET["did_ra_extensions_enabled"];} elseif (isset($_POST["did_ra_extensions_enabled"])) {$did_ra_extensions_enabled=$_POST["did_ra_extensions_enabled"];} if (isset($_GET["modify_shifts"])) {$modify_shifts=$_GET["modify_shifts"];} elseif (isset($_POST["modify_shifts"])) {$modify_shifts=$_POST["modify_shifts"];} if (isset($_GET["modify_phones"])) {$modify_phones=$_GET["modify_phones"];} elseif (isset($_POST["modify_phones"])) {$modify_phones=$_POST["modify_phones"];} if (isset($_GET["modify_carriers"])) {$modify_carriers=$_GET["modify_carriers"];} elseif (isset($_POST["modify_carriers"])) {$modify_carriers=$_POST["modify_carriers"];} if (isset($_GET["modify_labels"])) {$modify_labels=$_GET["modify_labels"];} elseif (isset($_POST["modify_labels"])) {$modify_labels=$_POST["modify_labels"];} if (isset($_GET["modify_statuses"])) {$modify_statuses=$_GET["modify_statuses"];} elseif (isset($_POST["modify_statuses"])) {$modify_statuses=$_POST["modify_statuses"];} if (isset($_GET["modify_voicemail"])) {$modify_voicemail=$_GET["modify_voicemail"];} elseif (isset($_POST["modify_voicemail"])) {$modify_voicemail=$_POST["modify_voicemail"];} if (isset($_GET["modify_audiostore"])) {$modify_audiostore=$_GET["modify_audiostore"];} elseif (isset($_POST["modify_audiostore"])) {$modify_audiostore=$_POST["modify_audiostore"];} if (isset($_GET["modify_moh"])) {$modify_moh=$_GET["modify_moh"];} elseif (isset($_POST["modify_moh"])) {$modify_moh=$_POST["modify_moh"];} if (isset($_GET["modify_tts"])) {$modify_tts=$_GET["modify_tts"];} elseif (isset($_POST["modify_tts"])) {$modify_tts=$_POST["modify_tts"];} if (isset($_GET["action_xfer_cid"])) {$action_xfer_cid=$_GET["action_xfer_cid"];} elseif (isset($_POST["action_xfer_cid"])) {$action_xfer_cid=$_POST["action_xfer_cid"];} if (isset($_GET["drop_callmenu"])) {$drop_callmenu=$_GET["drop_callmenu"];} elseif (isset($_POST["drop_callmenu"])) {$drop_callmenu=$_POST["drop_callmenu"];} if (isset($_GET["after_hours_callmenu"])) {$after_hours_callmenu=$_GET["after_hours_callmenu"];} elseif (isset($_POST["after_hours_callmenu"])) {$after_hours_callmenu=$_POST["after_hours_callmenu"];} if (isset($_GET["dtmf_field"])) {$dtmf_field=$_GET["dtmf_field"];} elseif (isset($_POST["dtmf_field"])) {$dtmf_field=$_POST["dtmf_field"];} if (isset($_GET["call_count_limit"])) {$call_count_limit=$_GET["call_count_limit"];} elseif (isset($_POST["call_count_limit"])) {$call_count_limit=$_POST["call_count_limit"];} if (isset($_GET["call_count_target"])) {$call_count_target=$_GET["call_count_target"];} elseif (isset($_POST["call_count_target"])) {$call_count_target=$_POST["call_count_target"];} if (isset($_GET["completed"])) {$completed=$_GET["completed"];} elseif (isset($_POST["completed"])) {$completed=$_POST["completed"];} if (isset($_GET["expanded_list_stats"])) {$expanded_list_stats=$_GET["expanded_list_stats"];} elseif (isset($_POST["expanded_list_stats"])) {$expanded_list_stats=$_POST["expanded_list_stats"];} if (isset($_GET["report_option"])) {$report_option=$_GET["report_option"];} elseif (isset($_POST["report_option"])) {$report_option=$_POST["report_option"];} if (isset($_GET["preset_contact_search"])) {$preset_contact_search=$_GET["preset_contact_search"];} elseif (isset($_POST["preset_contact_search"])) {$preset_contact_search=$_POST["preset_contact_search"];} if (isset($_GET["contacts_enabled"])) {$contacts_enabled=$_GET["contacts_enabled"];} elseif (isset($_POST["contacts_enabled"])) {$contacts_enabled=$_POST["contacts_enabled"];} if (isset($_GET["contact_id"])) {$contact_id=$_GET["contact_id"];} elseif (isset($_POST["contact_id"])) {$contact_id=$_POST["contact_id"];} if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} if (isset($_GET["office_num"])) {$office_num=$_GET["office_num"];} elseif (isset($_POST["office_num"])) {$office_num=$_POST["office_num"];} if (isset($_GET["cell_num"])) {$cell_num=$_GET["cell_num"];} elseif (isset($_POST["cell_num"])) {$cell_num=$_POST["cell_num"];} if (isset($_GET["other_num1"])) {$other_num1=$_GET["other_num1"];} elseif (isset($_POST["other_num1"])) {$other_num1=$_POST["other_num1"];} if (isset($_GET["other_num2"])) {$other_num2=$_GET["other_num2"];} elseif (isset($_POST["other_num2"])) {$other_num2=$_POST["other_num2"];} if (isset($_GET["modify_contacts"])) {$modify_contacts=$_GET["modify_contacts"];} elseif (isset($_POST["modify_contacts"])) {$modify_contacts=$_POST["modify_contacts"];} if (isset($_GET["bu_name"])) {$bu_name=$_GET["bu_name"];} elseif (isset($_POST["bu_name"])) {$bu_name=$_POST["bu_name"];} if (isset($_GET["department"])) {$department=$_GET["department"];} elseif (isset($_POST["department"])) {$department=$_POST["department"];} if (isset($_GET["job_title"])) {$job_title=$_GET["job_title"];} elseif (isset($_POST["job_title"])) {$job_title=$_POST["job_title"];} if (isset($_GET["location"])) {$location=$_GET["location"];} elseif (isset($_POST["location"])) {$location=$_POST["location"];} if (isset($_GET["callback_hours_block"])) {$callback_hours_block=$_GET["callback_hours_block"];} elseif (isset($_POST["callback_hours_block"])) {$callback_hours_block=$_POST["callback_hours_block"];} if (isset($_GET["callback_list_calltime"])) {$callback_list_calltime=$_GET["callback_list_calltime"];} elseif (isset($_POST["callback_list_calltime"])) {$callback_list_calltime=$_POST["callback_list_calltime"];} if (isset($_GET["modify_same_user_level"])) {$modify_same_user_level=$_GET["modify_same_user_level"];} elseif (isset($_POST["modify_same_user_level"])) {$modify_same_user_level=$_POST["modify_same_user_level"];} if (isset($_GET["admin_hide_lead_data"])) {$admin_hide_lead_data=$_GET["admin_hide_lead_data"];} elseif (isset($_POST["admin_hide_lead_data"])) {$admin_hide_lead_data=$_POST["admin_hide_lead_data"];} if (isset($_GET["admin_hide_phone_data"])) {$admin_hide_phone_data=$_GET["admin_hide_phone_data"];} elseif (isset($_POST["admin_hide_phone_data"])) {$admin_hide_phone_data=$_POST["admin_hide_phone_data"];} if (isset($_GET["admin_viewable_groups"])) {$admin_viewable_groups=$_GET["admin_viewable_groups"];} elseif (isset($_POST["admin_viewable_groups"])) {$admin_viewable_groups=$_POST["admin_viewable_groups"];} if (isset($_GET["admin_viewable_call_times"])) {$admin_viewable_call_times=$_GET["admin_viewable_call_times"];} elseif (isset($_POST["admin_viewable_call_times"])) {$admin_viewable_call_times=$_POST["admin_viewable_call_times"];} if (isset($_GET["max_calls_method"])) {$max_calls_method=$_GET["max_calls_method"];} elseif (isset($_POST["max_calls_method"])) {$max_calls_method=$_POST["max_calls_method"];} if (isset($_GET["max_calls_count"])) {$max_calls_count=$_GET["max_calls_count"];} elseif (isset($_POST["max_calls_count"])) {$max_calls_count=$_POST["max_calls_count"];} if (isset($_GET["max_calls_action"])) {$max_calls_action=$_GET["max_calls_action"];} elseif (isset($_POST["max_calls_action"])) {$max_calls_action=$_POST["max_calls_action"];} if (isset($_GET["territory_reset"])) {$territory_reset=$_GET["territory_reset"];} elseif (isset($_POST["territory_reset"])) {$territory_reset=$_POST["territory_reset"];} if (isset($_GET["hopper_vlc_dup_check"])) {$hopper_vlc_dup_check=$_GET["hopper_vlc_dup_check"];} elseif (isset($_POST["hopper_vlc_dup_check"])) {$hopper_vlc_dup_check=$_POST["hopper_vlc_dup_check"];} if (isset($_GET["download_max_system_stats_metric"])) {$download_max_system_stats_metric=$_GET["download_max_system_stats_metric"];} elseif (isset($_POST["download_max_system_stats_metric"])) {$download_max_system_stats_metric=$_POST["download_max_system_stats_metric"];} if (isset($_GET["download_max_system_stats_metric_name"])) {$download_max_system_stats_metric_name=$_GET["download_max_system_stats_metric_name"];} elseif (isset($_POST["download_max_system_stats_metric_name"])) {$download_max_system_stats_metric_name=$_POST["download_max_system_stats_metric_name"];} if (isset($_GET["inventory_report"])) {$inventory_report=$_GET["inventory_report"];} elseif (isset($_POST["inventory_report"])) {$inventory_report=$_POST["inventory_report"];} if (isset($_GET["report_rank"])) {$report_rank=$_GET["report_rank"];} elseif (isset($_POST["report_rank"])) {$report_rank=$_POST["report_rank"];} if (isset($_GET["in_group_dial"])) {$in_group_dial=$_GET["in_group_dial"];} elseif (isset($_POST["in_group_dial"])) {$in_group_dial=$_POST["in_group_dial"];} if (isset($_GET["in_group_dial_select"])) {$in_group_dial_select=$_GET["in_group_dial_select"];} elseif (isset($_POST["in_group_dial_select"])) {$in_group_dial_select=$_POST["in_group_dial_select"];} if (isset($_GET["dial_ingroup_cid"])) {$dial_ingroup_cid=$_GET["dial_ingroup_cid"];} elseif (isset($_POST["dial_ingroup_cid"])) {$dial_ingroup_cid=$_POST["dial_ingroup_cid"];} if (isset($_GET["allow_emails"])) {$allow_emails=$_GET["allow_emails"];} elseif (isset($_POST["allow_emails"])) {$allow_emails=$_POST["allow_emails"];} if (isset($_GET["group_handling"])) {$group_handling=$_GET["group_handling"];} elseif (isset($_POST["group_handling"])) {$group_handling=$_POST["group_handling"];} if (isset($_GET["agentcall_email"])) {$agentcall_email=$_GET["agentcall_email"];} elseif (isset($_POST["agentcall_email"])) {$agentcall_email=$_POST["agentcall_email"];} if (isset($_GET["modify_email_accounts"])) {$modify_email_accounts=$_GET["modify_email_accounts"];} elseif (isset($_POST["modify_email_accounts"])) {$modify_email_accounts=$_POST["modify_email_accounts"];} if (isset($_GET["safe_harbor_audio_field"])) {$safe_harbor_audio_field=$_GET["safe_harbor_audio_field"];} elseif (isset($_POST["safe_harbor_audio_field"])) {$safe_harbor_audio_field=$_POST["safe_harbor_audio_field"];} if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} if (isset($_GET["call_menu_qualify_enabled"])) {$call_menu_qualify_enabled=$_GET["call_menu_qualify_enabled"];} elseif (isset($_POST["call_menu_qualify_enabled"])) {$call_menu_qualify_enabled=$_POST["call_menu_qualify_enabled"];} if (isset($_GET["qualify_sql"])) {$qualify_sql=$_GET["qualify_sql"];} elseif (isset($_POST["qualify_sql"])) {$qualify_sql=$_POST["qualify_sql"];} if (isset($_GET["admin_list_counts"])) {$admin_list_counts=$_GET["admin_list_counts"];} elseif (isset($_POST["admin_list_counts"])) {$admin_list_counts=$_POST["admin_list_counts"];} if (isset($_GET["voicemail_greeting"])) {$voicemail_greeting=$_GET["voicemail_greeting"];} elseif (isset($_POST["voicemail_greeting"])) {$voicemail_greeting=$_POST["voicemail_greeting"];} if (isset($_GET["allow_voicemail_greeting"])) {$allow_voicemail_greeting=$_GET["allow_voicemail_greeting"];} elseif (isset($_POST["allow_voicemail_greeting"])) {$allow_voicemail_greeting=$_POST["allow_voicemail_greeting"];} if (isset($_GET["pause_after_next_call"])) {$pause_after_next_call=$_GET["pause_after_next_call"];} elseif (isset($_POST["pause_after_next_call"])) {$pause_after_next_call=$_POST["pause_after_next_call"];} if (isset($_GET["owner_populate"])) {$owner_populate=$_GET["owner_populate"];} elseif (isset($_POST["owner_populate"])) {$owner_populate=$_POST["owner_populate"];} if (isset($_GET["queuemetrics_socket"])) {$queuemetrics_socket=$_GET["queuemetrics_socket"];} elseif (isset($_POST["queuemetrics_socket"])) {$queuemetrics_socket=$_POST["queuemetrics_socket"];} if (isset($_GET["queuemetrics_socket_url"])) {$queuemetrics_socket_url=$_GET["queuemetrics_socket_url"];} elseif (isset($_POST["queuemetrics_socket_url"])) {$queuemetrics_socket_url=$_POST["queuemetrics_socket_url"];} if (isset($_GET["holiday_id"])) {$holiday_id=$_GET["holiday_id"];} elseif (isset($_POST["holiday_id"])) {$holiday_id=$_POST["holiday_id"];} if (isset($_GET["holiday_name"])) {$holiday_name=$_GET["holiday_name"];} elseif (isset($_POST["holiday_name"])) {$holiday_name=$_POST["holiday_name"];} if (isset($_GET["holiday_comments"])) {$holiday_comments=$_GET["holiday_comments"];} elseif (isset($_POST["holiday_comments"])) {$holiday_comments=$_POST["holiday_comments"];} if (isset($_GET["holiday_date"])) {$holiday_date=$_GET["holiday_date"];} elseif (isset($_POST["holiday_date"])) {$holiday_date=$_POST["holiday_date"];} if (isset($_GET["holiday_status"])) {$holiday_status=$_GET["holiday_status"];} elseif (isset($_POST["holiday_status"])) {$holiday_status=$_POST["holiday_status"];} if (isset($_GET["holiday_rule"])) {$holiday_rule=$_GET["holiday_rule"];} elseif (isset($_POST["holiday_rule"])) {$holiday_rule=$_POST["holiday_rule"];} if (isset($_GET["expiration_date"])) {$expiration_date=$_GET["expiration_date"];} elseif (isset($_POST["expiration_date"])) {$expiration_date=$_POST["expiration_date"];} if (isset($_GET["use_other_campaign_dnc"])) {$use_other_campaign_dnc=$_GET["use_other_campaign_dnc"];} elseif (isset($_POST["use_other_campaign_dnc"])) {$use_other_campaign_dnc=$_POST["use_other_campaign_dnc"];} if (isset($_GET["enhanced_disconnect_logging"])) {$enhanced_disconnect_logging=$_GET["enhanced_disconnect_logging"];} elseif (isset($_POST["enhanced_disconnect_logging"])) {$enhanced_disconnect_logging=$_POST["enhanced_disconnect_logging"];} if (isset($_GET["amd_inbound_group"])) {$amd_inbound_group=$_GET["amd_inbound_group"];} elseif (isset($_POST["amd_inbound_group"])) {$amd_inbound_group=$_POST["amd_inbound_group"];} if (isset($_GET["amd_callmenu"])) {$amd_callmenu=$_GET["amd_callmenu"];} elseif (isset($_POST["amd_callmenu"])) {$amd_callmenu=$_POST["amd_callmenu"];} if (isset($_GET["level_8_disable_add"])) {$level_8_disable_add=$_GET["level_8_disable_add"];} elseif (isset($_POST["level_8_disable_add"])) {$level_8_disable_add=$_POST["level_8_disable_add"];} if (isset($_GET["survey_wait_sec"])) {$survey_wait_sec=$_GET["survey_wait_sec"];} elseif (isset($_POST["survey_wait_sec"])) {$survey_wait_sec=$_POST["survey_wait_sec"];} if (isset($_GET["queuemetrics_record_hold"])) {$queuemetrics_record_hold=$_GET["queuemetrics_record_hold"];} elseif (isset($_POST["queuemetrics_record_hold"])) {$queuemetrics_record_hold=$_POST["queuemetrics_record_hold"];} if (isset($_GET["country_code_list_stats"])) {$country_code_list_stats=$_GET["country_code_list_stats"];} elseif (isset($_POST["country_code_list_stats"])) {$country_code_list_stats=$_POST["country_code_list_stats"];} if (isset($_GET["manual_dial_lead_id"])) {$manual_dial_lead_id=$_GET["manual_dial_lead_id"];} elseif (isset($_POST["manual_dial_lead_id"])) {$manual_dial_lead_id=$_POST["manual_dial_lead_id"];} if (isset($_GET["auto_restart_asterisk"])) {$auto_restart_asterisk=$_GET["auto_restart_asterisk"];} elseif (isset($_POST["auto_restart_asterisk"])) {$auto_restart_asterisk=$_POST["auto_restart_asterisk"];} if (isset($_GET["asterisk_temp_no_restart"])) {$asterisk_temp_no_restart=$_GET["asterisk_temp_no_restart"];} elseif (isset($_POST["asterisk_temp_no_restart"])) {$asterisk_temp_no_restart=$_POST["asterisk_temp_no_restart"];} if (isset($_GET["dead_max"])) {$dead_max=$_GET["dead_max"];} elseif (isset($_POST["dead_max"])) {$dead_max=$_POST["dead_max"];} if (isset($_GET["dispo_max"])) {$dispo_max=$_GET["dispo_max"];} elseif (isset($_POST["dispo_max"])) {$dispo_max=$_POST["dispo_max"];} if (isset($_GET["pause_max"])) {$pause_max=$_GET["pause_max"];} elseif (isset($_POST["pause_max"])) {$pause_max=$_POST["pause_max"];} if (isset($_GET["dead_max_dispo"])) {$dead_max_dispo=$_GET["dead_max_dispo"];} elseif (isset($_POST["dead_max_dispo"])) {$dead_max_dispo=$_POST["dead_max_dispo"];} if (isset($_GET["dispo_max_dispo"])) {$dispo_max_dispo=$_GET["dispo_max_dispo"];} elseif (isset($_POST["dispo_max_dispo"])) {$dispo_max_dispo=$_POST["dispo_max_dispo"];} if (isset($_GET["voicemail_dump_exten_no_inst"])) {$voicemail_dump_exten_no_inst=$_GET["voicemail_dump_exten_no_inst"];} elseif (isset($_POST["voicemail_dump_exten_no_inst"])) {$voicemail_dump_exten_no_inst=$_POST["voicemail_dump_exten_no_inst"];} 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,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,allow_emails,level_8_disable_add,pass_key,pass_hash_enabled,disable_auto_dial,country_code_list_stats FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysqli_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysqli_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]; $SScampaign_cid_areacodes_enabled = $row[21]; $SSpllb_grouping_limit = $row[22]; $SSdid_ra_extensions_enabled = $row[23]; $SSexpanded_list_stats = $row[24]; $SScontacts_enabled = $row[25]; $SSalt_log_server_ip = $row[26]; $SSalt_log_dbname = $row[27]; $SSalt_log_login = $row[28]; $SSalt_log_pass = $row[29]; $SStables_use_alt_log_db = $row[30]; $SScall_menu_qualify_enabled = $row[31]; $SSadmin_list_counts = $row[32]; $SSallow_voicemail_greeting = $row[33]; $SSsvn_revision = $row[34]; $SSallow_emails = $row[35]; $SSlevel_8_disable_add = $row[36]; $SSpass_key = $row[37]; $SSpass_hash_enabled = $row[38]; $SSdisable_auto_dial = $row[39]; $SScountry_code_list_stats = $row[40]; } ##### END SETTINGS LOOKUP ##### ########################################### ### populate pass_key if not set if ( ($qm_conf_ct > 0) and (strlen($SSpass_key)<16) ) { $SSpass_key = ''; $possible = "0123456789abcdefghijklmnpqrstvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ"; $i = 0; $length = 16; while ($i < $length) { $char = substr($possible, mt_rand(0, strlen($possible)-1), 1); $SSpass_key .= $char; $i++; } $stmt="UPDATE system_settings set pass_key='$SSpass_key' where ( (pass_key is NULL) or (pass_key='') );"; $rslt=mysql_to_mysqli($stmt, $link); } ###################################################################################################### ###################################################################################################### ####### Form variable filtering for security and data integrity ###################################################################################################### ###################################################################################################### if ($non_latin < 1) { ### DIGITS ONLY ### $adaptive_latest_server_time = preg_replace('/[^0-9]/','',$adaptive_latest_server_time); $admin_hangup_enabled = preg_replace('/[^0-9]/','',$admin_hangup_enabled); $admin_hijack_enabled = preg_replace('/[^0-9]/','',$admin_hijack_enabled); $admin_monitor_enabled = preg_replace('/[^0-9]/','',$admin_monitor_enabled); $AFLogging_enabled = preg_replace('/[^0-9]/','',$AFLogging_enabled); $agent_choose_ingroups = preg_replace('/[^0-9]/','',$agent_choose_ingroups); $agentcall_manual = preg_replace('/[^0-9]/','',$agentcall_manual); $agentonly_callbacks = preg_replace('/[^0-9]/','',$agentonly_callbacks); $AGI_call_logging_enabled = preg_replace('/[^0-9]/','',$AGI_call_logging_enabled); $allcalls_delay = preg_replace('/[^0-9]/','',$allcalls_delay); $alter_agent_interface_options = preg_replace('/[^0-9]/','',$alter_agent_interface_options); $answer_transfer_agent = preg_replace('/[^0-9]/','',$answer_transfer_agent); $ast_admin_access = preg_replace('/[^0-9]/','',$ast_admin_access); $ast_delete_phones = preg_replace('/[^0-9]/','',$ast_delete_phones); $attempt_delay = preg_replace('/[^0-9]/','',$attempt_delay); $attempt_maximum = preg_replace('/[^0-9]/','',$attempt_maximum); $auto_dial_next_number = preg_replace('/[^0-9]/','',$auto_dial_next_number); $balance_trunks_offlimits = preg_replace('/[^0-9]/','',$balance_trunks_offlimits); $call_parking_enabled = preg_replace('/[^0-9]/','',$call_parking_enabled); $CallerID_popup_enabled = preg_replace('/[^0-9]/','',$CallerID_popup_enabled); $campaign_detail = preg_replace('/[^0-9]/','',$campaign_detail); $campaign_rec_exten = preg_replace('/[^0-9]/','',$campaign_rec_exten); $campaign_vdad_exten = preg_replace('/[^0-9]/','',$campaign_vdad_exten); $change_agent_campaign = preg_replace('/[^0-9]/','',$change_agent_campaign); $closer_default_blended = preg_replace('/[^0-9]/','',$closer_default_blended); $conf_exten = preg_replace('/[^0-9]/','',$conf_exten); $conf_on_extension = preg_replace('/[^0-9]/','',$conf_on_extension); $conferencing_enabled = preg_replace('/[^0-9]/','',$conferencing_enabled); $ct_default_start = preg_replace('/[^0-9]/','',$ct_default_start); $ct_default_stop = preg_replace('/[^0-9]/','',$ct_default_stop); $ct_friday_start = preg_replace('/[^0-9]/','',$ct_friday_start); $ct_friday_stop = preg_replace('/[^0-9]/','',$ct_friday_stop); $ct_monday_start = preg_replace('/[^0-9]/','',$ct_monday_start); $ct_monday_stop = preg_replace('/[^0-9]/','',$ct_monday_stop); $ct_saturday_start = preg_replace('/[^0-9]/','',$ct_saturday_start); $ct_saturday_stop = preg_replace('/[^0-9]/','',$ct_saturday_stop); $ct_sunday_start = preg_replace('/[^0-9]/','',$ct_sunday_start); $ct_sunday_stop = preg_replace('/[^0-9]/','',$ct_sunday_stop); $ct_thursday_start = preg_replace('/[^0-9]/','',$ct_thursday_start); $ct_thursday_stop = preg_replace('/[^0-9]/','',$ct_thursday_stop); $ct_tuesday_start = preg_replace('/[^0-9]/','',$ct_tuesday_start); $ct_tuesday_stop = preg_replace('/[^0-9]/','',$ct_tuesday_stop); $ct_wednesday_start = preg_replace('/[^0-9]/','',$ct_wednesday_start); $ct_wednesday_stop = preg_replace('/[^0-9]/','',$ct_wednesday_stop); $DBX_port = preg_replace('/[^0-9]/','',$DBX_port); $DBY_port = preg_replace('/[^0-9]/','',$DBY_port); $dedicated_trunks = preg_replace('/[^0-9]/','',$dedicated_trunks); $delete_call_times = preg_replace('/[^0-9]/','',$delete_call_times); $delete_campaigns = preg_replace('/[^0-9]/','',$delete_campaigns); $delete_filters = preg_replace('/[^0-9]/','',$delete_filters); $delete_ingroups = preg_replace('/[^0-9]/','',$delete_ingroups); $delete_lists = preg_replace('/[^0-9]/','',$delete_lists); $delete_remote_agents = preg_replace('/[^0-9]/','',$delete_remote_agents); $delete_scripts = preg_replace('/[^0-9]/','',$delete_scripts); $delete_user_groups = preg_replace('/[^0-9]/','',$delete_user_groups); $delete_users = preg_replace('/[^0-9]/','',$delete_users); $dial_timeout = preg_replace('/[^0-9]/','',$dial_timeout); $dialplan_number = preg_replace('/[^0-9]/','',$dialplan_number); $enable_fast_refresh = preg_replace('/[^0-9]/','',$enable_fast_refresh); $enable_persistant_mysql = preg_replace('/[^0-9]/','',$enable_persistant_mysql); $fast_refresh_rate = preg_replace('/[^0-9]/','',$fast_refresh_rate); $hopper_level = preg_replace('/[^0-9]/','',$hopper_level); $hotkey = preg_replace('/[^0-9]/','',$hotkey); $hotkeys_active = preg_replace('/[^0-9]/','',$hotkeys_active); $list_id = preg_replace('/[^0-9]/','',$list_id); $load_leads = preg_replace('/[^0-9]/','',$load_leads); $max_vicidial_trunks = preg_replace('/[^0-9]/','',$max_vicidial_trunks); $modify_call_times = preg_replace('/[^0-9]/','',$modify_call_times); $modify_users = preg_replace('/[^0-9]/','',$modify_users); $modify_campaigns = preg_replace('/[^0-9]/','',$modify_campaigns); $modify_lists = preg_replace('/[^0-9]/','',$modify_lists); $modify_scripts = preg_replace('/[^0-9]/','',$modify_scripts); $modify_filters = preg_replace('/[^0-9]/','',$modify_filters); $modify_ingroups = preg_replace('/[^0-9]/','',$modify_ingroups); $modify_usergroups = preg_replace('/[^0-9]/','',$modify_usergroups); $modify_remoteagents = preg_replace('/[^0-9]/','',$modify_remoteagents); $modify_servers = preg_replace('/[^0-9]/','',$modify_servers); $view_reports = preg_replace('/[^0-9]/','',$view_reports); $modify_leads = preg_replace('/[^0-9]/','',$modify_leads); $monitor_prefix = preg_replace('/[^0-9]/','',$monitor_prefix); $number_of_lines = preg_replace('/[^0-9]/','',$number_of_lines); $old_conf_exten = preg_replace('/[^0-9]/','',$old_conf_exten); $outbound_cid = preg_replace('/[^0-9]/','',$outbound_cid); $park_ext = preg_replace('/[^0-9]/','',$park_ext); $park_on_extension = preg_replace('/[^0-9]/','',$park_on_extension); $phone_number = preg_replace('/[^0-9]/','',$phone_number); $QUEUE_ACTION_enabled = preg_replace('/[^0-9]/','',$QUEUE_ACTION_enabled); $recording_exten = preg_replace('/[^0-9]/','',$recording_exten); $remote_agent_id = preg_replace('/[^0-9]/','',$remote_agent_id); $telnet_port = preg_replace('/[^0-9]/','',$telnet_port); $updater_check_enabled = preg_replace('/[^0-9]/','',$updater_check_enabled); $user_level = preg_replace('/[^0-9]/','',$user_level); $user_switching_enabled = preg_replace('/[^0-9]/','',$user_switching_enabled); $VDstop_rec_after_each_call = preg_replace('/[^0-9]/','',$VDstop_rec_after_each_call); $VICIDIAL_park_on_extension = preg_replace('/[^0-9]/','',$VICIDIAL_park_on_extension); $vicidial_recording = preg_replace('/[^0-9]/','',$vicidial_recording); $vicidial_transfers = preg_replace('/[^0-9]/','',$vicidial_transfers); $voicemail_button_enabled = preg_replace('/[^0-9]/','',$voicemail_button_enabled); $voicemail_dump_exten = preg_replace('/[^0-9]/','',$voicemail_dump_exten); $voicemail_dump_exten_no_inst = preg_replace('/[^0-9]/','',$voicemail_dump_exten_no_inst); $voicemail_exten = preg_replace('/[^0-9]/','',$voicemail_exten); $wrapup_seconds = preg_replace('/[^0-9]/','',$wrapup_seconds); $use_non_latin = preg_replace('/[^0-9]/','',$use_non_latin); $webroot_writable = preg_replace('/[^0-9]/','',$webroot_writable); $enable_queuemetrics_logging = preg_replace('/[^0-9]/','',$enable_queuemetrics_logging); $enable_sipsak_messages = preg_replace('/[^0-9]/','',$enable_sipsak_messages); $allow_sipsak_messages = preg_replace('/[^0-9]/','',$allow_sipsak_messages); $mix_container_item = preg_replace('/[^0-9]/','',$mix_container_item); $prompt_interval = preg_replace('/[^0-9]/','',$prompt_interval); $agent_alert_delay = preg_replace('/[^0-9]/','',$agent_alert_delay); $manual_dial_list_id = preg_replace('/[^0-9]/','',$manual_dial_list_id); $qc_user_level = preg_replace('/[^0-9]/','',$qc_user_level); $qc_pass = preg_replace('/[^0-9]/','',$qc_pass); $qc_finish = preg_replace('/[^0-9]/','',$qc_finish); $qc_commit = preg_replace('/[^0-9]/','',$qc_commit); $shift_start_time = preg_replace('/[^0-9]/','',$shift_start_time); $timeclock_end_of_day = preg_replace('/[^0-9]/','',$timeclock_end_of_day); $survey_xfer_exten = preg_replace('/[^0-9]/','',$survey_xfer_exten); $add_timeclock_log = preg_replace('/[^0-9]/','',$add_timeclock_log); $modify_timeclock_log = preg_replace('/[^0-9]/','',$modify_timeclock_log); $delete_timeclock_log = preg_replace('/[^0-9]/','',$delete_timeclock_log); $vdc_agent_api_access = preg_replace('/[^0-9]/','',$vdc_agent_api_access); $vdc_agent_api_active = preg_replace('/[^0-9]/','',$vdc_agent_api_active); $hold_time_option_seconds = preg_replace('/[^0-9]/','',$hold_time_option_seconds); $hold_time_option_callback_list_id = preg_replace('/[^0-9]/','',$hold_time_option_callback_list_id); $did_id = preg_replace('/[^0-9]/','',$did_id); $source_did = preg_replace('/[^0-9]/','',$source_did); $modify_inbound_dids = preg_replace('/[^0-9]/','',$modify_inbound_dids); $delete_inbound_dids = preg_replace('/[^0-9]/','',$delete_inbound_dids); $answer_sec_pct_rt_stat_one = preg_replace('/[^0-9]/','',$answer_sec_pct_rt_stat_one); $answer_sec_pct_rt_stat_two = preg_replace('/[^0-9]/','',$answer_sec_pct_rt_stat_two); $enable_vtiger_integration = preg_replace('/[^0-9]/','',$enable_vtiger_integration); $qc_features_active = preg_replace('/[^0-9]/','',$qc_features_active); $outbound_autodial_active = preg_replace('/[^0-9]/','',$outbound_autodial_active); $download_lists = preg_replace('/[^0-9]/','',$download_lists); $caller_id_number = preg_replace('/[^0-9]/','',$caller_id_number); $outbound_calls_per_second = preg_replace('/[^0-9]/','',$outbound_calls_per_second); $manager_shift_enforcement_override = preg_replace('/[^0-9]/','',$manager_shift_enforcement_override); $export_reports = preg_replace('/[^0-9]/','',$export_reports); $delete_from_dnc = preg_replace('/[^0-9]/','',$delete_from_dnc); $menu_timeout = preg_replace('/[^0-9]/','',$menu_timeout); $menu_time_check = preg_replace('/[^0-9]/','',$menu_time_check); $track_in_vdac = preg_replace('/[^0-9]/','',$track_in_vdac); $menu_repeat = preg_replace('/[^0-9]/','',$menu_repeat); $agentonly_callback_campaign_lock = preg_replace('/[^0-9]/','',$agentonly_callback_campaign_lock); $sounds_central_control_active = preg_replace('/[^0-9]/','',$sounds_central_control_active); $user_territories_active = preg_replace('/[^0-9]/','',$user_territories_active); $vicidial_recording_limit = preg_replace('/[^0-9]/','',$vicidial_recording_limit); $allow_custom_dialplan = preg_replace('/[^0-9]/','',$allow_custom_dialplan); $phone_ring_timeout = preg_replace('/[^0-9]/','',$phone_ring_timeout); $enable_tts_integration = preg_replace('/[^0-9]/','',$enable_tts_integration); $allow_alerts = preg_replace('/[^0-9]/','',$allow_alerts); $vicidial_balance_rank = preg_replace('/[^0-9]/','',$vicidial_balance_rank); $rank = preg_replace('/[^0-9]/','',$rank); $enable_second_webform = preg_replace('/[^0-9]/','',$enable_second_webform); $campaign_cid_override = preg_replace('/[^0-9]/','',$campaign_cid_override); $agent_choose_territories = preg_replace('/[^0-9]/','',$agent_choose_territories); $timer_action_seconds = preg_replace('/[^0-9]/','',$timer_action_seconds); $default_webphone = preg_replace('/[^0-9]/','',$default_webphone); $default_external_server_ip = preg_replace('/[^0-9]/','',$default_external_server_ip); $enable_agc_xfer_log = preg_replace('/[^0-9]/','',$enable_agc_xfer_log); $enable_agc_dispo_log = preg_replace('/[^0-9]/','',$enable_agc_dispo_log); $callcard_enabled = preg_replace('/[^0-9]/','',$callcard_enabled); $callcard_admin = preg_replace('/[^0-9]/','',$callcard_admin); $extension_id = preg_replace('/[^0-9]/','',$extension_id); $agent_choose_blended = preg_replace('/[^0-9]/','',$agent_choose_blended); $realtime_block_user_info = preg_replace('/[^0-9]/','',$realtime_block_user_info); $codecs_with_template = preg_replace('/[^0-9]/','',$codecs_with_template); $custom_fields_modify = preg_replace('/[^0-9]/','',$custom_fields_modify); $hold_time_option_minimum = preg_replace('/[^0-9]/','',$hold_time_option_minimum); $onhold_prompt_seconds = preg_replace('/[^0-9]/','',$onhold_prompt_seconds); $hold_time_option_prompt_seconds = preg_replace('/[^0-9]/','',$hold_time_option_prompt_seconds); $custom_fields_enabled = preg_replace('/[^0-9]/','',$custom_fields_enabled); $wait_time_option_seconds = preg_replace('/[^0-9]/','',$wait_time_option_seconds); $wait_time_option_callback_list_id = preg_replace('/[^0-9]/','',$wait_time_option_callback_list_id); $wait_time_option_prompt_seconds = preg_replace('/[^0-9]/','',$wait_time_option_prompt_seconds); $filter_list_id = preg_replace('/[^0-9]/','',$filter_list_id); $calculate_estimated_hold_seconds = preg_replace('/[^0-9]/','',$calculate_estimated_hold_seconds); $customer_3way_hangup_seconds = preg_replace('/[^0-9]/','',$customer_3way_hangup_seconds); $eht_minimum_prompt_seconds = preg_replace('/[^0-9]/','',$eht_minimum_prompt_seconds); $admin_modify_refresh = preg_replace('/[^0-9]/','',$admin_modify_refresh); $nocache_admin = preg_replace('/[^0-9]/','',$nocache_admin); $generate_cross_server_exten = preg_replace('/[^0-9]/','',$generate_cross_server_exten); $queuemetrics_addmember_enabled = preg_replace('/[^0-9]/','',$queuemetrics_addmember_enabled); $modify_page = preg_replace('/[^0-9]/','',$modify_page); $on_hook_ring_time = preg_replace('/[^0-9]/','',$on_hook_ring_time); $reload_dialplan_on_servers = preg_replace('/[^0-9]/','',$reload_dialplan_on_servers); $available_only_tally_threshold_agents = preg_replace('/[^0-9]/','',$available_only_tally_threshold_agents); $dial_level_threshold_agents = preg_replace('/[^0-9]/','',$dial_level_threshold_agents); $dtmf_log = preg_replace('/[^0-9]/','',$dtmf_log); $callback_days_limit = preg_replace('/[^0-9]/','',$callback_days_limit); $queuemetrics_pe_phone_append = preg_replace('/[^0-9]/','',$queuemetrics_pe_phone_append); $test_campaign_calls = preg_replace('/[^0-9]/','',$test_campaign_calls); $agents_calls_reset = preg_replace('/[^0-9]/','',$agents_calls_reset); $campaign_cid_areacodes_enabled = preg_replace('/[^0-9]/','',$campaign_cid_areacodes_enabled); $areacode = preg_replace('/[^0-9]/','',$areacode); $pllb_grouping_limit = preg_replace('/[^0-9]/','',$pllb_grouping_limit); $did_ra_extensions_enabled = preg_replace('/[^0-9]/','',$did_ra_extensions_enabled); $modify_shifts = preg_replace('/[^0-9]/','',$modify_shifts); $modify_phones = preg_replace('/[^0-9]/','',$modify_phones); $modify_carriers = preg_replace('/[^0-9]/','',$modify_carriers); $modify_labels = preg_replace('/[^0-9]/','',$modify_labels); $modify_statuses = preg_replace('/[^0-9]/','',$modify_statuses); $modify_voicemail = preg_replace('/[^0-9]/','',$modify_voicemail); $modify_audiostore = preg_replace('/[^0-9]/','',$modify_audiostore); $modify_moh = preg_replace('/[^0-9]/','',$modify_moh); $modify_tts = preg_replace('/[^0-9]/','',$modify_tts); $call_count_limit = preg_replace('/[^0-9]/','',$call_count_limit); $call_count_target = preg_replace('/[^0-9]/','',$call_count_target); $expanded_list_stats = preg_replace('/[^0-9]/','',$expanded_list_stats); $contacts_enabled = preg_replace('/[^0-9]/','',$contacts_enabled); $contact_id = preg_replace('/[^0-9]/','',$contact_id); $office_num = preg_replace('/[^0-9]/','',$office_num); $cell_num = preg_replace('/[^0-9]/','',$cell_num); $other_num1 = preg_replace('/[^0-9]/','',$other_num1); $other_num2 = preg_replace('/[^0-9]/','',$other_num2); $modify_contacts = preg_replace('/[^0-9]/','',$modify_contacts); $callback_hours_block = preg_replace('/[^0-9]/','',$callback_hours_block); $modify_same_user_level = preg_replace('/[^0-9]/','',$modify_same_user_level); $admin_hide_lead_data = preg_replace('/[^0-9]/','',$admin_hide_lead_data); $max_calls_count = preg_replace('/[^0-9]/','',$max_calls_count); $report_rank = preg_replace('/[^0-9]/','',$report_rank); $dial_ingroup_cid = preg_replace('/[^0-9]/','',$dial_ingroup_cid); $call_menu_qualify_enabled = preg_replace('/[^0-9]/','',$call_menu_qualify_enabled); $admin_list_counts = preg_replace('/[^0-9]/','',$admin_list_counts); $allow_voicemail_greeting = preg_replace('/[^0-9]/','',$allow_voicemail_greeting); $enhanced_disconnect_logging = preg_replace('/[^0-9]/','',$enhanced_disconnect_logging); $level_8_disable_add = preg_replace('/[^0-9]/','',$level_8_disable_add); $survey_wait_sec = preg_replace('/[^0-9]/','',$survey_wait_sec); $queuemetrics_record_hold = preg_replace('/[^0-9]/','',$queuemetrics_record_hold); $country_code_list_stats = preg_replace('/[^0-9]/','',$country_code_list_stats); $dead_max = preg_replace('/[^0-9]/','',$dead_max); $dispo_max = preg_replace('/[^0-9]/','',$dispo_max); $pause_max = preg_replace('/[^0-9]/','',$pause_max); $drop_call_seconds = preg_replace('/[^-0-9]/','',$drop_call_seconds); ### DIGITS and COLONS $shift_length = preg_replace('/[^\:0-9]/','',$shift_length); ### DIGITS and HASHES and STARS $survey_dtmf_digits = preg_replace('/[^\#\*0-9]/','',$survey_dtmf_digits); $survey_ni_digit = preg_replace('/[^\#\*0-9]/','',$survey_ni_digit); ### DIGITS and DASHES $group_rank = preg_replace('/[^-0-9]/','',$group_rank); $campaign_rank = preg_replace('/[^-0-9]/','',$campaign_rank); $queue_priority = preg_replace('/[^-0-9]/','',$queue_priority); ### Y or N ONLY ### $allow_closers = preg_replace('/[^NY]/','',$allow_closers); $reset_hopper = preg_replace('/[^NY]/','',$reset_hopper); $amd_send_to_vmx = preg_replace('/[^NY]/','',$amd_send_to_vmx); $alt_number_dialing = preg_replace('/[^NY]/','',$alt_number_dialing); $selectable = preg_replace('/[^NY]/','',$selectable); $reset_list = preg_replace('/[^NY]/','',$reset_list); $fronter_display = preg_replace('/[^NY]/','',$fronter_display); $omit_phone_code = preg_replace('/[^NY]/','',$omit_phone_code); $available_only_ratio_tally = preg_replace('/[^NY]/','',$available_only_ratio_tally); $sys_perf_log = preg_replace('/[^NY]/','',$sys_perf_log); $vicidial_balance_active = preg_replace('/[^NY]/','',$vicidial_balance_active); $vd_server_logs = preg_replace('/[^NY]/','',$vd_server_logs); $campaign_stats_refresh = preg_replace('/[^NY]/','',$campaign_stats_refresh); $disable_alter_custdata = preg_replace('/[^NY]/','',$disable_alter_custdata); $no_hopper_leads_logins = preg_replace('/[^NY]/','',$no_hopper_leads_logins); $human_answered = preg_replace('/[^NY]/','',$human_answered); $tovdad_display = preg_replace('/[^NY]/','',$tovdad_display); $campaign_allow_inbound = preg_replace('/[^NY]/','',$campaign_allow_inbound); $old_campaign_allow_inbound = preg_replace('/[^NY]/','',$old_campaign_allow_inbound); $display_queue_count = preg_replace('/[^NY]/','',$display_queue_count); $qc_show_recording = preg_replace('/[^NY]/','',$qc_show_recording); $sale_category = preg_replace('/[^NY]/','',$sale_category); $dead_lead_category = preg_replace('/[^NY]/','',$dead_lead_category); $agent_extended_alt_dial = preg_replace('/[^NY]/','',$agent_extended_alt_dial); $play_place_in_line = preg_replace('/[^NY]/','',$play_place_in_line); $play_estimate_hold_time = preg_replace('/[^NY]/','',$play_estimate_hold_time); $no_delay_call_route = preg_replace('/[^NY]/','',$no_delay_call_route); $did_active = preg_replace('/[^NY]/','',$did_active); $active_asterisk_server = preg_replace('/[^NY]/','',$active_asterisk_server); $generate_vicidial_conf = preg_replace('/[^NY]/','',$generate_vicidial_conf); $rebuild_conf_files = preg_replace('/[^NY]/','',$rebuild_conf_files); $agent_allow_group_alias = preg_replace('/[^NY]/','',$agent_allow_group_alias); $vtiger_status_call = preg_replace('/[^NY]/','',$vtiger_status_call); $sale = preg_replace('/[^NY]/','',$sale); $dnc = preg_replace('/[^NY]/','',$dnc); $customer_contact = preg_replace('/[^NY]/','',$customer_contact); $not_interested = preg_replace('/[^NY]/','',$not_interested); $unworkable = preg_replace('/[^NY]/','',$unworkable); $sounds_update = preg_replace('/[^NY]/','',$sounds_update); $carrier_logging_active = preg_replace('/[^NY]/','',$carrier_logging_active); $agent_status_view_time = preg_replace('/[^NY]/','',$agent_status_view_time); $no_hopper_dialing = preg_replace('/[^NY]/','',$no_hopper_dialing); $agent_display_dialable_leads = preg_replace('/[^NY]/','',$agent_display_dialable_leads); $random = preg_replace('/[^NY]/','',$random); $rebuild_music_on_hold = preg_replace('/[^NY]/','',$rebuild_music_on_hold); $active_agent_login_server = preg_replace('/[^NY]/','',$active_agent_login_server); $agent_select_territories = preg_replace('/[^NY]/','',$agent_select_territories); $delete_vm_after_email = preg_replace('/[^NY]/','',$delete_vm_after_email); $crm_popup_login = preg_replace('/[^NY]/','',$crm_popup_login); $ignore_list_script_override = preg_replace('/[^NY]/','',$ignore_list_script_override); $is_webphone = preg_replace('/[^-_0-9a-zA-Z]/','',$is_webphone); $use_external_server_ip = preg_replace('/[^NY]/','',$use_external_server_ip); $agent_xfer_consultative = preg_replace('/[^NY]/','',$agent_xfer_consultative); $agent_xfer_dial_override = preg_replace('/[^NY]/','',$agent_xfer_dial_override); $agent_xfer_vm_transfer = preg_replace('/[^NY]/','',$agent_xfer_vm_transfer); $agent_xfer_blind_transfer = preg_replace('/[^NY]/','',$agent_xfer_blind_transfer); $agent_xfer_dial_with_customer = preg_replace('/[^NY]/','',$agent_xfer_dial_with_customer); $agent_xfer_park_customer_dial = preg_replace('/[^NY]/','',$agent_xfer_park_customer_dial); $agent_fullscreen = preg_replace('/[^NY]/','',$agent_fullscreen); $extension_appended_cidname = preg_replace('/[^NY]/','',$extension_appended_cidname); $onhold_prompt_no_block = preg_replace('/[^NY]/','',$onhold_prompt_no_block); $hold_time_option_no_block = preg_replace('/[^NY]/','',$hold_time_option_no_block); $wait_time_option_no_block = preg_replace('/[^NY]/','',$wait_time_option_no_block); $preset_hide_number = preg_replace('/[^NY]/','',$preset_hide_number); $use_auto_hopper = preg_replace('/[^NY]/','',$use_auto_hopper); $auto_trim_hopper = preg_replace('/[^NY]/','',$auto_trim_hopper); $force_change_password = preg_replace('/[^NY]/','',$force_change_password); $first_login_trigger = preg_replace('/[^NY]/','',$first_login_trigger); $eht_minimum_prompt_no_block = preg_replace('/[^NY]/','',$eht_minimum_prompt_no_block); $lead_order_randomize = preg_replace('/[^NY]/','',$lead_order_randomize); $on_hook_agent = preg_replace('/[^NY]/','',$on_hook_agent); $auto_pause_precall = preg_replace('/[^NY]/','',$auto_pause_precall); $auto_resume_precall = preg_replace('/[^NY]/','',$auto_resume_precall); $webphone_auto_answer = preg_replace('/[^NY]/','',$webphone_auto_answer); $noanswer_log = preg_replace('/[^NY]/','',$noanswer_log); $did_agent_log = preg_replace('/[^NY]/','',$did_agent_log); $completed = preg_replace('/[^NY]/','',$completed); $report_option = preg_replace('/[^NY]/','',$report_option); $hopper_vlc_dup_check = preg_replace('/[^NY]/','',$hopper_vlc_dup_check); $inventory_report = preg_replace('/[^NY]/','',$inventory_report); $manual_dial_lead_id = preg_replace('/[^NY]/','',$manual_dial_lead_id); $auto_restart_asterisk = preg_replace('/[^NY]/','',$auto_restart_asterisk); $asterisk_temp_no_restart = preg_replace('/[^NY]/','',$asterisk_temp_no_restart); $qc_enabled = preg_replace('/[^0-9NY]/','',$qc_enabled); $active = preg_replace('/[^0-9NY]/','',$active); ### ALPHA-NUMERIC ONLY ### $script_id = preg_replace('/[^0-9a-zA-Z]/','',$script_id); $agent_script_override = preg_replace('/[^0-9a-zA-Z]/','',$agent_script_override); $campaign_script = preg_replace('/[^0-9a-zA-Z]/','',$campaign_script); $submit = preg_replace('/[^0-9a-zA-Z]/','',$submit); $campaign_cid = preg_replace('/[^0-9a-zA-Z]/','',$campaign_cid); $get_call_launch = preg_replace('/[^0-9a-zA-Z]/','',$get_call_launch); $campaign_recording = preg_replace('/[^0-9a-zA-Z]/','',$campaign_recording); $ADD = preg_replace('/[^0-9a-zA-Z]/','',$ADD); $dial_prefix = preg_replace('/[^0-9a-zA-Z]/','',$dial_prefix); $state_call_time_state = preg_replace('/[^0-9a-zA-Z]/','',$state_call_time_state); $scheduled_callbacks = preg_replace('/[^0-9a-zA-Z]/','',$scheduled_callbacks); $concurrent_transfers = preg_replace('/[^0-9a-zA-Z]/','',$concurrent_transfers); $billable = preg_replace('/[^0-9a-zA-Z]/','',$billable); $pause_code = preg_replace('/[^0-9a-zA-Z]/','',$pause_code); $vicidial_recording_override = preg_replace('/[^0-9a-zA-Z]/','',$vicidial_recording_override); $ingroup_recording_override = preg_replace('/[^0-9a-zA-Z]/','',$ingroup_recording_override); $queuemetrics_log_id = preg_replace('/[^0-9a-zA-Z]/','',$queuemetrics_log_id); $after_hours_exten = preg_replace('/[^0-9a-zA-Z]/','',$after_hours_exten); $after_hours_voicemail = preg_replace('/[^0-9a-zA-Z]/','',$after_hours_voicemail); $qc_script = preg_replace('/[^0-9a-zA-Z]/','',$qc_script); $code = preg_replace('/[^0-9a-zA-Z]/','',$code); $survey_no_response_action = preg_replace('/[^0-9a-zA-Z]/','',$survey_no_response_action); $survey_ni_status = preg_replace('/[^0-9a-zA-Z]/','',$survey_ni_status); $qc_get_record_launch = preg_replace('/[^0-9a-zA-Z]/','',$qc_get_record_launch); $agent_pause_codes_active = preg_replace('/[^0-9a-zA-Z]/','',$agent_pause_codes_active); $three_way_dial_prefix = preg_replace('/[^0-9a-zA-Z]/','',$three_way_dial_prefix); $shift_enforcement = preg_replace('/[^0-9a-zA-Z]/','',$shift_enforcement); $agent_shift_enforcement_override = preg_replace('/[^0-9a-zA-Z]/','',$agent_shift_enforcement_override); $survey_third_status = preg_replace('/[^0-9a-zA-Z]/','',$survey_third_status); $survey_fourth_status = preg_replace('/[^0-9a-zA-Z]/','',$survey_fourth_status); $sounds_web_directory = preg_replace('/[^0-9a-zA-Z]/','',$sounds_web_directory); $disable_alter_custphone = preg_replace('/[^0-9a-zA-Z]/','',$disable_alter_custphone); $view_calls_in_queue = preg_replace('/[^0-9a-zA-Z]/','',$view_calls_in_queue); $view_calls_in_queue_launch = preg_replace('/[^0-9a-zA-Z]/','',$view_calls_in_queue_launch); $grab_calls_in_queue = preg_replace('/[^0-9a-zA-Z]/','',$grab_calls_in_queue); $call_requeue_button = preg_replace('/[^0-9a-zA-Z]/','',$call_requeue_button); $pause_after_each_call = preg_replace('/[^0-9a-zA-Z]/','',$pause_after_each_call); $use_internal_dnc = preg_replace('/[^0-9a-zA-Z]/','',$use_internal_dnc); $use_campaign_dnc = preg_replace('/[^0-9a-zA-Z]/','',$use_campaign_dnc); $voicemail_id = preg_replace('/[^0-9a-zA-Z]/','',$voicemail_id); $status_id = preg_replace('/[^0-9a-zA-Z]/','',$status_id); $agent_call_log_view = preg_replace('/[^0-9a-zA-Z]/','',$agent_call_log_view); $agent_call_log_view_override = preg_replace('/[^0-9a-zA-Z]/','',$agent_call_log_view_override); $queuemetrics_loginout = preg_replace('/[^0-9a-zA-Z]/','',$queuemetrics_loginout); $queuemetrics_callstatus = preg_replace('/[^0-9a-zA-Z]/','',$queuemetrics_callstatus); $filter_inbound_number = preg_replace('/[^0-9a-zA-Z]/','',$filter_inbound_number); $enable_xfer_presets = preg_replace('/[^0-9a-zA-Z]/','',$enable_xfer_presets); $hide_xfer_number_to_dial = preg_replace('/[^0-9a-zA-Z]/','',$hide_xfer_number_to_dial); $manual_dial_prefix = preg_replace('/[^0-9a-zA-Z]/','',$manual_dial_prefix); $customer_3way_hangup_logging = preg_replace('/[^0-9a-zA-Z]/','',$customer_3way_hangup_logging); $customer_3way_hangup_action = preg_replace('/[^0-9a-zA-Z]/','',$customer_3way_hangup_action); $queuemetrics_dispo_pause = preg_replace('/[^0-9a-zA-Z]/','',$queuemetrics_dispo_pause); $per_call_notes = preg_replace('/[^0-9a-zA-Z]/','',$per_call_notes); $my_callback_option = preg_replace('/[^0-9a-zA-Z]/','',$my_callback_option); $auto_pause_precall_code = preg_replace('/[^0-9a-zA-Z]/','',$auto_pause_precall_code); $disable_dispo_status = preg_replace('/[^0-9a-zA-Z]/','',$disable_dispo_status); $use_custom_cid = preg_replace('/[^0-9a-zA-Z]/','',$use_custom_cid); $action_xfer_cid = preg_replace('/[^0-9a-zA-Z]/','',$action_xfer_cid); $callback_list_calltime = preg_replace('/[^0-9a-zA-Z]/','',$callback_list_calltime); $pause_after_next_call = preg_replace('/[^0-9a-zA-Z]/','',$pause_after_next_call); $owner_populate = preg_replace('/[^0-9a-zA-Z]/','',$owner_populate); $use_other_campaign_dnc = preg_replace('/[^0-9a-zA-Z]/','',$use_other_campaign_dnc); $dead_max_dispo = preg_replace('/[^0-9a-zA-Z]/','',$dead_max_dispo); $dispo_max_dispo = preg_replace('/[^0-9a-zA-Z]/','',$dispo_max_dispo); ### DIGITS and Dots $server_ip = preg_replace('/[^\.0-9]/','',$server_ip); $auto_dial_level = preg_replace('/[^\.0-9]/','',$auto_dial_level); $adaptive_maximum_level = preg_replace('/[^\.0-9]/','',$adaptive_maximum_level); $phone_ip = preg_replace('/[^\.0-9]/','',$phone_ip); $old_server_ip = preg_replace('/[^\.0-9]/','',$old_server_ip); $computer_ip = preg_replace('/[^\.0-9]/','',$computer_ip); $queuemetrics_server_ip = preg_replace('/[^\.0-9]/','',$queuemetrics_server_ip); $vtiger_server_ip = preg_replace('/[^\.0-9]/','',$vtiger_server_ip); $active_voicemail_server = preg_replace('/[^\.0-9]/','',$active_voicemail_server); $auto_dial_limit = preg_replace('/[^\.0-9]/','',$auto_dial_limit); $adaptive_dropped_percentage = preg_replace('/[^\.0-9]/','',$adaptive_dropped_percentage); $drop_lockout_time = preg_replace('/[^\.0-9]/','',$drop_lockout_time); $filter_server_ip = preg_replace('/[^\.0-9]/','',$filter_server_ip); $auto_hopper_multi = preg_replace('/[^\.0-9]/','',$auto_hopper_multi); ### ALPHA-NUMERIC and spaces and hash and star and comma $xferconf_a_dtmf = preg_replace('/[^ \,\*\#0-9a-zA-Z]/','',$xferconf_a_dtmf); $xferconf_b_dtmf = preg_replace('/[^ \,\*\#0-9a-zA-Z]/','',$xferconf_b_dtmf); $xferconf_c_dtmf = preg_replace('/[^ \,\*\#0-9a-zA-Z]/','',$xferconf_c_dtmf); $xferconf_d_dtmf = preg_replace('/[^ \,\*\#0-9a-zA-Z]/','',$xferconf_d_dtmf); $xferconf_e_dtmf = preg_replace('/[^ \,\*\#0-9a-zA-Z]/','',$xferconf_e_dtmf); $survey_third_digit = preg_replace('/[^ \,\*\#0-9a-zA-Z]/','',$survey_third_digit); $survey_fourth_digit = preg_replace('/[^ \,\*\#0-9a-zA-Z]/','',$survey_fourth_digit); $survey_third_exten = preg_replace('/[^ \,\*\#0-9a-zA-Z]/','',$survey_third_exten); $survey_fourth_exten = preg_replace('/[^ \,\*\#0-9a-zA-Z]/','',$survey_fourth_exten); $preset_dtmf = preg_replace('/[^ \,\*\#0-9a-zA-Z]/','',$preset_dtmf); ### ALPHACAPS-NUMERIC $xferconf_a_number = preg_replace('/[^0-9A-Z]/','',$xferconf_a_number); $xferconf_b_number = preg_replace('/[^0-9A-Z]/','',$xferconf_b_number); ### ALPHA-NUMERIC and underscore and dash $agi_output = preg_replace('/[^-_0-9a-zA-Z]/','',$agi_output); $ASTmgrSECRET = preg_replace('/[^-_0-9a-zA-Z]/','',$ASTmgrSECRET); $ASTmgrUSERNAME = preg_replace('/[^-_0-9a-zA-Z]/','',$ASTmgrUSERNAME); $ASTmgrUSERNAMElisten = preg_replace('/[^-_0-9a-zA-Z]/','',$ASTmgrUSERNAMElisten); $ASTmgrUSERNAMEsend = preg_replace('/[^-_0-9a-zA-Z]/','',$ASTmgrUSERNAMEsend); $ASTmgrUSERNAMEupdate = preg_replace('/[^-_0-9a-zA-Z]/','',$ASTmgrUSERNAMEupdate); $call_time_id = preg_replace('/[^-_0-9a-zA-Z]/','',$call_time_id); $campaign_id = preg_replace('/[^-_0-9a-zA-Z]/','',$campaign_id); $CoNfIrM = preg_replace('/[^-_0-9a-zA-Z]/','',$CoNfIrM); $DBX_database = preg_replace('/[^-_0-9a-zA-Z]/','',$DBX_database); $DBX_pass = preg_replace('/[^-_0-9a-zA-Z]/','',$DBX_pass); $DBX_user = preg_replace('/[^-_0-9a-zA-Z]/','',$DBX_user); $DBY_database = preg_replace('/[^-_0-9a-zA-Z]/','',$DBY_database); $DBY_pass = preg_replace('/[^-_0-9a-zA-Z]/','',$DBY_pass); $DBY_user = preg_replace('/[^-_0-9a-zA-Z]/','',$DBY_user); $dial_method = preg_replace('/[^-_0-9a-zA-Z]/','',$dial_method); $dial_status_a = preg_replace('/[^-_0-9a-zA-Z]/','',$dial_status_a); $dial_status_b = preg_replace('/[^-_0-9a-zA-Z]/','',$dial_status_b); $dial_status_c = preg_replace('/[^-_0-9a-zA-Z]/','',$dial_status_c); $dial_status_d = preg_replace('/[^-_0-9a-zA-Z]/','',$dial_status_d); $dial_status_e = preg_replace('/[^-_0-9a-zA-Z]/','',$dial_status_e); $ext_context = preg_replace('/[^-_0-9a-zA-Z]/','',$ext_context); $group_id = preg_replace('/[^-_0-9a-zA-Z]/','',$group_id); $lead_filter_id = preg_replace('/[^-_0-9a-zA-Z]/','',$lead_filter_id); $local_call_time = preg_replace('/[^-_0-9a-zA-Z]/','',$local_call_time); $login = preg_replace('/[^-_0-9a-zA-Z]/','',$login); $login_campaign = preg_replace('/[^-_0-9a-zA-Z]/','',$login_campaign); $login_pass = preg_replace('/[^-_0-9a-zA-Z]/','',$login_pass); $login_user = preg_replace('/[^-_0-9a-zA-Z]/','',$login_user); $next_agent_call = preg_replace('/[^-_0-9a-zA-Z]/','',$next_agent_call); $old_campaign_id = preg_replace('/[^-_0-9a-zA-Z]/','',$old_campaign_id); $old_server_id = preg_replace('/[^-_0-9a-zA-Z]/','',$old_server_id); $OLDuser_group = preg_replace('/[^-_0-9a-zA-Z]/','',$OLDuser_group); $park_file_name = preg_replace('/[^-_0-9a-zA-Z]/','',$park_file_name); $pass = preg_replace('/[^-_0-9a-zA-Z]/','',$pass); $phone_login = preg_replace('/[^-_0-9a-zA-Z]/','',$phone_login); $phone_pass = preg_replace('/[^-_0-9a-zA-Z]/','',$phone_pass); $PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_PW); $PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_USER); $protocol = preg_replace('/[^-_0-9a-zA-Z]/','',$protocol); $server_id = preg_replace('/[^-_0-9a-zA-Z]/','',$server_id); $stage = preg_replace('/[^-_0-9a-zA-Z]/','',$stage); $state_rule = preg_replace('/[^-_0-9a-zA-Z]/','',$state_rule); $holiday_rule = preg_replace('/[^-_0-9a-zA-Z]/','',$holiday_rule); $trunk_restriction = preg_replace('/[^-_0-9a-zA-Z]/','',$trunk_restriction); $user = preg_replace('/[^-_0-9a-zA-Z]/','',$user); $user_group = preg_replace('/[^-_0-9a-zA-Z]/','',$user_group); $VICIDIAL_park_on_filename = preg_replace('/[^-_0-9a-zA-Z]/','',$VICIDIAL_park_on_filename); $auto_alt_dial = preg_replace('/[^-_0-9a-zA-Z]/','',$auto_alt_dial); $dial_status = preg_replace('/[^-_0-9a-zA-Z]/','',$dial_status); $queuemetrics_eq_prepend = preg_replace('/[^-_0-9a-zA-Z]/','',$queuemetrics_eq_prepend); $vicidial_agent_disable = preg_replace('/[^-_0-9a-zA-Z]/','',$vicidial_agent_disable); $alter_custdata_override = preg_replace('/[^-_0-9a-zA-Z]/','',$alter_custdata_override); $list_order_mix = preg_replace('/[^-_0-9a-zA-Z]/','',$list_order_mix); $vcl_id = preg_replace('/[^-_0-9a-zA-Z]/','',$vcl_id); $mix_method = preg_replace('/[^-_0-9a-zA-Z]/','',$mix_method); $category = preg_replace('/[^-_0-9a-zA-Z]/','',$category); $vsc_id = preg_replace('/[^-_0-9a-zA-Z]/','',$vsc_id); $moh_context = preg_replace('/[^-_0-9a-zA-Z]/','',$moh_context); $source_campaign_id = preg_replace('/[^-_0-9a-zA-Z]/','',$source_campaign_id); $source_user_id = preg_replace('/[^-_0-9a-zA-Z]/','',$source_user_id); $source_group_id = preg_replace('/[^-_0-9a-zA-Z]/','',$source_group_id); $default_xfer_group = preg_replace('/[^-_0-9a-zA-Z]/','',$default_xfer_group); $drop_exten = preg_replace('/[^-_0-9a-zA-Z]/','',$drop_exten); $safe_harbor_exten = preg_replace('/[^-_0-9a-zA-Z]/','',$safe_harbor_exten); $drop_action = preg_replace('/[^-_0-9a-zA-Z]/','',$drop_action); $drop_inbound_group = preg_replace('/[^-_0-9a-zA-Z]/','',$drop_inbound_group); $afterhours_xfer_group = preg_replace('/[^-_0-9a-zA-Z]/','',$afterhours_xfer_group); $after_hours_action = preg_replace('/[^-_0-9a-zA-Z]/','',$after_hours_action); $alias_id = preg_replace('/[^-_0-9a-zA-Z]/','',$alias_id); $shift_id = preg_replace('/[^-_0-9a-zA-Z]/','',$shift_id); $qc_shift_id = preg_replace('/[^-_0-9a-zA-Z]/','',$qc_shift_id); $survey_method = preg_replace('/[^-_0-9a-zA-Z]/','',$survey_method); $alter_custphone_override = preg_replace('/[^-_0-9a-zA-Z]/','',$alter_custphone_override); $manual_dial_filter = preg_replace('/[^-_0-9a-zA-Z]/','',$manual_dial_filter); $agent_clipboard_copy = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_clipboard_copy); $hold_time_option = preg_replace('/[^-_0-9a-zA-Z]/','',$hold_time_option); $hold_time_option_xfer_group = preg_replace('/[^-_0-9a-zA-Z]/','',$hold_time_option_xfer_group); $hold_recall_xfer_group = preg_replace('/[^-_0-9a-zA-Z]/','',$hold_recall_xfer_group); $play_welcome_message = preg_replace('/[^-_0-9a-zA-Z]/','',$play_welcome_message); $did_route = preg_replace('/[^-_0-9a-zA-Z]/','',$did_route); $user_unavailable_action = preg_replace('/[^-_0-9a-zA-Z]/','',$user_unavailable_action); $user_route_settings_ingroup = preg_replace('/[^-_0-9a-zA-Z]/','',$user_route_settings_ingroup); $call_handle_method = preg_replace('/[^-_0-9a-zA-Z]/','',$call_handle_method); $agent_search_method = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_search_method); $hold_time_option_voicemail = preg_replace('/[^-_0-9a-zA-Z]/','',$hold_time_option_voicemail); $exten_context = preg_replace('/[^-_0-9a-zA-Z]/','',$exten_context); $three_way_call_cid = preg_replace('/[^-_0-9a-zA-Z]/','',$three_way_call_cid); $web_form_target = preg_replace('/[^-_0-9a-zA-Z]/','',$web_form_target); $recording_web_link = preg_replace('/[^-_0-9a-zA-Z]/','',$recording_web_link); $vtiger_search_category = preg_replace('/[^-_0-9a-zA-Z]/','',$vtiger_search_category); $vtiger_create_call_record = preg_replace('/[^-_0-9a-zA-Z]/','',$vtiger_create_call_record); $vtiger_create_lead_record = preg_replace('/[^-_0-9a-zA-Z]/','',$vtiger_create_lead_record); $vtiger_screen_login = preg_replace('/[^-_0-9a-zA-Z]/','',$vtiger_screen_login); $cpd_amd_action = preg_replace('/[^-_0-9a-zA-Z]/','',$cpd_amd_action); $template_id = preg_replace('/[^-_0-9a-zA-Z]/','',$template_id); $carrier_id = preg_replace('/[^-_0-9a-zA-Z]/','',$carrier_id); $source_carrier = preg_replace('/[^-_0-9a-zA-Z]/','',$source_carrier); $group_alias_id = preg_replace('/[^-_0-9a-zA-Z]/','',$group_alias_id); $default_group_alias = preg_replace('/[^-_0-9a-zA-Z]/','',$default_group_alias); $vtiger_search_dead = preg_replace('/[^-_0-9a-zA-Z]/','',$vtiger_search_dead); $menu_id = preg_replace('/[^-_0-9a-zA-Z]/','',$menu_id); $source_menu = preg_replace('/[^-_0-9a-zA-Z]/','',$source_menu); $call_time_id = preg_replace('/[^-_0-9a-zA-Z]/','',$call_time_id); $phone_context = preg_replace('/[^-_0-9a-zA-Z]/','',$phone_context); $conf_secret = preg_replace('/[^-_0-9a-zA-Z]/','',$conf_secret); $tracking_group = preg_replace('/[^-_0-9a-zA-Z]/','',$tracking_group); $no_agent_no_queue = preg_replace('/[^-_0-9a-zA-Z]/','',$no_agent_no_queue); $no_agent_action = preg_replace('/[^-_0-9a-zA-Z]/','',$no_agent_action); $quick_transfer_button = preg_replace('/[^-_0-9a-zA-Z]/','',$quick_transfer_button); $prepopulate_transfer_preset = preg_replace('/[^-_0-9a-zA-Z]/','',$prepopulate_transfer_preset); $tts_id = preg_replace('/[^-_0-9a-zA-Z]/','',$tts_id); $drop_rate_group = preg_replace('/[^-_0-9a-zA-Z]/','',$drop_rate_group); $agent_dial_owner_only = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_dial_owner_only); $reset_time = preg_replace('/[^-_0-9a-zA-Z]/','',$reset_time); $moh_id = preg_replace('/[^-_0-9a-zA-Z]/','',$moh_id); $drop_inbound_group_override = preg_replace('/[^-_0-9a-zA-Z]/','',$drop_inbound_group_override); $timer_action = preg_replace('/[^-_0-9a-zA-Z]/','',$timer_action); $record_call = preg_replace('/[^-_0-9a-zA-Z]/','',$record_call); $scheduled_callbacks_alert = preg_replace('/[^-_0-9a-zA-Z]/','',$scheduled_callbacks_alert); $extension_group_id = preg_replace('/[^-_0-9a-zA-Z]/','',$extension_group_id); $extension_group = preg_replace('/[^-_0-9a-zA-Z]/','',$extension_group); $scheduled_callbacks_count = preg_replace('/[^-_0-9a-zA-Z]/','',$scheduled_callbacks_count); $manual_dial_override = preg_replace('/[^-_0-9a-zA-Z]/','',$manual_dial_override); $blind_monitor_warning = preg_replace('/[^-_0-9a-zA-Z]/','',$blind_monitor_warning); $uniqueid_status_display = preg_replace('/[^-_0-9a-zA-Z]/','',$uniqueid_status_display); $hold_time_option_callmenu = preg_replace('/[^-_0-9a-zA-Z]/','',$hold_time_option_callmenu); $inbound_queue_no_dial = preg_replace('/[^-_0-9a-zA-Z]/','',$inbound_queue_no_dial); $hold_time_second_option = preg_replace('/[^-_0-9a-zA-Z]/','',$hold_time_second_option); $hold_time_third_option = preg_replace('/[^-_0-9a-zA-Z]/','',$hold_time_third_option); $wait_hold_option_priority = preg_replace('/[^-_0-9a-zA-Z]/','',$wait_hold_option_priority); $wait_time_option = preg_replace('/[^-_0-9a-zA-Z]/','',$wait_time_option); $wait_time_second_option = preg_replace('/[^-_0-9a-zA-Z]/','',$wait_time_second_option); $wait_time_third_option = preg_replace('/[^-_0-9a-zA-Z]/','',$wait_time_third_option); $wait_time_option_xfer_group = preg_replace('/[^-_0-9a-zA-Z]/','',$wait_time_option_xfer_group); $wait_time_option_callmenu = preg_replace('/[^-_0-9a-zA-Z]/','',$wait_time_option_callmenu); $wait_time_option_voicemail = preg_replace('/[^-_0-9a-zA-Z]/','',$wait_time_option_voicemail); $filter_phone_group_id = preg_replace('/[^-_0-9a-zA-Z]/','',$filter_phone_group_id); $filter_action = preg_replace('/[^-_0-9a-zA-Z]/','',$filter_action); $filter_user_unavailable_action = preg_replace('/[^-_0-9a-zA-Z]/','',$filter_user_unavailable_action); $filter_user_route_settings_ingroup = preg_replace('/[^-_0-9a-zA-Z]/','',$filter_user_route_settings_ingroup); $filter_agent_search_method = preg_replace('/[^-_0-9a-zA-Z]/','',$filter_agent_search_method); $filter_campaign_id = preg_replace('/[^-_0-9a-zA-Z]/','',$filter_campaign_id); $filter_group_id = preg_replace('/[^-_0-9a-zA-Z]/','',$filter_group_id); $filter_menu_id = preg_replace('/[^-_0-9a-zA-Z]/','',$filter_menu_id); $filter_call_handle_method = preg_replace('/[^-_0-9a-zA-Z]/','',$filter_call_handle_method); $filter_user = preg_replace('/[^-_0-9a-zA-Z]/','',$filter_user); $filter_exten_context = preg_replace('/[^-_0-9a-zA-Z]/','',$filter_exten_context); $webphone_systemkey = preg_replace('/[^-_0-9a-zA-Z]/','',$webphone_systemkey); $webphone_dialpad = preg_replace('/[^-_0-9a-zA-Z]/','',$webphone_dialpad); $webphone_systemkey_override = preg_replace('/[^-_0-9a-zA-Z]/','',$webphone_systemkey_override); $webphone_dialpad_override = preg_replace('/[^-_0-9a-zA-Z]/','',$webphone_dialpad_override); $default_phone_registration_password = preg_replace('/[^-_0-9a-zA-Z]/','',$default_phone_registration_password); $default_phone_login_password = preg_replace('/[^-_0-9a-zA-Z]/','',$default_phone_login_password); $default_server_password = preg_replace('/[^-_0-9a-zA-Z]/','',$default_server_password); $ivr_park_call = preg_replace('/[^-_0-9a-zA-Z]/','',$ivr_park_call); $manual_preview_dial = preg_replace('/[^-_0-9a-zA-Z]/','',$manual_preview_dial); $realtime_agent_time_stats = preg_replace('/[^-_0-9a-zA-Z]/','',$realtime_agent_time_stats); $api_manual_dial = preg_replace('/[^-_0-9a-zA-Z]/','',$api_manual_dial); $manual_dial_call_time_check = preg_replace('/[^-_0-9a-zA-Z]/','',$manual_dial_call_time_check); $lead_order_secondary = preg_replace('/[^-_0-9a-zA-Z]/','',$lead_order_secondary); $agent_lead_search = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_lead_search); $agent_lead_search_method = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_lead_search_method); $manual_dial_cid = preg_replace('/[^-_0-9a-zA-Z]/','',$manual_dial_cid); $post_phone_time_diff_alert = preg_replace('/[^-_0-9a-zA-Z]/','',$post_phone_time_diff_alert); $custom_3way_button_transfer = preg_replace('/[^-_0-9a-zA-Z]/','',$custom_3way_button_transfer); $available_only_tally_threshold_agents = preg_replace('/[^-_0-9a-zA-Z]/','',$available_only_tally_threshold_agents); $dial_level_threshold_agents = preg_replace('/[^-_0-9a-zA-Z]/','',$dial_level_threshold_agents); $time_zone_setting = preg_replace('/[^-_0-9a-zA-Z]/','',$time_zone_setting); $safe_harbor_menu_id = preg_replace('/[^-_0-9a-zA-Z]/','',$safe_harbor_menu_id); $survey_menu_id = preg_replace('/[^-_0-9a-zA-Z]/','',$survey_menu_id); $dl_diff_target_method = preg_replace('/[^-_0-9a-zA-Z]/','',$dl_diff_target_method); $disable_dispo_screen = preg_replace('/[^-_0-9a-zA-Z]/','',$disable_dispo_screen); $screen_labels = preg_replace('/[^-_0-9a-zA-Z]/','',$screen_labels); $label_hide_field_logs = preg_replace('/[^-_0-9a-zA-Z]/','',$label_hide_field_logs); $label_id = preg_replace('/[^-_0-9a-zA-Z]/','',$label_id); $status_display_fields = preg_replace('/[^-_0-9a-zA-Z]/','',$status_display_fields); $voicemail_timezone = preg_replace('/[^-_0-9a-zA-Z]/','',$voicemail_timezone); $default_voicemail_timezone = preg_replace('/[^-_0-9a-zA-Z]/','',$default_voicemail_timezone); $on_hook_cid = preg_replace('/[^-_0-9a-zA-Z]/','',$on_hook_cid); $pllb_grouping = preg_replace('/[^-_0-9a-zA-Z]/','',$pllb_grouping); $user_start = preg_replace('/[^-_0-9a-zA-Z]/','',$user_start); $drop_callmenu = preg_replace('/[^-_0-9a-zA-Z]/','',$drop_callmenu); $after_hours_callmenu = preg_replace('/[^-_0-9a-zA-Z]/','',$after_hours_callmenu); $survey_recording = preg_replace('/[^-_0-9a-zA-Z]/','',$survey_recording); $dtmf_field = preg_replace('/[^-_0-9a-zA-Z]/','',$dtmf_field); $preset_contact_search = preg_replace('/[^-_0-9a-zA-Z]/','',$preset_contact_search); $admin_hide_phone_data = preg_replace('/[^-_0-9a-zA-Z]/','',$admin_hide_phone_data); $max_calls_method = preg_replace('/[^-_0-9a-zA-Z]/','',$max_calls_method); $max_calls_action = preg_replace('/[^-_0-9a-zA-Z]/','',$max_calls_action); $in_group_dial = preg_replace('/[^-_0-9a-zA-Z]/','',$in_group_dial); $in_group_dial_select = preg_replace('/[^-_0-9a-zA-Z]/','',$in_group_dial_select); $queuemetrics_socket = preg_replace('/[^-_0-9a-zA-Z]/','',$queuemetrics_socket); $holiday_id = preg_replace('/[^-_0-9a-zA-Z]/','',$holiday_id); $holiday_date = preg_replace('/[^-_0-9a-zA-Z]/','',$holiday_date); $holiday_status = preg_replace('/[^-_0-9a-zA-Z]/','',$holiday_status); $expiration_date = preg_replace('/[^-_0-9a-zA-Z]/','',$expiration_date); $amd_inbound_group = preg_replace('/[^-_0-9a-zA-Z]/','',$amd_inbound_group); $amd_callmenu = preg_replace('/[^-_0-9a-zA-Z]/','',$amd_callmenu); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_timeout_prompt = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$menu_timeout_prompt); $menu_invalid_prompt = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$menu_invalid_prompt); $after_hours_message_filename = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$after_hours_message_filename); $welcome_message_filename = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$welcome_message_filename); $onhold_prompt_filename = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$onhold_prompt_filename); $hold_time_option_callback_filename = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$hold_time_option_callback_filename); $agent_alert_exten = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$agent_alert_exten); $filename = preg_replace('/[^-\/\._0-9a-zA-Z]/','',$filename); $am_message_exten = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$am_message_exten); $am_message_exten_override = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$am_message_exten_override); $campaign_groups = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$campaign_groups); $blind_monitor_filename = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$blind_monitor_filename); $hold_time_option_press_filename = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$hold_time_option_press_filename); $default_afterhours_filename_override = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$default_afterhours_filename_override); $sunday_afterhours_filename_override = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$sunday_afterhours_filename_override); $monday_afterhours_filename_override = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$monday_afterhours_filename_override); $tuesday_afterhours_filename_override = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$tuesday_afterhours_filename_override); $wednesday_afterhours_filename_override = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$wednesday_afterhours_filename_override); $thursday_afterhours_filename_override = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$thursday_afterhours_filename_override); $friday_afterhours_filename_override = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$friday_afterhours_filename_override); $saturday_afterhours_filename_override = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$saturday_afterhours_filename_override); $admin_web_directory = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$admin_web_directory); $tts_voice = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$tts_voice); $wait_time_option_callback_filename = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$wait_time_option_callback_filename); $wait_time_option_press_filename = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$wait_time_option_press_filename); $eht_minimum_prompt_filename = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$eht_minimum_prompt_filename); $queuemetrics_phone_environment = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$queuemetrics_phone_environment); $active_twin_server_ip = preg_replace('/[^-\|\/\._0-9a-zA-Z]/','',$active_twin_server_ip); $safe_harbor_audio = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$safe_harbor_audio); $alt_log_server_ip = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$alt_log_server_ip); $alt_log_dbname = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$alt_log_dbname); $alt_log_login = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$alt_log_login); $alt_log_pass = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$alt_log_pass); $survey_first_audio_file = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$survey_first_audio_file); $survey_opt_in_audio_file = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$survey_opt_in_audio_file); $survey_ni_audio_file = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$survey_ni_audio_file); $survey_third_audio_file = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$survey_third_audio_file); $survey_fourth_audio_file = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$survey_fourth_audio_file); $safe_harbor_audio_field = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$safe_harbor_audio_field); $voicemail_greeting = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$voicemail_greeting); ### ALPHA-NUMERIC and underscore and dash and slash and dot and comma $menu_prompt = preg_replace('/[^-\/\|\,\._0-9a-zA-Z]/','',$menu_prompt); ### ALPHA-NUMERIC and underscore and dash and comma $logins_list = preg_replace('/[^-\,\_0-9a-zA-Z]/','',$logins_list); $forced_timeclock_login = preg_replace('/[^-\,\_0-9a-zA-Z]/','',$forced_timeclock_login); $uniqueid_status_prefix = preg_replace('/[^-\,\_0-9a-zA-Z]/','',$uniqueid_status_prefix); ### ALPHA-NUMERIC and dots $sounds_web_server = preg_replace('/[^-\:\.0-9a-zA-Z]/','',$sounds_web_server); ### ALPHA-NUMERIC and spaces $lead_order = preg_replace('/[^ 0-9a-zA-Z]/','',$lead_order); ### ALPHA-NUMERIC and spaces and dashes and underscores $preset_name = preg_replace('/[^- \_0-9a-zA-Z]/','',$preset_name); ### ALPHA-NUMERIC and hash $group_color = preg_replace('/[^\#0-9a-zA-Z]/','',$group_color); ### ALPHA-NUMERIC and hash and star and dot and underscore $hold_time_option_exten = preg_replace('/[^\*\#\.\_0-9a-zA-Z]/','',$hold_time_option_exten); $did_pattern = preg_replace('/[^\+\*\#\.\_0-9a-zA-Z]/','',$did_pattern); $voicemail_ext = preg_replace('/[^\*\#\.\_0-9a-zA-Z]/','',$voicemail_ext); $phone = preg_replace('/[^\*\#\.\_0-9a-zA-Z]/','',$phone); $phone_code = preg_replace('/[^\*\#\.\_0-9a-zA-Z]/','',$phone_code); $wait_time_option_exten = preg_replace('/[^\*\#\.\_0-9a-zA-Z]/','',$wait_time_option_exten); $filter_voicemail_ext = preg_replace('/[^\*\#\.\_0-9a-zA-Z]/','',$filter_voicemail_ext); $filter_phone_code = preg_replace('/[^\*\#\.\_0-9a-zA-Z]/','',$filter_phone_code); $filter_phone = preg_replace('/[^\*\#\.\_0-9a-zA-Z]/','',$filter_phone); $preset_number = preg_replace('/[^\*\#\.\_0-9a-zA-Z]/','',$preset_number); ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores $adaptive_dl_diff_target = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$adaptive_dl_diff_target); $adaptive_intensity = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$adaptive_intensity); $asterisk_version = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$asterisk_version); $call_time_comments = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$call_time_comments); $call_time_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$call_time_name); $campaign_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$campaign_name); $campaign_rec_filename = preg_replace('/[^-\.\_0-9a-zA-Z]/','',$campaign_rec_filename); $ingroup_rec_filename = preg_replace('/[^-\.\_0-9a-zA-Z]/','',$ingroup_rec_filename); $company = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$company); $full_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$full_name); $fullname = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$fullname); $group_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$group_name); $HKstatus = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$HKstatus); $lead_filter_comments = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$lead_filter_comments); $lead_filter_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$lead_filter_name); $list_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$list_name); $local_gmt = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$local_gmt); $phone_type = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$phone_type); $picture = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$picture); $script_comments = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$script_comments); $script_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$script_name); $server_description = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$server_description); $status = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$status); $status_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$status_name); $wrapup_message = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$wrapup_message); $pause_code_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$pause_code_name); $campaign_description = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$campaign_description); $list_description = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$list_description); $vcl_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$vcl_name); $vsc_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$vsc_name); $vsc_description = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$vsc_description); $code_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$code_name); $alias_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$alias_name); $shift_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$shift_name); $did_description = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$did_description); $alt_server_ip = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$alt_server_ip); $template_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$template_name); $carrier_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$carrier_name); $group_alias_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$group_alias_name); $caller_id_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$caller_id_name); $user_code = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$user_code); $territory = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$territory); $tts_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$tts_name); $moh_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$moh_name); $timer_action_message = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$timer_action_message); $external_server_ip = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$external_server_ip); $default_codecs = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$default_codecs); $codecs_list = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$codecs_list); $label_title = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_title); $label_first_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_first_name); $label_middle_initial = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_middle_initial); $label_last_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_last_name); $label_address1 = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_address1); $label_address2 = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_address2); $label_address3 = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_address3); $label_city = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_city); $label_state = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_state); $label_province = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_province); $label_postal_code = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_postal_code); $label_vendor_lead_code = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_vendor_lead_code); $label_gender = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_gender); $label_phone_number = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_phone_number); $label_phone_code = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_phone_code); $label_alt_phone = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_alt_phone); $label_security_phrase = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_security_phrase); $label_email = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_email); $label_comments = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_comments); $slave_db_server = preg_replace('/[^- \.\,\:\_0-9a-zA-Z]/','',$slave_db_server); $filter_phone_group_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$filter_phone_group_name); $filter_phone_group_description = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$filter_phone_group_description); $filter_clean_cid_number = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$filter_clean_cid_number); $label_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$label_name); $default_local_gmt = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$default_local_gmt); $cid_description = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$cid_description); $description = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$description); $first_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$first_name); $last_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$last_name); $bu_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$bu_name); $department = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$department); $group = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$group); $job_title = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$job_title); $location = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$location); $holiday_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$holiday_name); $holiday_comments = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$holiday_comments); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$call_out_number_group); $client_browser = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$client_browser); $DBX_server = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$DBX_server); $DBY_server = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$DBY_server); $dtmf_send_extension = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$dtmf_send_extension); $install_directory = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$install_directory); $old_extension = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$old_extension); $telnet_host = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$telnet_host); $queuemetrics_dbname = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$queuemetrics_dbname); $queuemetrics_login = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$queuemetrics_login); $queuemetrics_pass = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$queuemetrics_pass); $email = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$email); $vtiger_dbname = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$vtiger_dbname); $vtiger_login = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$vtiger_login); $vtiger_pass = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$vtiger_pass); $custom_one = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$custom_one); $custom_two = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$custom_two); $custom_three = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$custom_three); $custom_four = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$custom_four); $custom_five = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$custom_five); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot and pound and star $extension = preg_replace('/[^-\*\#\.\:\/\@\_0-9a-zA-Z]/','',$extension); $timer_action_destination = preg_replace('/[^-\*\#\.\:\/\@\_0-9a-zA-Z]/','',$timer_action_destination); $filter_extension = preg_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 = preg_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 = preg_replace('/[^- \=\*\#\.\,\:\/\|\@\_0-9a-zA-Z]/','',$voicemail_options); ### NUMERIC and comma and pipe $waitforsilence_options = preg_replace('/[^\|\,0-9a-zA-Z]/','',$waitforsilence_options); ### value cleaning $no_agent_action_value = preg_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 = preg_replace('/[^- \:\/\_0-9a-zA-Z]/','',$vdc_header_date_format); $vdc_customer_date_format = preg_replace('/[^- \:\/\_0-9a-zA-Z]/','',$vdc_customer_date_format); $menu_name = preg_replace('/[^- \:\/\_0-9a-zA-Z]/','',$menu_name); ### ALPHA-NUMERIC and underscore and dash and at and space and parantheses $vdc_header_phone_format = preg_replace('/[^- \(\)\_0-9a-zA-Z]/', '',$vdc_header_phone_format); ### remove semi-colons ### $lead_filter_sql = preg_replace('/;/','',$lead_filter_sql); $list_mix_container = preg_replace('/;/','',$list_mix_container); $survey_response_digit_map = preg_replace('/;/','',$survey_response_digit_map); $survey_camp_record_dir = preg_replace('/;/','',$survey_camp_record_dir); $conf_override = preg_replace('/;/','',$conf_override); $template_contents = preg_replace('/;/','',$template_contents); $registration_string = preg_replace('/;/','',$registration_string); $account_entry = preg_replace('/;/','',$account_entry); $account_entry = preg_replace('/\r/', '',$account_entry); $globals_string = preg_replace('/;/','',$globals_string); $dialplan_entry = preg_replace('/;/','',$dialplan_entry); $dialplan_entry = preg_replace('/\r/', '',$dialplan_entry); $custom_dialplan_entry = preg_replace('/\\\\/', '',$custom_dialplan_entry); $custom_dialplan_entry = preg_replace('/\'/', '',$custom_dialplan_entry); $custom_dialplan_entry = preg_replace('/\r/', '',$custom_dialplan_entry); $tts_text = preg_replace('/\\\\/', '',$tts_text); $tts_text = preg_replace('/;/','',$tts_text); $tts_text = preg_replace('/\r/', '',$tts_text); $tts_text = preg_replace('/\"/', '',$tts_text); $carrier_description = preg_replace('/\\\\/', '',$carrier_description); $carrier_description = preg_replace('/;/','',$carrier_description); $carrier_description = preg_replace('/\r/', '',$carrier_description); $carrier_description = preg_replace('/\"/', '',$carrier_description); $blind_monitor_message = preg_replace('/\\\\/', '',$blind_monitor_message); $blind_monitor_message = preg_replace('/;/','',$blind_monitor_message); $blind_monitor_message = preg_replace('/\r/', '',$blind_monitor_message); $blind_monitor_message = preg_replace('/\"/', '',$blind_monitor_message); $modify_url = preg_replace('/\\\\/', '',$modify_url); $modify_url = preg_replace('/;/','',$modify_url); $modify_url = preg_replace('/\r/', '',$modify_url); $modify_url = preg_replace('/\"/', '',$modify_url); $qualify_sql = preg_replace('/\\\\/', '',$qualify_sql); $qualify_sql = preg_replace('/;/','',$qualify_sql); $qualify_sql = preg_replace('/\r/', '',$qualify_sql); $qualify_sql = preg_replace('/\'/', "\"",$qualify_sql); $queuemetrics_socket_url = preg_replace('/\\\\/', '',$queuemetrics_socket_url); $queuemetrics_socket_url = preg_replace('/;/','',$queuemetrics_socket_url); $queuemetrics_socket_url = preg_replace('/\r/', '',$queuemetrics_socket_url); $queuemetrics_socket_url = preg_replace('/\'/', "\"",$queuemetrics_socket_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 # $na_call_url ### VARIABLES not filtered at all ### # $script_text } # end of non_latin else { $PHP_AUTH_PW = preg_replace('/\'|\"|\\\\|;/', '',$PHP_AUTH_PW); $PHP_AUTH_USER = preg_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 # 110731-0245 - Added na_call_url options to campaigns and in-groups # 110801-0833 - Added on_hook_cid option for in-groups # 110802-2053 - Added links to Team Performance Detail Report # 110809-1547 - Added no-answer log and alt-log server system settings # 110815-2155 - Added the Campaign Status List Report # 110822-1204 - Added did_agent_log System Settings option # 110829-1600 - Added multiple invalid option to Call Menus # 110829-2129 - Added survey recording option # 110831-2038 - Added Campaign Areacode CID features # 110920-1344 - Added pllb_grouping_limit settings # 110922-1218 - Added new User admin permissions, Added DID Remote Agent extension override section # 110923-0834 - Added option for in-group action transfer cid, and CALLMENU as drop and after-hours action options # 110923-2043 - Added custom DID fields # 111004-1539 - Added dtmf_field call menu option # 111006-1403 - Added several new campaign and other options, call_count_limit, status flag, shift report flag, etc... # 111015-1914 - Added Preset Contact Search options # 111018-1535 - Added more contact fields # 111021-1646 - Added callback_hours_block option # 111024-1234 - Added callback_list_calltime option # 111025-0728 - Added user group to all sections, more user settings # 111102-1930 - Added in-group max_calls_ options # 111106-1116 - Many fixes for user_group restrictions # 111116-0207 - Added ALT and ADDR3 in-group handle methods # 111122-1333 - Added Inbound Daily Report # 111201-0939 - Added graded-random next-agent-call option # 111223-0043 - Added max stats displays for in-groups and , fixed several ereg issues # 111227-1938 - Added Timer Action for Dx_DIAL_QUIET options # 120102-2125 - Added Dialer Inventory Report # 120104-2024 - Changed copyright dates, other small fixes # 120118-2113 - Fixed bugs in phone alias and conf template updates # 120125-1234 - Added Maximum System Stats report and permissions for it and Max Stats Detail report # 120125-2107 - Added User Group Active User In-Group Select function to User Group page # 120207-1955 - Added List territory reset function # 120213-1512 - Added remote agent max stats display and campaign VLC hopper dup check option # 120221-0054 - Fixed Call Time and User Group restrictions on several pages # 120221-1647 - Added inventory report options to lists and shifts # 120316-1203 - Fixed DIALBLE counts for completed statuses # 120402-2111 - Added lead loading template and two carrier log reports to the admin utils page # 120409-1136 - Added Search Leads Logs as slave db option # 120420-1620 - Forked 2.4 to branches, changing trunk to 2.6 # 120512-0844 - Added In-Group Manual Dial options to campaign screen # 120514-0936 - Added Dial In-group CID override setting # 120518-1456 - Added XFTAMM/LTMG special hotkeys for send to answering machine message # 120526-0827 - Added User Group User Login Report # 120529-2112 - Added safe_harbor_audio_field campaign option # 120706-1255 - Added Max stats date range and call menu qualify_sql options # 120713-2123 - Added max stats download link and extended_vl option # 120810-1018 - Added Admin List Counts system settings option # 120820-1104 - Added is_webphone option Y_API_LAUNCH # 120831-1523 - Added vicidial_dial_log outbound call logging # 121018-2321 - Added blank option to owner only dialing # 121019-0520 - Added voicemail greeting audio chooser options to phones and voicemail boxes # 121025-2339 - Added without-filter output to test filter function, added server option to test call # 121027-2344 - Added servers versions page # 121029-0109 - Added pause_after_next_call and owner_populate campaign options # 121114-1923 - Added Basic Lead Management page link. Added INGROUP as a recording filename option # 121116-1410 - Added QC functionality # 121120-0824 - Added queuemetrics_socket functionality to system settings # 121123-1208 - Added inbound holiday functions # 121124-1957 - Added List Expiration Date feature and Campaign Other-DNC-List feature # 121129-2319 - Added enhanced_disconnect_logging option # 121130-1425 - Fixed user group permissions issue with allowed campaigns modifications of user groups # 121205-1619 - Added parentheses around filter SQL when in SQL queries # 121206-0630 - Added inbound lead search feature # 121212-1529 - Standardization of list_id fields at 19 digits in forms # 121222-2146 - Added new email features # 130102-1135 - Small change to admin log viewing for email accounts # 130124-1721 - Added Inbound Email report link, added Status Display LEADID options(issue #639) # 130130-1207 - Added new CPD AMD options for In-Groups and CallMenus # 130221-1736 - Added Level 8 Disable Add option to system settings and new Email Log Report link, DID exten made non-editable # 130402-2322 - Added user_group script variable # 130414-1924 - Added report logging and display # 130424-1601 - Added survey_wait_sec campaign survey option # 130425-0700 - Added DROP option for survey_no_response_action to go to campaign drop method # 130503-1509 - Added red color to server table on reports page if asterisk out of sync # 130508-2306 - Branched 2.7, trunk becomes 2.8 # 130510-1350 - Added outbound state call time holidays functionality # 130605-0841 - Converted ereg to preg # - Added display of agent login information on User Modify screen, and reset of failed_logins on update # 130615-2124 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes # 130627-0745 - Added url log, lagged log and user group login reports to admin utilities page # 130709-1350 - Changes for encrypted password compatibility, added Dial Log Report # 130711-2208 - Added SYSTEM SNAPSHOT STATS as new welcome screen, and added new # 130809-1410 - Small fixes for call times and holidays # 130824-2319 - Changed to mysqli PHP functions # 130915-0045 - Added counts for new nanpa prefix type tables # 130926-1731 - Added queuemetrics_record_hold system setting # 130928-1130 - Added country_code_list_stats system setting option # 131003-1749 - Small fix for voicemail box duplication with phone account # 131007-1234 - Fix for copy user on encrypted passwords systems # 131016-2112 - Added manual_dial_lead_id campaign option, fixes some small issues # 131019-0849 - Moved help section to help.php # 131029-2008 - Added Asterisk auto-restart options to servers # 131208-1626 - Added campaign options for max dead, dispo and pause time # 131210-1741 - Added ability to define slave server with port number, issue #687 # 140108-0752 - Added webserver and hostname to report logging # 140117-0840 - Added option for Lists Pass Report # 140126-0939 - Added VMAIL_NO_INST options # # 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.8-423a'; $build = '140126-0939'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); $REPORTdate = date("Y-m-d"); $EXPtestdate = date("Ymd"); $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'; $add_copy_disabled=0; $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'; $dtmf[19]='INVALID_2ND'; $dtmf_key[19]='INVALID_2ND'; $dtmf[20]='INVALID_3RD'; $dtmf_key[20]='INVALID_3RD'; if ($force_logout) { if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) { Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\""); Header("HTTP/1.0 401 Unauthorized"); } echo "You have now logged out. Thank you\n
To log back in, click here"; 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,webroot_writable,allow_emails FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysqli_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysqli_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]; $SSwebroot_writable = $row[7]; $SSemail_enabled = $row[8]; } ##### END SETTINGS LOOKUP ##### ########################################### $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); $user_auth=0; $auth=0; $reports_auth=0; $qc_auth=0; $auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1); if ($auth_message == 'GOOD') {$user_auth=1;} if ($user_auth > 0) { $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 7;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 6 and view_reports > 0;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $reports_auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 1 and qc_enabled > 0;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $qc_auth=$row[0]; $reports_only_user=0; $qc_only_user=0; if ( ($reports_auth > 0) and ($auth < 1) ) { $ADD=999999; $reports_only_user=1; } if ( ($qc_auth > 0) and ($reports_auth < 1) and ($auth < 1) ) { if ( ($ADD != '881') and ($ADD != '100000000000000') ) { $ADD=100000000000000; } $qc_only_user=1; } if ( ($qc_auth < 1) and ($reports_auth < 1) and ($auth < 1) ) { $VDdisplayMESSAGE = "You do not have permission to be here"; Header ("Content-type: text/html; charset=utf-8"); echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n"; exit; } } else { $VDdisplayMESSAGE = "Login incorrect, please try again"; if ($auth_message == 'LOCK') { $VDdisplayMESSAGE = "Too many login attempts, try again in 15 minutes"; Header ("Content-type: text/html; charset=utf-8"); echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n"; exit; } Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\""); Header("HTTP/1.0 401 Unauthorized"); echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$PHP_AUTH_PW|$auth_message|\n"; exit; } ############################################## # Include QC Agents with no other permission # ############################################## require_once('qc/QC_admin_include02.php'); $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,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,modify_contacts,modify_same_user_level from vicidial_users where user='$PHP_AUTH_USER';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $LOGmodify_shifts =$row[72]; $LOGmodify_phones =$row[73]; $LOGmodify_carriers =$row[74]; $LOGmodify_labels =$row[75]; $LOGmodify_statuses =$row[76]; $LOGmodify_voicemail =$row[77]; $LOGmodify_audiostore =$row[78]; $LOGmodify_moh =$row[79]; $LOGmodify_tts =$row[80]; $LOGmodify_contacts =$row[81]; $LOGmodify_same_user_level =$row[82]; $stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $LOGallowed_campaigns = $row[0]; $LOGallowed_reports = $row[1]; $LOGadmin_viewable_groups = $row[2]; $LOGadmin_viewable_call_times = $row[3]; $LOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL=''; if ( (!preg_match('/\-ALL/i', $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 "; $admin_viewable_groupsALL=0; $LOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL=''; $valLOGadmin_viewable_groupsSQL=''; $vmLOGadmin_viewable_groupsSQL=''; if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) { $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $LOGadmin_viewable_groupsSQL = "and user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; $whereLOGadmin_viewable_groupsSQL = "where user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; $valLOGadmin_viewable_groupsSQL = "and val.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; $vmLOGadmin_viewable_groupsSQL = "and vm.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; } else {$admin_viewable_groupsALL=1;} $regexLOGadmin_viewable_groups = " $LOGadmin_viewable_groups "; $LOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL=''; if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) { $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $LOGadmin_viewable_call_timesSQL = "and call_time_id IN('---ALL---','$rawLOGadmin_viewable_call_timesSQL')"; $whereLOGadmin_viewable_call_timesSQL = "where call_time_id IN('---ALL---','$rawLOGadmin_viewable_call_timesSQL')"; } $regexLOGadmin_viewable_call_times = " $LOGadmin_viewable_call_times "; $UUgroups_list=''; if ($admin_viewable_groupsALL > 0) {$UUgroups_list .= "\n";} $stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_to_mysqli($stmt, $link); $UUgroups_to_print = mysqli_num_rows($rslt); $o=0; while ($UUgroups_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $UUgroups_list .= "\n"; $o++; } $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; } if (($LOGuser_level < 9) and ($SSlevel_8_disable_add > 0)) {$add_copy_disabled++;} if ($download_max_system_stats_metric_name) { if (!$query_date) {$query_date=date("Y-m-d", time()-(29*86400));} if (!$end_date) { $end_date=date("Y-m-d", time()); } else if (strtotime($end_date)>strtotime(date("Y-m-d"))) { $end_date=date("Y-m-d"); } if ($query_date>$end_date) {$query_date=$end_date;} $num_graph_days = ceil(abs(strtotime($end_date) - strtotime($query_date)) / 86400)+1; $CSV_text=""; if ($download_max_system_stats_metric_name=="ALL" || $download_max_system_stats_metric_name=="total call count in and out") { download_max_system_stats($campaign_id,$num_graph_days,'system','total_calls','total call count in and out',$end_date); } if ($download_max_system_stats_metric_name=="ALL" || $download_max_system_stats_metric_name=="total inbound call count") { download_max_system_stats($campaign_id,$num_graph_days,'system','total_calls_inbound_all','total inbound call count',$end_date); } if ($download_max_system_stats_metric_name=="ALL" || $download_max_system_stats_metric_name=="total outbound call count") { download_max_system_stats($campaign_id,$num_graph_days,'system','total_calls_outbound_all','total outbound call count',$end_date); } if ($download_max_system_stats_metric_name=="ALL" || $download_max_system_stats_metric_name=="most concurrent calls in and out") { download_max_system_stats($campaign_id,$num_graph_days,'system','(max_inbound + max_outbound)','most concurrent calls in and out',$end_date); } if ($download_max_system_stats_metric_name=="ALL" || $download_max_system_stats_metric_name=="most concurrent calls inbound total") { download_max_system_stats($campaign_id,$num_graph_days,'system','max_inbound','most concurrent calls inbound total',$end_date); } if ($download_max_system_stats_metric_name=="ALL" || $download_max_system_stats_metric_name=="most concurrent calls outbound total") { download_max_system_stats($campaign_id,$num_graph_days,'system','max_outbound','most concurrent calls outbound total',$end_date); } if ($download_max_system_stats_metric_name=="ALL" || $download_max_system_stats_metric_name=="most concurrent agents") { download_max_system_stats($campaign_id,$num_graph_days,'system','max_agents','most concurrent agents',$end_date); } $FILE_TIME = date("Ymd-His"); $CSVfilename = "MAX_SYSTEM_STATS_$US$FILE_TIME.csv"; $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); $CSV_text=preg_replace('/\" +/', '"', $CSV_text); header('Content-type: application/octet-stream'); header("Content-Disposition: attachment; filename=\"$CSVfilename\""); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); ob_clean(); flush(); echo "$CSV_text"; exit; } ###################################################################################################### ###################################################################################################### ####### 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 "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSnocache_admin=='1') { echo "\n"; echo "\n"; echo "\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 "\n"; } echo "ADMINISTRATION: "; ### set the default screen to the user list if ( (!isset($ADD)) or (strlen($ADD)<1) ) {$ADD="999990";} if ($ADD=='0') {$ADD="999990";} ### set the sections and headers 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==1811) {$hh='ingroups'; echo "Add New EMAIL In-Group";} if ($ADD==1911) {$hh='ingroups'; echo "Copy EMAIL In-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==1211111111) {$hh='admin'; $sh='times'; echo "Add Holiday";} 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==191111111111) {$hh='admin'; $sh='cts'; echo "ADD NEW CONTACT";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW CONFERENCE";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW AGENT 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==202) {$hh='campaigns'; $sh='accid'; echo "Campaign Areacode CID Modify";} 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==2811) {$hh='ingroups'; echo "New Email Group Addition";} if ($ADD==2911) {$hh='ingroups'; echo "New Copied Email Group Addition";} 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==2211111111) {$hh='admin'; $sh='times'; echo "New Holiday 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 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==291111111111) {$hh='admin'; $sh='cts'; echo "ADDING NEW CONTACT";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW CONFERENCE";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW AGENT CONFERENCE";} if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "ADDING SYSTEM STATUSES";} if ($ADD==231111111111111) {$hh='admin'; $sh='status'; echo "ADDING STATUS CATEGORY";} if ($ADD==241111111111111) {$hh='admin'; $sh='status'; echo "ADDING 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 ($SUB==202) {echo " - AC-CID";} } 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 ($SUB==202) {echo " - AC-CID";} } 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==302) {$hh='campaigns'; $sh='accid'; echo "Campaign Areacode CID";} 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==3321) {$hh='ingroups'; echo "Modify DID RA Extension Overrides";} if ($ADD==3511) {$hh='ingroups'; echo "Modify Call Menu";} if ($ADD==3711) {$hh='ingroups'; echo "Modify Filter Phone Group";} if ($ADD==3811) {$hh='ingroups'; echo "Modify EMAIL In-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==322111111) {$hh='admin'; $sh='times'; echo "Modify Call Time State Holiday";} if ($ADD==331111111) {$hh='admin'; $sh='shifts'; echo "Modify Shift";} if ($ADD==3111111111) {$hh='admin'; $sh='times'; echo "Modify State Call Time";} if ($ADD==3211111111) {$hh='admin'; $sh='times'; echo "Modify Holiday";} 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==391111111111) {$hh='admin'; $sh='cts'; echo "MODIFY CONTACT";} if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY CONFERENCE";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY AGENT CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "MODIFY SYSTEM SETTINGS";} if ($ADD==321111111111111) {$hh='admin'; $sh='status'; echo "MODIFY SYSTEM STATUSES";} if ($ADD==331111111111111) {$hh='admin'; $sh='status'; echo "MODIFY STATUS CATEGORY";} if ($ADD==341111111111111) {$hh='admin'; $sh='status'; echo "MODIFY 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==4811) {$hh='ingroups'; echo "Modify Email In-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==4211111111) {$hh='admin'; $sh='times'; echo "Modify Holiday";} 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 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==491111111111) {$hh='admin'; $sh='cts'; echo "MODIFY CONTACT";} if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY CONFERENCE";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "MODIFY SYSTEM SETTINGS";} if ($ADD==421111111111111) {$hh='admin'; $sh='status'; echo "MODIFY SYSTEM STATUSES";} if ($ADD==431111111111111) {$hh='admin'; $sh='status'; echo "MODIFY STATUS CATEGORIES";} if ($ADD==441111111111111) {$hh='admin'; $sh='status'; echo "MODIFY 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==5211111111) {$hh='admin'; $sh='times'; echo "Delete Holiday";} 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==591111111111) {$hh='admin'; $sh='cts'; echo "DELETE CONTACT";} if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo "DELETE AGENT 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==6211111111) {$hh='admin'; $sh='times'; echo "Delete Holiday";} 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 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==691111111111) {$hh='admin'; $sh='cts'; echo "DELETE CONTACT";} if ($ADD==6111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==61111111111111) {$hh='admin'; $sh='conference'; echo "DELETE AGENT CONFERENCE";} if ($ADD==73) {$hh='campaigns'; echo "Dialable Lead Count";} if ($ADD==7111111) {$hh='scripts'; echo "Preview Script";} if ($ADD==700000000000000) {$hh='reports'; echo "ADMIN CHANGE LOG";} if ($ADD==710000000000000) {$hh='reports'; echo "USER ADMIN CHANGE LOG";} if ($ADD==720000000000000) {$hh='reports'; echo "SECTION ADMIN CHANGE LOG";} if ($ADD==730000000000000) {$hh='reports'; echo "DETAIL ADMIN CHANGE LOG";} if ($ADD==800000000000000) {$hh='reports'; echo "ADMIN REPORT LOG";} if ($ADD==810000000000000) {$hh='reports'; echo "USER ADMIN REPORT LOG";} if ($ADD==830000000000000) {$hh='reports'; echo "DETAIL ADMIN REPORT LOG";} if ($ADD=="0A") {$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==1320) {$hh='ingroups'; echo "Modify DID RA Extension Overrides";} if ($ADD==1500) {$hh='ingroups'; echo "Call Menus";} if ($ADD==1700) {$hh='ingroups'; echo "Filter Phone Groups";} if ($ADD==1800) {$hh='ingroups'; echo "Email In-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==1200000000) {$hh='admin'; $sh='times'; echo "Holidays";} 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==190000000000) {$hh='admin'; $sh='cts'; echo "CONTACTS LIST";} if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "CONFERENCE LIST";} if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "AGENT CONFERENCE LIST";} ##QC require_once('qc/QC_admin_variables01.php'); 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==999993) {$hh='reports'; echo "SUMMARY STATS";} if ($ADD==999992) {$hh='reports'; echo "SYSTEM SUMMARY STATS";} if ($ADD==999991) {$hh='reports'; echo "SERVERS VERSIONS";} if ($ADD==999990) {$hh='reports'; echo "SYSTEM SNAPSHOT STATS";} if ( ($ADD==999993) or ($ADD==999992) or ($ADD==730000000000000) or ($ADD==830000000000000) ) { if ($ADD==999993) {$report_name = "SUMMARY STATS";} if ($ADD==999992) {$report_name = "SYSTEM SUMMARY STATS";} if ($ADD==730000000000000) {$report_name = "DETAIL ADMIN CHANGE LOG";} if ($ADD==830000000000000) {$report_name = "DETAIL ADMIN REPORT LOG";} ##### BEGIN log visit to the vicidial_report_log table ##### $LOGip = getenv("REMOTE_ADDR"); $LOGbrowser = getenv("HTTP_USER_AGENT"); $LOGscript_name = getenv("SCRIPT_NAME"); $LOGserver_name = getenv("SERVER_NAME"); $LOGserver_port = getenv("SERVER_PORT"); $LOGrequest_uri = getenv("REQUEST_URI"); $LOGhttp_referer = getenv("HTTP_REFERER"); if (preg_match("/443/i",$LOGserver_port)) {$HTTPprotocol = 'https://';} else {$HTTPprotocol = 'http://';} if (($LOGserver_port == '80') or ($LOGserver_port == '443') ) {$LOGserver_port='';} else {$LOGserver_port = ":$LOGserver_port";} $LOGfull_url = "$HTTPprotocol$LOGserver_name$LOGserver_port$LOGrequest_uri"; $LOGhostname = php_uname('n'); if (strlen($LOGhostname)<1) {$LOGhostname='X';} if (strlen($LOGserver_name)<1) {$LOGserver_name='X';} $stmt="SELECT webserver_id FROM vicidial_webservers where webserver='$LOGserver_name' and hostname='$LOGhostname' LIMIT 1;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $webserver_id_ct = mysqli_num_rows($rslt); if ($webserver_id_ct > 0) { $row=mysqli_fetch_row($rslt); $webserver_id = $row[0]; } else { ##### insert webserver entry $stmt="INSERT INTO vicidial_webservers (webserver,hostname) values('$LOGserver_name','$LOGhostname');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $affected_rows = mysqli_affected_rows($link); $webserver_id = mysqli_insert_id($link); } $stmt="INSERT INTO vicidial_report_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$LOGip', report_name='$report_name', browser='$LOGbrowser', referer='$LOGhttp_referer', notes='$LOGserver_name:$LOGserver_port $LOGscript_name |$group, $query_date, $end_date, $shift, $stage, $report_display_type|', url='$LOGfull_url', webserver='$webserver_id';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $report_log_id = mysqli_insert_id($link); ##### END log visit to the vicidial_report_log table ##### } if ( ($ADD>9) and ($ADD < 99998) ) { ##### get scripts listing for dynamic pulldown $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_to_mysqli($stmt, $link); $scripts_to_print = mysqli_num_rows($rslt); $scripts_list="<option value=\"\">NONE</option>\n"; $o=0; while ($scripts_to_print > $o) { $rowx=mysqli_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 $whereLOGadmin_viewable_groupsSQL order by lead_filter_id;"; $rslt=mysql_to_mysqli($stmt, $link); $filters_to_print = mysqli_num_rows($rslt); $filters_list="<option value=\"\">NONE</option>\n"; $o=0; while ($filters_to_print > $o) { $rowx=mysqli_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 $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; $rslt=mysql_to_mysqli($stmt, $link); $times_to_print = mysqli_num_rows($rslt); $o=0; while ($times_to_print > $o) { $rowx=mysqli_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_to_mysqli($stmt, $link); $campaigns_to_print = mysqli_num_rows($rslt); $campaigns_list=''; $campaigns_value=''; $RANKcampaigns_list="<tr><td>CAMPAIGN</td><td>     RANK</td><td>     GRADE</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; $o=0; while ($campaigns_to_print > $o) { $rowx=mysqli_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,campaign_grade from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $ranks_to_print = mysqli_num_rows($rslt); if ($ranks_to_print > 0) { $row=mysqli_fetch_row($rslt); $SELECT_campaign_rank = $row[0]; $calls_today = $row[1]; $group_web_vars = $row[2]; $SELECT_campaign_grade = $row[3]; } else {$calls_today=0; $SELECT_campaign_rank=0; $SELECT_campaign_grade=1; $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 (isset($_GET["GRADE_$campaign_id_values[$o]"])) {$campaign_grade=$_GET["GRADE_$campaign_id_values[$o]"];} elseif (isset($_POST["GRADE_$campaign_id_values[$o]"])) {$campaign_grade=$_POST["GRADE_$campaign_id_values[$o]"];} if ($non_latin < 1) { $campaign_rank = preg_replace('/[^-\_0-9]/','',$campaign_rank); $campaign_web = preg_replace("/;|\"|\'/","",$campaign_web); $campaign_grade = preg_replace('/[^-\_0-9]/','',$campaign_grade); } if ($ranks_to_print > 0) { $stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', group_web_vars='$campaign_web',campaign_grade='$campaign_grade' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_to_mysqli($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',campaign_grade='$campaign_grade';"; $rslt=mysql_to_mysqli($stmt, $link); $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank',campaign_grade='$campaign_grade' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_to_mysqli($stmt, $link); $stmt_grp_values .= "$stmt|"; } else { $campaign_rank = $SELECT_campaign_rank; $campaign_grade = $SELECT_campaign_grade; } if (preg_match('/1$|3$|5$|7$|9$/i', $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' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $Ruser_group = $row[0]; $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $allowed_campaigns = $row[0]; $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); $UGcampaigns = explode(" ", $allowed_campaigns); $p=0; $RANK_camp_active=0; $GRADE_camp_active=0; $CR_disabled = ''; if (preg_match('/\-ALL\-CAMPAIGNS\-/i',$allowed_campaigns)) {$RANK_camp_active++; $GRADE_camp_active++;} else { $UGcampaign_ct = count($UGcampaigns); while ($p < $UGcampaign_ct) { if ($campaign_id_values[$o] == $UGcampaigns[$p]) {$RANK_camp_active++; $GRADE_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>   <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>   <select size=1 name=GRADE_$campaign_id_values[$o] $CR_disabled>\n"; $h="10"; while ($h>=1) { $RANKcampaigns_list .= "<option value=\"$h\""; if ($h==$campaign_grade) {$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>     $calls_today</td>\n"; $RANKcampaigns_list .= "<td>     <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 ( (preg_match('/list_activation/i', $stage)) or (preg_match('/test_call/',$stage)) ) ) ) { $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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_to_mysqli($stmt, $link); $row=mysqli_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' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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 $whereLOGadmin_viewable_groupsSQL 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_to_mysqli($stmt, $link); $groups_to_print = mysqli_num_rows($rslt); $groups_list=''; $groups_value=''; $XFERgroups_list=''; $RANKgroups_list="<tr><td>INBOUND GROUP</td><td>     RANK</td><td>     GRADE</td><td>     CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n"; $o=0; while ($groups_to_print > $o) { $rowx=mysqli_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,group_grade from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]';"; $rslt=mysql_to_mysqli($stmt, $link); $ranks_to_print = mysqli_num_rows($rslt); if ($ranks_to_print > 0) { $row=mysqli_fetch_row($rslt); $SELECT_group_rank = $row[0]; $calls_today = $row[1]; $group_web_vars = $row[2]; $SELECT_group_grade = $row[3]; } else {$calls_today=0; $SELECT_group_rank=0; $SELECT_group_grade=1;} 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 (isset($_GET["GRADE_$group_id_values[$o]"])) {$group_grade=$_GET["GRADE_$group_id_values[$o]"];} elseif (isset($_POST["GRADE_$group_id_values[$o]"])) {$group_grade=$_POST["GRADE_$group_id_values[$o]"];} if ($non_latin < 1) { $group_rank = preg_replace('/[^-\_0-9]/','',$group_rank); $group_web = preg_replace("/;|\"|\'/","",$group_web); $group_grade = preg_replace('/[^-\_0-9]/','',$group_grade); } 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', group_grade='$group_grade' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_to_mysqli($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', group_grade='$group_grade';"; $rslt=mysql_to_mysqli($stmt, $link); $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank', group_grade='$group_grade' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_to_mysqli($stmt, $link); $stmt_grp_values .= "$stmt|"; } else { $group_rank = $SELECT_group_rank; $group_grade = $SELECT_group_grade; } if (preg_match('/1$|3$|5$|7$|9$/i', $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]' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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>   <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>   <select size=1 name=GRADE_$group_id_values[$o]>\n"; $h="10"; while ($h>=1) { $RANKgroups_list .= "<option value=\"$h\""; if ($h==$group_grade) {$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>     $calls_today</td>\n"; $RANKgroups_list .= "<td>     <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' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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=''; if ( (preg_match('/\-ALL/i', $LOGallowed_campaigns)) ) {$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 (preg_match('/ALL\-CAMPAIGNS/i',$campaigns[$p])) { if ( (preg_match('/\-ALL/i', $LOGallowed_campaigns)) ) { $campaigns_list.=" CHECKED"; $campaigns_value .= " -ALL-CAMPAIGNS-"; } } if (preg_match('/ALL\-CAMPAIGNS/i',$qc_campaigns[$p])) { $qc_campaigns_list.=" CHECKED"; $qc_campaigns_value .= " -ALL-CAMPAIGNS-"; } if (preg_match('/ALL\-GROUPS/i',$qc_groups[$p])) { $qc_groups_list.=" CHECKED"; $qc_groups_value .= " -ALL-GROUPS-"; } $p++; } if ( (preg_match('/\-ALL/i', $LOGallowed_campaigns)) ) {$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_to_mysqli($stmt, $link); $campaigns_to_print = mysqli_num_rows($rslt); $o=0; while ($campaigns_to_print > $o) { $rowx=mysqli_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') $LOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_to_mysqli($stmt, $link); $groups_to_print = mysqli_num_rows($rslt); $o=0; while ($groups_to_print > $o) { $rowx=mysqli_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_to_mysqli($stmt, $link); $servers_to_print = mysqli_num_rows($rsltx); $servers_list=''; $o=0; while ($servers_to_print > $o) { $rowx=mysqli_fetch_row($rsltx); $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1] - $rowx[2]</option>\n"; $o++; } } $NWB = "   <a href=\"javascript:openNewWindow('help.php"; $NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; if ($ADD==99999) { echo"<TITLE>Help Redirect\n"; echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"click here to continue. . .\n"; exit; } ###################################################################################################### ###################################################################################################### ####### 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 "\n"; echo "\n"; echo "\n"; echo ""; $stmt="SELECT dial_statuses,local_call_time,lead_filter_id,drop_lockout_time,call_count_limit from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $dial_statuses = $row[0]; $local_call_time = $row[1]; $drop_lockout_time = $row[3]; $call_count_limit = $row[4]; 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' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $lists_to_print = mysqli_num_rows($rslt); $camp_lists=''; $o=0; while ($lists_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $o++; if (preg_match('/Y/', $rowx[1])) {$camp_lists .= "'$rowx[0]',";} } $camp_lists = preg_replace('/.$/i','',$camp_lists);; $filterSQL = $filtersql_list[$lead_filter_id]; $filterSQL = preg_replace("/\\\\/","",$filterSQL); $filterSQL = preg_replace('/^and|and$|^or|or$/i', '',$filterSQL); if (strlen($filterSQL)>4) {$fSQL = "and ($filterSQL)";} else {$fSQL = '';} echo "

\n"; echo "Show Dialable Leads Count -

\n"; echo "CAMPAIGN: $campaign_id
\n"; echo "LISTS: $camp_lists
\n"; echo "STATUSES: $dial_statuses
\n"; echo "FILTER: $lead_filter_id
\n"; echo "CALL LIMIT: $call_count_limit\n"; echo "CALL TIME: $local_call_time

\n"; echo "With Filter:\n"; echo "

\n"; ### call function to calculate and print dialable leads $single_status=0; dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$fSQL); echo "

\n"; echo "Without Filter:\n"; echo "

\n"; dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,''); echo "

\n"; echo "\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'; $call_id = 'call_id'; $user_group = 'user_group'; echo "\n"; echo "\n"; echo "\n"; echo ""; $stmt="SELECT script_id,script_name,script_comments,script_text,active from vicidial_scripts where script_id='$script_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $script_name = $row[1]; $script_text = stripslashes($row[3]); if (preg_match('/iframe src/i',$script_text)) { $vendor_lead_code = preg_replace('/\s/i', '+',$vendor_lead_code); $list_id = preg_replace('/\s/i', '+',$list_id); $list_name = preg_replace('/\s/i', '+',$list_name); $list_description = preg_replace('/\s/i', '+',$list_description); $gmt_offset_now = preg_replace('/\s/i', '+',$gmt_offset_now); $phone_code = preg_replace('/\s/i', '+',$phone_code); $phone_number = preg_replace('/\s/i', '+',$phone_number); $title = preg_replace('/\s/i', '+',$title); $first_name = preg_replace('/\s/i', '+',$first_name); $middle_initial = preg_replace('/\s/i', '+',$middle_initial); $last_name = preg_replace('/\s/i', '+',$last_name); $address1 = preg_replace('/\s/i', '+',$address1); $address2 = preg_replace('/\s/i', '+',$address2); $address3 = preg_replace('/\s/i', '+',$address2); $city = preg_replace('/\s/i', '+',$city); $state = preg_replace('/\s/i', '+',$state); $province = preg_replace('/\s/i', '+',$province); $postal_code = preg_replace('/\s/i', '+',$postal_code); $country_code = preg_replace('/\s/i', '+',$country_code); $gender = preg_replace('/\s/i', '+',$gender); $date_of_birth = preg_replace('/\s/i', '+',$date_of_birth); $alt_phone = preg_replace('/\s/i', '+',$alt_phone); $email = preg_replace('/\s/i', '+',$email); $security_phrase = preg_replace('/\s/i', '+',$security_phrase); $comments = preg_replace('/\s/i', '+',$comments); $RGfullname = preg_replace('/\s/i', '+',$RGfullname); $RGuser = preg_replace('/\s/i', '+',$RGuser); $RGlead_id = preg_replace('/\s/i', '+',$RGlead_id); $RGcampaign = preg_replace('/\s/i', '+',$RGcampaign); $RGphone_login = preg_replace('/\s/i', '+',$RGphone_login); $RGgroup = preg_replace('/\s/i', '+',$RGgroup); $RGchannel_group = preg_replace('/\s/i', '+',$RGchannel_group); $RGSQLdate = preg_replace('/\s/i', '+',$RGSQLdate); $RGepoch = preg_replace('/\s/i', '+',$RGepoch); $RGuniqueid = preg_replace('/\s/i', '+',$RGuniqueid); $RGcustomer_zap_channel = preg_replace('/\s/i', '+',$RGcustomer_zap_channel); $RGserver_ip = preg_replace('/\s/i', '+',$RGserver_ip); $RGSIPexten = preg_replace('/\s/i', '+',$RGSIPexten); $RGsession_id = preg_replace('/\s/i', '+',$RGsession_id); $RGdialed_number = preg_replace('/\s/i', '+',$RGdialed_number); $RGdialed_label = preg_replace('/\s/i', '+',$RGdialed_label); $RGrank = preg_replace('/\s/i', '+',$RGrank); $RGowner = preg_replace('/\s/i', '+',$RGowner); $RGcamp_script = preg_replace('/\s/i', '+',$RGcamp_script); $RGin_script = preg_replace('/\s/i', '+',$RGin_script); $script_width = preg_replace('/\s/i', '+',$script_width); $script_height = preg_replace('/\s/i', '+',$script_height); $recording_filename = preg_replace('/\s/i', '+',$recording_filename); $recording_id = preg_replace('/\s/i', '+',$recording_id); $user_custom_one = preg_replace('/\s/i', '+',$user_custom_one); $user_custom_two = preg_replace('/\s/i', '+',$user_custom_two); $user_custom_three = preg_replace('/\s/i', '+',$user_custom_three); $user_custom_four = preg_replace('/\s/i', '+',$user_custom_four); $user_custom_five = preg_replace('/\s/i', '+',$user_custom_five); $preset_number_a = preg_replace('/\s/i', '+',$preset_number_a); $preset_number_b = preg_replace('/\s/i', '+',$preset_number_b); $preset_number_c = preg_replace('/\s/i', '+',$preset_number_c); $preset_number_d = preg_replace('/\s/i', '+',$preset_number_d); $preset_number_e = preg_replace('/\s/i', '+',$preset_number_e); $preset_number_f = preg_replace('/\s/i', '+',$preset_number_f); $preset_dtmf_a = preg_replace('/\s/i', '+',$preset_dtmf_a); $preset_dtmf_b = preg_replace('/\s/i', '+',$preset_dtmf_b); $did_description = preg_replace('/\s/i', '+',$did_description); } $script_text = preg_replace('/\-\-A\-\-vendor_lead_code\-\-B\-\-/i', "$vendor_lead_code",$script_text); $script_text = preg_replace('/\-\-A\-\-list_id\-\-B\-\-/i', "$list_id",$script_text); $script_text = preg_replace('/\-\-A\-\-list_name\-\-B\-\-/i', "$list_name",$script_text); $script_text = preg_replace('/\-\-A\-\-list_description\-\-B\-\-/i', "$list_description",$script_text); $script_text = preg_replace('/\-\-A\-\-gmt_offset_now\-\-B\-\-/i', "$gmt_offset_now",$script_text); $script_text = preg_replace('/\-\-A\-\-phone_code\-\-B\-\-/i', "$phone_code",$script_text); $script_text = preg_replace('/\-\-A\-\-phone_number\-\-B\-\-/i', "$phone_number",$script_text); $script_text = preg_replace('/\-\-A\-\-title\-\-B\-\-/i', "$title",$script_text); $script_text = preg_replace('/\-\-A\-\-first_name\-\-B\-\-/i', "$first_name",$script_text); $script_text = preg_replace('/\-\-A\-\-middle_initial\-\-B\-\-/i', "$middle_initial",$script_text); $script_text = preg_replace('/\-\-A\-\-last_name\-\-B\-\-/i', "$last_name",$script_text); $script_text = preg_replace('/\-\-A\-\-address1\-\-B\-\-/i', "$address1",$script_text); $script_text = preg_replace('/\-\-A\-\-address2\-\-B\-\-/i', "$address2",$script_text); $script_text = preg_replace('/\-\-A\-\-address3\-\-B\-\-/i', "$address3",$script_text); $script_text = preg_replace('/\-\-A\-\-city\-\-B\-\-/i', "$city",$script_text); $script_text = preg_replace('/\-\-A\-\-state\-\-B\-\-/i', "$state",$script_text); $script_text = preg_replace('/\-\-A\-\-province\-\-B\-\-/i', "$province",$script_text); $script_text = preg_replace('/\-\-A\-\-postal_code\-\-B\-\-/i', "$postal_code",$script_text); $script_text = preg_replace('/\-\-A\-\-country_code\-\-B\-\-/i', "$country_code",$script_text); $script_text = preg_replace('/\-\-A\-\-gender\-\-B\-\-/i', "$gender",$script_text); $script_text = preg_replace('/\-\-A\-\-date_of_birth\-\-B\-\-/i', "$date_of_birth",$script_text); $script_text = preg_replace('/\-\-A\-\-alt_phone\-\-B\-\-/i', "$alt_phone",$script_text); $script_text = preg_replace('/\-\-A\-\-email\-\-B\-\-/i', "$email",$script_text); $script_text = preg_replace('/\-\-A\-\-security_phrase\-\-B\-\-/i', "$security_phrase",$script_text); $script_text = preg_replace('/\-\-A\-\-comments\-\-B\-\-/i', "$comments",$script_text); $script_text = preg_replace('/\-\-A\-\-fullname\-\-B\-\-/i', "$RGfullname",$script_text); $script_text = preg_replace('/\-\-A\-\-fronter\-\-B\-\-/i', "$RGuser",$script_text); $script_text = preg_replace('/\-\-A\-\-user\-\-B\-\-/i', "$RGuser",$script_text); $script_text = preg_replace('/\-\-A\-\-lead_id\-\-B\-\-/i', "$RGlead_id",$script_text); $script_text = preg_replace('/\-\-A\-\-campaign\-\-B\-\-/i', "$RGcampaign",$script_text); $script_text = preg_replace('/\-\-A\-\-phone_login\-\-B\-\-/i', "$RGphone_login",$script_text); $script_text = preg_replace('/\-\-A\-\-group\-\-B\-\-/i', "$RGgroup",$script_text); $script_text = preg_replace('/\-\-A\-\-channel_group\-\-B\-\-/i', "$RGchannel_group",$script_text); $script_text = preg_replace('/\-\-A\-\-SQLdate\-\-B\-\-/i', "$RGSQLdate",$script_text); $script_text = preg_replace('/\-\-A\-\-epoch\-\-B\-\-/i', "$RGepoch",$script_text); $script_text = preg_replace('/\-\-A\-\-uniqueid\-\-B\-\-/i', "$RGuniqueid",$script_text); $script_text = preg_replace('/\-\-A\-\-customer_zap_channel\-\-B\-\-/i', "$RGcustomer_zap_channel",$script_text); $script_text = preg_replace('/\-\-A\-\-server_ip\-\-B\-\-/i', "$RGserver_ip",$script_text); $script_text = preg_replace('/\-\-A\-\-SIPexten\-\-B\-\-/i', "$RGSIPexten",$script_text); $script_text = preg_replace('/\-\-A\-\-session_id\-\-B\-\-/i', "$RGsession_id",$script_text); $script_text = preg_replace('/\-\-A\-\-dialed_number\-\-B\-\-/i', "$RGdialed_number",$script_text); $script_text = preg_replace('/\-\-A\-\-dialed_label\-\-B\-\-/i', "$RGdialed_label",$script_text); $script_text = preg_replace('/\-\-A\-\-rank\-\-B\-\-/i', "$RGrank",$script_text); $script_text = preg_replace('/\-\-A\-\-owner\-\-B\-\-/i', "$RGowner",$script_text); $script_text = preg_replace('/\-\-A\-\-camp_script\-\-B\-\-/i', "$RGcamp_script",$script_text); $script_text = preg_replace('/\-\-A\-\-in_script\-\-B\-\-/i', "$RGin_script",$script_text); $script_text = preg_replace('/\-\-A\-\-script_width\-\-B\-\-/i', "$script_width",$script_text); $script_text = preg_replace('/\-\-A\-\-script_height\-\-B\-\-/i', "$script_height",$script_text); $script_text = preg_replace('/\-\-A\-\-recording_filename\-\-B\-\-/i', "$recording_filename",$script_text); $script_text = preg_replace('/\-\-A\-\-recording_id\-\-B\-\-/i', "$recording_id",$script_text); $script_text = preg_replace('/\-\-A\-\-user_custom_one\-\-B\-\-/i', "$user_custom_one",$script_text); $script_text = preg_replace('/\-\-A\-\-user_custom_two\-\-B\-\-/i', "$user_custom_two",$script_text); $script_text = preg_replace('/\-\-A\-\-user_custom_three\-\-B\-\-/i', "$user_custom_three",$script_text); $script_text = preg_replace('/\-\-A\-\-user_custom_four\-\-B\-\-/i', "$user_custom_four",$script_text); $script_text = preg_replace('/\-\-A\-\-user_custom_five\-\-B\-\-/i', "$user_custom_five",$script_text); $script_text = preg_replace('/\-\-A\-\-preset_number_a\-\-B\-\-/i', "$preset_number_a",$script_text); $script_text = preg_replace('/\-\-A\-\-preset_number_b\-\-B\-\-/i', "$preset_number_b",$script_text); $script_text = preg_replace('/\-\-A\-\-preset_number_c\-\-B\-\-/i', "$preset_number_c",$script_text); $script_text = preg_replace('/\-\-A\-\-preset_number_d\-\-B\-\-/i', "$preset_number_d",$script_text); $script_text = preg_replace('/\-\-A\-\-preset_number_e\-\-B\-\-/i', "$preset_number_e",$script_text); $script_text = preg_replace('/\-\-A\-\-preset_number_f\-\-B\-\-/i', "$preset_number_f",$script_text); $script_text = preg_replace('/\-\-A\-\-preset_dtmf_a\-\-B\-\-/i', "$preset_dtmf_a",$script_text); $script_text = preg_replace('/\-\-A\-\-preset_dtmf_b\-\-B\-\-/i', "$preset_dtmf_b",$script_text); $script_text = preg_replace('/\-\-A\-\-did_id\-\-B\-\-/i', "$did_id",$script_text); $script_text = preg_replace('/\-\-A\-\-did_extension\-\-B\-\-/i', "$RGdid_extension",$script_text); $script_text = preg_replace('/\-\-A\-\-did_pattern\-\-B\-\-/i', "$did_pattern",$script_text); $script_text = preg_replace('/\-\-A\-\-did_description\-\-B\-\-/i', "$RGdid_description",$script_text); $script_text = preg_replace('/\-\-A\-\-closecallid\-\-B\-\-/i', "$closecallid",$script_text); $script_text = preg_replace('/\-\-A\-\-xfercallid\-\-B\-\-/i', "$xfercallid",$script_text); $script_text = preg_replace('/\-\-A\-\-agent_log_id\-\-B\-\-/i', "$agent_log_id",$script_text); $script_text = preg_replace('/\-\-A\-\-entry_list_id\-\-B\-\-/i', "$entry_list_id",$script_text); $script_text = preg_replace('/\-\-A\-\-call_id\-\-B\-\-/i', "$call_id",$script_text); $script_text = preg_replace('/\-\-A\-\-user_group\-\-B\-\-/i', "$user_group",$script_text); $script_text = preg_replace('/\n/i', "
",$script_text); echo ""; echo "Preview Script: $script_id
\n"; echo "
\n"; echo "
$script_name
\n"; echo "$script_text\n"; echo "
\n"; echo "\n"; exit; } $ADMIN=$PHP_SELF; require("admin_header.php"); if ( ($SSadmin_modify_refresh > 1) and (preg_match("/^3|^4/",$ADD)) ) { echo "
"; } ###################################################################################################### ###################################################################################################### ####### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $voi_count = "$row[0]"; } ##### END ID override optional section ##### echo "
\n"; echo ""; echo "
ADD A NEW USER
\n"; echo "\n"; echo "\n"; echo "
\n"; if ($voi_count > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "$NWB#users-user_group$NWE\n"; echo "\n"; echo "
User Number: Auto-Generated $NWB#users-user$NWE
User Number: $NWB#users-user$NWE
Password: $NWB#users-pass$NWE     Strength:
Full Name: $NWB#users-full_name$NWE
User Level: $NWB#users-user_level$NWE
User Group:
Phone Login: $NWB#users-phone_login$NWE
Phone Pass: $NWB#users-phone_pass$NWE
\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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $voi_count = "$row[0]"; } ##### END ID override optional section ##### echo "
\n"; echo ""; echo "
COPY USER\n"; echo "\n"; echo "\n"; echo "
\n"; if ($voi_count > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; if ($LOGuser_level==9) {$levelMAX=10;} else {$levelMAX=$LOGuser_level;} echo "\n"; echo "\n"; echo "
User Number: Auto-Generated $NWB#users-user$NWE
User Number: $NWB#users-user$NWE
Password: $NWB#users-pass$NWE     Strength:
Full Name: $NWB#users-full_name$NWE
Source User: $NWB#users-user$NWE
\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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $voi_count = "$row[0]"; } ##### END ID override optional section ##### echo "
\n"; echo ""; echo "
ADD A NEW CAMPAIGN\n"; echo "\n"; echo "\n"; echo "
\n"; if ($voi_count > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSoutbound_autodial_active > 0) { echo "\n"; echo "\n"; echo "\n"; } echo "\n"; echo "\n"; if ($SSoutbound_autodial_active > 0) { echo "\n"; } echo "\n"; $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} if ($SScustom_fields_enabled > 0) {$cfwHTML = '';} echo "\n"; echo "\n"; echo "
Campaign ID: Auto-Generated $NWB#campaigns-campaign_id$NWE
Campaign ID: $NWB#campaigns-campaign_id$NWE
Campaign Name: $NWB#campaigns-campaign_name$NWE
Campaign Description: $NWB#campaigns-campaign_description$NWE
Admin User Group: $NWB#campaigns-user_group$NWE
Active: $NWB#campaigns-active$NWE
Park Music-on-Hold: moh chooser $NWB#campaigns-park_ext$NWE
Web Form: $NWB#campaigns-web_form_address$NWE
Allow Closers: $NWB#campaigns-allow_closers$NWE
Minimum Hopper Level: $NWB#campaigns-hopper_level$NWE
Auto Dial Level: (0 = off)$NWB#campaigns-auto_dial_level$NWE
Next Agent Call: $NWB#campaigns-next_agent_call$NWE
Local Call Time: $NWB#campaigns-local_call_time$NWE
Voicemail: $NWB#campaigns-voicemail_ext$NWE
Script: $NWB#campaigns-campaign_script$NWE
Get Call Launch: $NWB#campaigns-get_call_launch$NWE
\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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $voi_count = "$row[0]"; } ##### END ID override optional section ##### echo "
\n"; echo ""; echo "
COPY A CAMPAIGN\n"; echo "\n"; echo "
\n"; if ($voi_count > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Campaign ID: Auto-Generated $NWB#campaigns-campaign_id$NWE
Campaign ID: $NWB#campaigns-campaign_id$NWE
Campaign Name: $NWB#campaigns-campaign_name$NWE
Source Campaign: $NWB#campaigns-campaign_id$NWE
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.
\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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $voi_count = "$row[0]"; } ##### END ID override optional section ##### echo "
\n"; echo ""; echo "
ADD A NEW LIST\n"; echo "\n"; echo "
\n"; if ($voi_count > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
List ID: Auto-Generated $NWB#lists-list_id$NWE
List ID: (digits only)$NWB#lists-list_id$NWE
List Name: $NWB#lists-list_name$NWE
List Description: $NWB#lists-list_description$NWE
Campaign: $NWB#lists-campaign_id$NWE
Active: $NWB#lists-active$NWE
\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) { ### filter for DIGITS and NEWLINES $phone_numbers = preg_replace('/[^X\n0-9]/', '',$phone_numbers); echo "
\n"; echo ""; $campaigns_list = "\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_to_mysqli($stmt, $link); $campaigns_to_print = mysqli_num_rows($rslt); $o=0; while ($campaigns_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $campaigns_list .= "\n"; $o++; } if (strlen($phone_numbers) > 2) { $PN = explode("\n",$phone_numbers); $PNct = count($PN); $p=0; while ($p < $PNct) { if ( (preg_match('/delete/',$stage)) and ($LOGdelete_from_dnc > 0) ) { ##### BEGIN DELETE FROM DNC ##### if (preg_match('/SYSTEM_INTERNAL/',$campaign_id)) { $stmt="SELECT count(*) from vicidial_dnc where phone_number='$PN[$p]';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] < 1) {echo "
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_to_mysqli($stmt, $link); echo "
DNC DELETED: $PN[$p]\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } else { $stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$PN[$p]' and campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] < 1) {echo "
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_to_mysqli($stmt, $link); echo "
DNC DELETED: $PN[$p] $campaign_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } ##### END DELETE FROM DNC ##### } else { ##### BEGIN ADD TO DNC ##### if (preg_match('/SYSTEM_INTERNAL/',$campaign_id)) { $stmt="SELECT count(*) from vicidial_dnc where phone_number='$PN[$p]';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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_to_mysqli($stmt, $link); echo "
DNC ADDED: $PN[$p]\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } else { $stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$PN[$p]' and campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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_to_mysqli($stmt, $link); echo "
DNC ADDED: $PN[$p] $campaign_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } ##### END ADD TO DNC ##### } $p++; } } if ($LOGdelete_from_dnc > 0) {echo "
ADD OR DELETE NUMBERS FROM THE DNC LIST\n";} else {echo "
ADD NUMBERS TO THE DNC LIST\n";} echo "\n"; echo "
\n"; echo "\n"; echo "\n"; if ($LOGdelete_from_dnc > 0) { echo "\n"; } echo "\n"; echo "
List:
Phone Numbers:

(one phone number per line only)
$NWB#internal_list-dnc$NWE
Add or Delete:
\n"; if ($LOGuser_level >= 9) { echo "
Download numbers in this list to a file:
\n"; echo "\n"; echo "
\n"; } } ###################### # ADD=171 display the ADD NUMBER TO Filter Phone Group FORM SCREEN and add a new number ###################### if ($ADD==171) { ### filter for Letters DIGITS and NEWLINES $phone_numbers = preg_replace('/[^\n0-9a-zA-Z]/', '',$phone_numbers); echo "
\n"; echo ""; $stmt="SELECT filter_phone_group_id,filter_phone_group_name from vicidial_filter_phone_groups $whereLOGadmin_viewable_groupsSQL order by filter_phone_group_id;"; $rslt=mysql_to_mysqli($stmt, $link); $vfpg_to_print = mysqli_num_rows($rslt); $o=0; while ($vfpg_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $vfpg_list .= "\n"; $o++; } if (strlen($phone_numbers) > 2) { $PN = explode("\n",$phone_numbers); $PNct = count($PN); $p=0; while ($p < $PNct) { if ( (preg_match('/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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] < 1) {echo "
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_to_mysqli($stmt, $link); echo "
FILTER PHONE GROUP NUMBER DELETED: $PN[$p] $filter_phone_group_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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_to_mysqli($stmt, $link); echo "
FILTER PHONE GROUP NUMBER ADDED: $PN[$p] $filter_phone_group_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } $p++; } } if ($LOGdelete_from_dnc > 0) {echo "
ADD OR DELETE NUMBERS FROM THE FILTER PHONE GROUP LIST
\n";} else {echo "
ADD NUMBERS TO THE FILTER PHONE GROUP LIST\n";} echo "\n"; echo "
\n"; echo "\n"; echo "\n"; if ($LOGdelete_from_dnc > 0) { echo "\n"; } echo "\n"; echo "
Filter Phone Group:
Phone Numbers:

(one phone number per line only)
$NWB#internal_list-dnc$NWE
Add or Delete:
\n"; if ($LOGuser_level >= 9) { echo "
Download numbers in this list to a file:
\n"; echo "\n"; echo "
\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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $voi_count = "$row[0]"; } ##### END ID override optional section ##### echo "
\n"; echo ""; echo "
ADD A NEW INBOUND GROUP
\n"; echo "\n"; echo "
\n"; if ($voi_count > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} if ($SScustom_fields_enabled > 0) {$cfwHTML = '';} echo "\n"; if ($SSallow_emails>0) { echo "\n"; } else {echo "\n";} echo "\n"; echo "
Group ID: Auto-Generated $NWB#inbound_groups-group_id$NWE
Group ID: (no spaces)$NWB#inbound_groups-group_id$NWE
Group Name: $NWB#inbound_groups-group_name$NWE
Group Color: $NWB#inbound_groups-group_color$NWE
Active: $NWB#inbound_groups-active$NWE
Admin User Group: $NWB#inbound_groups-user_group$NWE
Web Form: $NWB#inbound_groups-web_form_address$NWE
Voicemail: $NWB#inbound_groups-voicemail_ext$NWE
Next Agent Call: $NWB#inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#inbound_groups-fronter_display$NWE
Script: $NWB#inbound_groups-ingroup_script$NWE
Get Call Launch: $NWB#inbound_groups-get_call_launch$NWE
Group Handling: $NWB#inbound_groups-group_handling$NWE
\n"; } else { echo "You do not have permission to view this page\n"; exit; } } ###################### # ADD=1811 display the ADD NEW EMAIL GROUP SCREEN ###################### if ($ADD==1811) { if ( ($LOGmodify_ingroups==1) and ($SSallow_emails>0) ) { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $voi_count = "$row[0]"; } ##### END ID override optional section ##### echo "
\n"; echo ""; echo "
ADD A NEW EMAIL GROUP\n"; echo "\n"; echo "
\n"; if ($voi_count > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; # echo "\n"; echo "\n"; echo "\n"; echo "\n"; $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} if ($SScustom_fields_enabled > 0) {$cfwHTML = '';} echo "\n"; echo "\n"; echo "
Group ID: Auto-Generated $NWB#inbound_groups-group_id$NWE
Group ID: (no spaces)$NWB#inbound_groups-group_id$NWE
Group Name: $NWB#inbound_groups-group_name$NWE
Group Color: $NWB#inbound_groups-group_color$NWE
Active: $NWB#inbound_groups-active$NWE
Admin User Group: $NWB#inbound_groups-user_group$NWE
Web Form: $NWB#inbound_groups-web_form_address$NWE
Voicemail: $NWB#inbound_groups-voicemail_ext$NWE
Next Agent Email: $NWB#inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#inbound_groups-fronter_display$NWE
Script: $NWB#inbound_groups-ingroup_script$NWE
Get Call Launch: $NWB#inbound_groups-get_call_launch$NWE
\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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $voi_count = "$row[0]"; } ##### END ID override optional section ##### echo "
\n"; echo ""; echo "
COPY INBOUND GROUP\n"; echo "\n"; echo "
\n"; if ($voi_count > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "
Group ID: Auto-Generated $NWB#inbound_groups-group_id$NWE
Group ID: (no spaces)$NWB#inbound_groups-group_id$NWE
Group Name: $NWB#inbound_groups-group_name$NWE
Source Group ID: $NWB#inbound_groups-group_id$NWE
\n"; } else { echo "You do not have permission to view this page\n"; exit; } } ###################### # ADD=1911 display the COPY EMAIL INBOUND GROUP SCREEN ###################### if ($ADD==1911) { if ( ($LOGmodify_ingroups==1) and ($SSallow_emails>0) ) { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $voi_count = "$row[0]"; } ##### END ID override optional section ##### echo "
\n"; echo ""; echo "
COPY EMAIL GROUP\n"; echo "\n"; echo "
\n"; if ($voi_count > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "
Email Group ID: Auto-Generated $NWB#inbound_groups-group_id$NWE
Email Group ID: (no spaces)$NWB#inbound_groups-group_id$NWE
Email Group Name: $NWB#inbound_groups-group_name$NWE
Source Email Group ID: $NWB#inbound_groups-group_id$NWE
\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 "
\n"; echo ""; echo "
ADD A NEW DID\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
DID Extension: (no spaces or dashes)$NWB#inbound_dids-did_pattern$NWE
DID Description: $NWB#inbound_dids-did_description$NWE
Admin User Group: $NWB#inbound_dids-user_group$NWE
\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 "
\n"; echo ""; echo "
COPY DID\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
DID Extension: (no spaces or dashes)$NWB#inbound_dids-did_pattern$NWE
DID Description: $NWB#inbound_dids-did_description$NWE
Source DID: $NWB#inbound_dids-did_pattern$NWE
\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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $voi_count = "$row[0]"; } ##### END ID override optional section ##### echo "
\n"; echo ""; echo "
ADD A NEW CALL MENU\n"; echo "\n"; echo "
\n"; if ($voi_count > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "
Menu ID: Auto-Generated $NWB#call_menu-menu_id$NWE
Menu ID: (no spaces or special characters)$NWB#call_menu-menu_id$NWE
Menu Name: $NWB#call_menu-menu_name$NWE
Admin User Group: $NWB#call_menu-user_group$NWE
\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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $voi_count = "$row[0]"; } ##### END ID override optional section ##### echo "
\n"; echo ""; echo "
COPY CALL MENU\n"; echo "\n"; echo "
\n"; if ($voi_count > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "
Menu ID: Auto-Generated $NWB#call_menu-menu_id$NWE
Menu ID: (no spaces or special characters)$NWB#call_menu-menu_id$NWE
Menu Name: $NWB#call_menu-menu_name$NWE
Source Menu: $NWB#call_menu-menu_id$NWE
\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 "
\n"; echo ""; echo "
Add Filter Phone Group\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Filter Phone Group ID: (no spaces or special characters)$NWB#filter_phone_groups-filter_phone_group_id$NWE
Filter Phone Group Name: $NWB#filter_phone_groups-filter_phone_group_name$NWE
Filter Phone Group Description: $NWB#filter_phone_groups-filter_phone_group_description$NWE
Admin User Group: $NWB#filter_phone_groups-user_group$NWE
\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 "
\n"; echo ""; echo "
ADD NEW REMOTE AGENTS\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
User ID Start: (numbers only, incremented, must be an existing vicidial user)$NWB#remote_agents-user_start$NWE
Number of Lines: (numbers only)$NWB#remote_agents-number_of_lines$NWE
Server IP: $NWB#remote_agents-server_ip$NWE
External Extension: (dial plan number dialed to reach agents)$NWB#remote_agents-conf_exten$NWE
Status: $NWB#remote_agents-status$NWE
Campaign: $NWB#remote_agents-campaign_id$NWE
Inbound Groups: \n"; echo "$groups_list"; echo "$NWB#remote_agents-closer_campaigns$NWE
\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 "
\n"; echo ""; echo "
Add Extension Group Entry\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Extension Group: (no spaces)$NWB#extension_groups-extension_group_id$NWE
Extension: (numbers only)$NWB#extension_groups-extension$NWE
Rank: $NWB#extension_groups-rank$NWE
Campaigns Groups: (pipe-delimited list)$NWB#extension_groups-extension$NWE
\n"; } else { echo "You do not have permission to view this page\n"; exit; } } ###################### # ADD=111111 display the ADD NEW USER 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $voi_count = "$row[0]"; } ##### END ID override optional section ##### echo "
\n"; echo ""; echo "
ADD NEW USERS GROUP\n"; echo "\n"; echo "
\n"; if ($voi_count > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "
Group: Auto-Generated $NWB#user_groups-user_group$NWE
Group: (no spaces or punctuation)$NWB#user_groups-user_group$NWE
Description: (description of group)$NWB#user_groups-group_name$NWE
\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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $voi_count = "$row[0]"; } ##### END ID override optional section ##### echo "
\n"; echo ""; echo "
ADD NEW SCRIPT\n"; echo "\n"; echo "\n"; echo "
\n"; if ($voi_count > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Script ID: Auto-Generated $NWB#scripts-script_id$NWE
Script ID: (no spaces or punctuation)$NWB#scripts-script_id$NWE
Script Name: (title of the script)$NWB#scripts-script_name$NWE
Script Comments: $NWB#scripts-script_comments$NWE
Active: $NWB#scripts-active$NWE
Admin User Group: $NWB#scripts-user_group$NWE
Script Text: "; # BEGIN Insert Field echo ""; echo "
"; # END Insert Field echo " $NWB#scripts-script_text$NWE
\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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $voi_count = "$row[0]"; } ##### END ID override optional section ##### echo "
\n"; echo ""; echo "
ADD NEW FILTER\n"; echo "\n"; echo "
\n"; if ($voi_count > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Filter ID: Auto-Generated $NWB#lead_filters-lead_filter_id$NWE
Filter ID: (no spaces or punctuation)$NWB#lead_filters-lead_filter_id$NWE
Filter Name: (short description of the filter)$NWB#lead_filters-lead_filter_name$NWE
Filter Comments: $NWB#lead_filters-lead_filter_comments$NWE
Admin User Group: $NWB#lead_filters-user_group$NWE
Filter SQL: $NWB#lead_filters-lead_filter_sql$NWE
\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 "
\n"; echo ""; echo "
ADD NEW CALL TIME\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Call Time ID: (no spaces or punctuation)$NWB#call_times-call_time_id$NWE
Call Time Name: (short description of the call time)$NWB#call_times-call_time_name$NWE
Call Time Comments: $NWB#call_times-call_time_comments$NWE
Admin User Group: $NWB#call_times-user_group$NWE
Day and time options will appear once you have created the Call Time Definition
\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 "
\n"; echo ""; echo "
ADD NEW STATE CALL TIME\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
State Call Time ID: (no spaces or punctuation)$NWB#call_times-call_time_id$NWE
State Call Time State: (no spaces or punctuation)$NWB#call_times-state_call_time_state$NWE
State Call Time Name: (short description of the call time)$NWB#call_times-call_time_name$NWE
State Call Time Comments: $NWB#call_times-call_time_comments$NWE
Admin User Group: $NWB#call_times-user_group$NWE
Day and time options will appear once you have created the Call Time Definition
\n"; } else { echo "You do not have permission to view this page\n"; exit; } } ###################### # ADD=1211111111 display the ADD NEW HOLIDAY SCREEN ###################### if ($ADD==1211111111) { if ($LOGmodify_call_times==1) { echo "
\n"; echo ""; echo "
ADD NEW STATE CALL TIME\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Holiday ID: (no spaces or punctuation)$NWB#call_times-holiday_id$NWE
Holiday Name: (short description of the holiday)$NWB#call_times-holiday_name$NWE
Holiday Comments: $NWB#call_times-holiday_comments$NWE
Holiday Date: $NWB#call_times-holiday_date$NWE\n"; echo "
Admin User Group: $NWB#call_times-user_group$NWE
Day and time options will appear once you have created the Holiday Definition
\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) or ($LOGmodify_shifts==1) ) { echo "
\n"; echo ""; echo "
ADD NEW SHIFT\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Shift ID: (no spaces or punctuation)$NWB#shifts-shift_id$NWE
Shift Name: (short description of the shift)$NWB#shifts-shift_name$NWE
Admin User Group: $NWB#shifts-user_group$NWE
Shift Start Time: \n"; echo "   Shift End Time: \n"; echo " $NWB#shifts-shift_start_time$NWE
Shift Length: $NWB#shifts-shift_length$NWE
Shift Weekdays:
$NWB#shifts-shift_weekdays$NWE
\n"; echo "Sunday
\n"; echo "Monday
\n"; echo "Tuesday
\n"; echo "Wednesday
\n"; echo "Thursday
\n"; echo "Friday
\n"; echo "Saturday
\n"; echo "
Report Option: $NWB#shifts-report_option$NWE
\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) or ($LOGmodify_phones==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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $voi_count = "$row[0]"; } ##### END ID override optional section ##### echo "
\n"; echo ""; echo "
ADD A NEW PHONE\n"; echo "\n"; echo "
\n"; echo "
\n"; if ($voi_count > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; # echo "\n"; # echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; # echo "\n"; # echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Phone Extension: Auto-Generated $NWB#phones-extension$NWE
Phone Extension: $NWB#phones-extension$NWE
Dial Plan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Admin User Group: $NWB#phones-user_group$NWE
Server IP: $NWB#phones-server_ip$NWE
Agent Screen Login: $NWB#phones-login$NWE
Login Password: $NWB#phones-pass$NWE
Registration Password: $NWB#phones-conf_secret$NWE     Strength:
Status: $NWB#phones-status$NWE
Active Account: $NWB#phones-active$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
Client Protocol: $NWB#phones-protocol$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
\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) or ($LOGmodify_phones==1) ) { echo "
\n"; echo ""; echo "
ADD A NEW PHONE ALIAS\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Alias ID: $NWB#phones-alias_id$NWE
Alias Name: $NWB#phones-alias_name$NWE
Admin User Group: $NWB#phones-user_group$NWE
Phone Logins List: (comma separated)$NWB#phones-logins_list$NWE
\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) or ($LOGmodify_phones==1) ) { echo "
\n"; echo ""; echo "
ADD A NEW GROUP ALIAS\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Group Alias ID: $NWB#phones-group_alias_id$NWE
Group Alias Name: $NWB#phones-group_alias_name$NWE
CallerID Number: $NWB#phones-caller_id_number$NWE
CallerID Name: $NWB#phones-caller_id_name$NWE
Active:
Admin User Group: $NWB#phones-user_group$NWE
\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 "
\n"; echo ""; echo "
ADD A NEW SERVER\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Server ID: $NWB#servers-server_id$NWE
Server Description: $NWB#servers-server_description$NWE
Server IP Address: $NWB#servers-server_ip$NWE
Active: $NWB#servers-active$NWE
Asterisk Version: $NWB#servers-asterisk_version$NWE
Admin User Group: $NWB#servers-user_group$NWE
\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 "
\n"; echo ""; echo "
ADD NEW CONF TEMPLATE\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Template ID: $NWB#conf_templates-template_id$NWE
Template Name: $NWB#conf_templates-template_name$NWE
Admin User Group: $NWB#conf_templates-user_group$NWE
Template Contents: $NWB#conf_templates-template_contents$NWE
\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) or ($LOGmodify_carriers==1) ) { echo "
\n"; echo ""; echo "
ADD NEW CARRIER\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Carrier ID: $NWB#server_carriers-carrier_id$NWE
Carrier Name: $NWB#server_carriers-carrier_name$NWE
Carrier Description: $NWB#server_carriers-carrier_description$NWE
Admin User Group: $NWB#server_carriers-user_group$NWE
Registration String: $NWB#server_carriers-registration_string$NWE
Template ID: $NWB#server_carriers-template_id$NWE
Account Entry: $NWB#server_carriers-account_entry$NWE
Protocol: $NWB#server_carriers-protocol$NWE
Globals String: $NWB#server_carriers-globals_string$NWE
Dialplan Entry: $NWB#server_carriers-dialplan_entry$NWE
Server IP: $NWB#server_carriers-server_ip$NWE
\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) or ($LOGmodify_carriers==1) ) { echo "
\n"; echo ""; echo "
ADD COPIED CARRIER\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Carrier ID: $NWB#server_carriers-carrier_id$NWE
Carrier Name: $NWB#server_carriers-carrier_name$NWE
Server IP: $NWB#server_carriers-server_ip$NWE
Source Carrier: $NWB#server_carriers-carrier_id$NWE
\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) or ($LOGmodify_tts==1) ) { echo "
\n"; echo ""; echo "
ADD NEW TTS ENTRY\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
TTS ID: $NWB#tts_prompts-tts_id$NWE
TTS Name: $NWB#tts_prompts-tts_name$NWE
Active:
Admin User Group: $NWB#tts_prompts-user_group$NWE
\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) or ($LOGmodify_moh==1) ) { echo "
\n"; echo ""; echo "
ADD NEW MUSIC ON HOLD ENTRY\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Music On Hold ID: $NWB#music_on_hold-moh_id$NWE
Music On Hold Name: $NWB#music_on_hold-moh_name$NWE
Random Order:
Admin User Group: $NWB#music_on_hold-user_group$NWE
\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) or ($LOGmodify_moh==1) ) { echo "
\n"; echo ""; echo "
ADD NEW VOICEMAIL BOX\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Voicemail ID: $NWB#voicemail-voicemail_id$NWE
Pass: $NWB#voicemail-pass$NWE
Name: $NWB#voicemail-fullname$NWE
Active:
Email: $NWB#voicemail-email$NWE
Admin User Group: $NWB#voicemail-user_group$NWE
\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) or ($LOGmodify_labels==1) ) { echo "
\n"; echo ""; echo "
ADD NEW SCREEN LABEL\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Screen Label ID: $NWB#screen_labels-label_id$NWE
Screen Label Name: $NWB#screen_labels-label_name$NWE
Admin User Group: $NWB#screen_labels-user_group$NWE
\n"; } else { echo "You do not have permission to view this page\n"; exit; } } ###################### # ADD=191111111111 display the ADD NEW CONTACT SCREEN ###################### if ($ADD==191111111111) { if ( ($LOGmodify_servers==1) or ($LOGmodify_contacts==1) ) { echo "
\n"; echo ""; echo "
ADD NEW SCREEN LABEL\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
First Name: $NWB#contact_information$NWE
Last Name: $NWB#contact_information$NWE
Office Number: $NWB#contact_information$NWE
Cell Number: $NWB#contact_information$NWE
Other Number 1: $NWB#contact_information$NWE
Other Number 2: $NWB#contact_information$NWE
BU Name: $NWB#contact_information$NWE
Department: $NWB#contact_information$NWE
Group: $NWB#contact_information$NWE
Job Title: $NWB#contact_information$NWE
Location: $NWB#contact_information$NWE
\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 "
\n"; echo ""; echo "
ADD A NEW CONFERENCE\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Conference Number: (digits only)$NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
\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 "
\n"; echo ""; echo "
ADD A NEW AGENT CONFERENCE\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Conference Number: (digits only)$NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
\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") { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from vicidial_users where user='$user';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
USER NOT ADDED - there is already a user in the system with this user number\n";} else { if (preg_match('/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 (!preg_match('/AUTOGENERA/',$user)) ) ) { echo "
USER NOT ADDED - Please go back and look at the data you entered\n"; echo "
user id must be between 2 and 20 characters long\n"; echo "
full name and password must be at least 2 characters long\n"; echo "
you must select a user group\n"; } else { if (preg_match('/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_to_mysqli($stmt, $link); $ss_auav_ct = mysqli_num_rows($rslt); if ($ss_auav_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] < 1) { $new_user++; } else { echo "\n"; $auto_user_add_value = ($auto_user_add_value + 7); } } $user = $auto_user_add_value; echo "
user_id has been auto-generated: $user
\n"; $stmt="UPDATE system_settings SET auto_user_add_value='$user';"; $rslt=mysql_to_mysqli($stmt, $link); } $pass_hash=''; if ($SSpass_hash_enabled > 0) { $pass = preg_replace("/\'|\"|\\\\|;| /","",$pass); $pass_hash = exec("../agc/bp.pl --pass=$pass"); $pass_hash = preg_replace("/PHASH: |\n|\r|\t| /",'',$pass_hash); $pass=''; } echo "
USER ADDED: $user\n"; $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,pass_hash) values('$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass','$pass_hash');"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $ss_conf_ct = mysqli_num_rows($rslt); if ($ss_conf_ct > 0) { $row=mysqli_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" . mysqli_error());} #echo 'Connected successfully'; #mysql_select_db("$vtiger_dbname", $linkV); $linkV=mysqli_connect("$vtiger_server_ip", "$vtiger_login", "$vtiger_pass", "$vtiger_dbname"); if (!$linkV) { die('MySQL connect ERROR: ' . mysqli_error($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_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $vvr_ct = mysqli_num_rows($rslt); if ($vvr_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); $row=mysqli_fetch_row($rslt); $groupid = ($row[0] + 1); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmt, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='';"; if ($DB) {echo "|$stmtA|\n";} $rslt=mysql_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_fetch_row($rslt); $userid = $row[0]; $stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';"; $rslt=mysql_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';"; if ($DB) {echo "|$stmtB|\n";} $rslt=mysql_to_mysqli($stmtB, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} if ($usergroupcount < 1) { $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysqli_num_rows($rslt); $k=0; $VD_groups_list=''; while ($k < $VD_groups_ct) { $row=mysqli_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_to_mysqli($stmtC, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; if ($DB) {echo "|$stmtD|\n";} $rslt=mysql_to_mysqli($stmtD, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $userid = mysqli_insert_id($linkV); $stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';"; if ($DB) {echo "|$stmtB|\n";} $rslt=mysql_to_mysqli($stmtB, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; if ($DB) {echo "|$stmtC|\n";} $rslt=mysql_to_mysqli($stmtC, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtD = "UPDATE vtiger_users_seq SET id='$userid';"; if ($DB) {echo "|$stmtD|\n";} $rslt=mysql_to_mysqli($stmtD, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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") { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from vicidial_users where user='$user';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
USER NOT ADDED - Please go back and look at the data you entered\n"; echo "
user id must be between 2 and 20 characters long\n"; echo "
full name and password must be at least 2 characters long\n"; echo "\n"; } else { if (preg_match('/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_to_mysqli($stmt, $link); $ss_auav_ct = mysqli_num_rows($rslt); if ($ss_auav_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] < 1) { $new_user++; } else { echo "\n"; $auto_user_add_value = ($auto_user_add_value + 7); } } $user = $auto_user_add_value; echo "
user_id has been auto-generated: $user
\n"; $stmt="UPDATE system_settings SET auto_user_add_value='$user';"; $rslt=mysql_to_mysqli($stmt, $link); } $pass_hash=''; if ($SSpass_hash_enabled > 0) { $pass = preg_replace("/\'|\"|\\\\|;| /","",$pass); $pass_hash = exec("../agc/bp.pl --pass=$pass"); $pass_hash = preg_replace("/PHASH: |\n|\r|\t| /",'',$pass_hash); $pass=''; } $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,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,modify_email_accounts,pass_hash) 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,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,modify_email_accounts,\"$pass_hash\" from vicidial_users where user=\"$source_user_id\";"; $rslt=mysql_to_mysqli($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_to_mysqli($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_to_mysqli($stmtA, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $ss_conf_ct = mysqli_num_rows($rslt); if ($ss_conf_ct > 0) { $row=mysqli_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" . mysqli_error());} #echo 'Connected successfully'; #mysql_select_db("$vtiger_dbname", $linkV); $linkV=mysqli_connect("$vtiger_server_ip", "$vtiger_login", "$vtiger_pass", "$vtiger_dbname"); if (!$linkV) { die('MySQL connect ERROR: ' . mysqli_error($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_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $vvr_ct = mysqli_num_rows($rslt); if ($vvr_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); $row=mysqli_fetch_row($rslt); $groupid = ($row[0] + 1); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmt, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='';"; if ($DB) {echo "|$stmtA|\n";} $rslt=mysql_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_fetch_row($rslt); $userid = $row[0]; $stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';"; $rslt=mysql_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';"; if ($DB) {echo "|$stmtB|\n";} $rslt=mysql_to_mysqli($stmtB, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} if ($usergroupcount < 1) { $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysqli_num_rows($rslt); $k=0; $VD_groups_list=''; while ($k < $VD_groups_ct) { $row=mysqli_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_to_mysqli($stmtC, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; if ($DB) {echo "|$stmtD|\n";} $rslt=mysql_to_mysqli($stmtD, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $userid = mysqli_insert_id($linkV); $stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';"; if ($DB) {echo "|$stmtB|\n";} $rslt=mysql_to_mysqli($stmtB, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; if ($DB) {echo "|$stmtC|\n";} $rslt=mysql_to_mysqli($stmtC, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtD = "UPDATE vtiger_users_seq SET id='$userid';"; if ($DB) {echo "|$stmtD|\n";} $rslt=mysql_to_mysqli($stmtD, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} #### END CREATE NEW USER RECORD IN VTIGER } ##### END Add/Update user info in Vtiger ###################################### } ### END vtiger integration echo "
USER COPIED: $user copied from $source_user_id\n"; echo "

\n"; echo "Click here to go to the user record\n"; echo "

\n"; } } } exit; } ###################### # ADD=21 adds the new campaign to the system ###################### if ($ADD==21) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
CAMPAIGN NOT ADDED - Please go back and look at the data you entered\n"; echo "
campaign ID must be between 2 and 8 characters in length\n"; echo "
campaign name must be between 6 and 40 characters in length\n"; } else { echo "
CAMPAIGN ADDED: $campaign_id\n"; # if admin user's user group does not have -ALL-CAMPAIGNS- then add this new campaign to their user group's allowable campaigns if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) ) { $UPDATEallowed_campaigns = $LOGallowed_campaigns; $UPDATEallowed_campaigns = preg_replace("/ -$/"," $campaign_id -",$UPDATEallowed_campaigns); $LOGallowed_campaigns = $UPDATEallowed_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 "; $stmt="UPDATE vicidial_user_groups SET allowed_campaigns='$UPDATEallowed_campaigns' where user_group='$LOGuser_group';"; $rslt=mysql_to_mysqli($stmt, $link); } $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,na_call_url,user_group) values('$campaign_id','$campaign_name','$campaign_description','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysqli_real_escape_string($link, $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','','','','','$user_group');"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; $rslt=mysql_to_mysqli($stmtA, $link); $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');"; $rslt=mysql_to_mysqli($stmtA, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } } $ADD=31; } ###################### # ADD=20 adds copied new campaign to the system ###################### if ($ADD==20) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
CAMPAIGN NOT ADDED - Please go back and look at the data you entered\n"; echo "
campaign ID must be between 2 and 8 characters in length\n"; echo "
source campaign ID must be between 2 and 8 characters in length\n"; } else { echo "
CAMPAIGN COPIED: $campaign_id copied from $source_campaign_id\n"; # if admin user's user group does not have -ALL-CAMPAIGNS- then add this new campaign to their user group's allowable campaigns if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) ) { $UPDATEallowed_campaigns = $LOGallowed_campaigns; $UPDATEallowed_campaigns = preg_replace("/ -$/"," $campaign_id -",$UPDATEallowed_campaigns); $LOGallowed_campaigns = $UPDATEallowed_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 "; $stmt="UPDATE vicidial_user_groups SET allowed_campaigns='$UPDATEallowed_campaigns' where user_group='$LOGuser_group';"; $rslt=mysql_to_mysqli($stmt, $link); } $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,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check,safe_harbor_audio_field,pause_after_next_call,owner_populate,use_other_campaign_dnc,allow_emails,amd_inbound_group,amd_callmenu,survey_wait_sec,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo) 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,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check,safe_harbor_audio_field,pause_after_next_call,owner_populate,use_other_campaign_dnc,allow_emails,amd_inbound_group,amd_callmenu,survey_wait_sec,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; $rslt=mysql_to_mysqli($stmtA, $link); $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$campaign_id');"; $rslt=mysql_to_mysqli($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,completed) SELECT status,status_name,selectable,\"$campaign_id\",human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed from vicidial_campaign_statuses where campaign_id='$source_campaign_id';"; $rslt=mysql_to_mysqli($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_to_mysqli($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_to_mysqli($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_to_mysqli($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_to_mysqli($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_to_mysqli($stmtA, $link); $stmtA="INSERT INTO vicidial_campaign_cid_areacodes (areacode,outbound_cid,active,cid_description,campaign_id) SELECT areacode,outbound_cid,active,cid_description,\"$campaign_id\" from vicidial_campaign_cid_areacodes where campaign_id='$source_campaign_id';"; $rslt=mysql_to_mysqli($stmtA, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } } $ADD=31; } ###################### # ADD=22 adds the new campaign status to the system ###################### if ($ADD==22) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
CAMPAIGN STATUS NOT ADDED - Please go back and look at the data you entered\n"; echo "
status must be between 1 and 8 characters in length\n"; echo "
status name must be between 2 and 30 characters in length\n"; } else { echo "
CAMPAIGN STATUS ADDED: $campaign_id - $status_id\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,completed) values('$status_id','$status_name','$selectable','$campaign_id','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable','$scheduled_callbacks','$completed');"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } } $SUB=22; $ADD=31; } ###################### # ADD=23 adds the new campaign hotkey to the system ###################### if ($ADD==23) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { $HKstatus_data = explode('-----',$HKstatus); $status = $HKstatus_data[0]; $status_name = $HKstatus_data[1]; echo ""; $stmt="SELECT count(*) from vicidial_campaign_hotkeys where campaign_id='$campaign_id' and hotkey='$hotkey' and hotkey='$hotkey';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
CAMPAIGN HOT KEY NOT ADDED - Please go back and look at the data you entered\n"; echo "
hotkey must be a single character between 1 and 9 \n"; echo "
status must be between 1 and 8 characters in length\n"; } else { echo "
CAMPAIGN HOT KEY ADDED: $campaign_id - $status - $hotkey\n"; $stmt="INSERT INTO vicidial_campaign_hotkeys values('$status','$hotkey','$status_name','$selectable','$campaign_id');"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $SUB=23; $ADD=31; } ###################### # ADD=25 adds the new campaign lead recycle entry to the system ###################### if ($ADD==25) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { $status = preg_replace('/\-\-\-\-\-.*/i', '',$status); echo ""; $stmt="SELECT count(*) from vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
CAMPAIGN LEAD RECYCLE NOT ADDED - Please go back and look at the data you entered\n"; echo "
status must be between 1 and 6 characters in length\n"; echo "
attempt delay must be at least 120 seconds and less than 43200 seconds or 12 hours\n"; echo "
maximum attempts must be from 1 to 10\n"; } else { echo "
CAMPAIGN LEAD RECYCLE ADDED: $campaign_id - $status - $attempt_delay\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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $SUB=25; $ADD=31; } ###################### # ADD=26 adds the new auto alt dial status to the campaign ###################### if ($ADD==26) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { $status = preg_replace('/\-\-\-\-\-.*/i', '',$status); echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial_statuses LIKE \"% $status %\";"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
AUTO ALT DIAL STATUS NOT ADDED - Please go back and look at the data you entered\n"; echo "
status must be between 1 and 6 characters in length\n"; } else { echo "
AUTO ALT DIAL STATUS ADDED: $campaign_id - $status\n"; $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $SUB=26; $ADD=31; } ###################### # ADD=27 adds the new campaign agent pause code entry to the system ###################### if ($ADD==27) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
AGENT PAUSE CODE NOT ADDED - Please go back and look at the data you entered\n"; echo "
pause code must be between 1 and 6 characters in length\n"; echo "
pause code name must be between 2 and 30 characters in length\n"; } else { echo "
AGENT PAUSE CODE ADDED: $campaign_id - $pause_code - $pause_code_name\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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $SUB=27; $ADD=31; } ###################### # ADD=28 adds new status to the campaign dial statuses ###################### if ($ADD==28) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { $status = preg_replace('/\-\-\-\-\-.*/i', '',$status); echo ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\";"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
CAMPAIGN DIAL STATUS NOT ADDED - Please go back and look at the data you entered\n"; echo "
status must be between 1 and 6 characters in length\n"; } else { echo "
CAMPAIGN DIAL STATUS ADDED: $campaign_id - $status\n"; $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } #$SUB=28; $ADD=31; } ###################### # ADD=201 adds new preset to the campaign presets ###################### if ($ADD==201) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_xfer_presets where campaign_id='$campaign_id' and preset_name='$preset_name';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
PRESET NOT ADDED - Please go back and look at the data you entered\n"; echo "
preset name must be between 1 and 40 characters in length\n"; echo "
preset number must be between 2 and 50 characters in length\n"; } else { echo "
PRESET ADDED: $campaign_id - $preset_name - $preset_number\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_to_mysqli($stmt, $link); $stmt="INSERT INTO vicidial_xfer_stats(campaign_id,preset_name) values('$campaign_id','$preset_name');"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $SUB=201; $ADD=31; } ###################### # ADD=202 adds/deletes/modifies areacode cid to the campaign ###################### if ($ADD==202) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; if ($stage == 'ADD') { $stmt="SELECT count(*) from vicidial_campaign_cid_areacodes where campaign_id='$campaign_id' and areacode='$areacode' and outbound_cid='$outbound_cid';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
AREACODE CID NOT ADDED - there is already an entry for this campaign with this CID
\n";} else { if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) { echo "
AREACODE CID NOT ADDED - Please go back and look at the data you entered
\n"; } else { echo "
AREACODE CID ADDED: $campaign_id - $areacode - $outbound_cid
\n"; $stmt="INSERT INTO vicidial_campaign_cid_areacodes(campaign_id,areacode,outbound_cid,cid_description) values('$campaign_id','$areacode','$outbound_cid','$cid_description');"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_AC-CID', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADD CAMPAIGN AC-CID', event_sql=\"$SQL_log\", event_notes='CID: $areacode - $outbound_cid';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); } } } if ($stage == 'DELETE') { $stmt="SELECT count(*) from vicidial_campaign_cid_areacodes where campaign_id='$campaign_id' and areacode='$areacode' and outbound_cid='$outbound_cid' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] < 1) {echo "
AREACODE CID NOT DELETED - this entry does not exist
\n";} else { if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) { echo "
AREACODE CID NOT DELETED - Please go back and look at the data you entered
\n"; } else { echo "
AREACODE CID DELETED: $campaign_id - $areacode - $outbound_cid
\n"; $stmt="DELETE FROM vicidial_campaign_cid_areacodes WHERE campaign_id='$campaign_id' and areacode='$areacode' and outbound_cid='$outbound_cid';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_AC-CID', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN AC-CID', event_sql=\"$SQL_log\", event_notes='CID: $areacode - $outbound_cid';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); } } } if ($stage == 'MODIFY') { $stmt="SELECT areacode,outbound_cid,active,cid_description,call_count_today from vicidial_campaign_cid_areacodes where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by areacode,outbound_cid"; $rslt=mysql_to_mysqli($stmt, $link); $accids_to_print = mysqli_num_rows($rslt); $o=0; while ($accids_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $Xareacode[$o] = $rowx[0]; $Xoutbound_cid[$o] = $rowx[1]; $Xactive[$o] = $rowx[2]; $Xcid_description[$o] = $rowx[3]; $Xcall_count_today[$o] = $rowx[4]; $o++; } $o=0; while ($accids_to_print > $o) { $Factive_value=''; $Fcid_description_value=''; $Factive = "active_$Xareacode[$o]_$Xoutbound_cid[$o]"; $Fcid_description = "cid_description_$Xareacode[$o]_$Xoutbound_cid[$o]"; if (isset($_GET[$Factive])) {$Factive_value=$_GET[$Factive];} elseif (isset($_POST[$Factive])) {$Factive_value=$_POST[$Factive];} if (isset($_GET[$Fcid_description])) {$Fcid_description_value=$_GET[$Fcid_description];} elseif (isset($_POST[$Fcid_description])) {$Fcid_description_value=$_POST[$Fcid_description];} $Fcid_description_value = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$Fcid_description_value); $Factive_value = preg_replace('/[^A-Z]/','',$Factive_value); # echo "$campaign_id - $Xareacode[$o] - $Xoutbound_cid[$o] - $Factive($Factive_value|$Xactive[$o]) - $Fcid_description($Fcid_description_value|$Xcid_description[$o])
"; if ( ($Factive_value == $Xactive[$o]) and ($Fcid_description_value == $Xcid_description[$o]) ) { # echo "
AREACODE CID NOT MODIFIED - Please go back and look at the data you entered
\n"; } else { echo "AREACODE CID MODIFIED: $Xareacode[$o] - $Xoutbound_cid[$o]
\n"; $stmt="UPDATE vicidial_campaign_cid_areacodes SET active='$Factive_value',cid_description='$Fcid_description_value' WHERE campaign_id='$campaign_id' and areacode='$Xareacode[$o]' and outbound_cid='$Xoutbound_cid[$o]';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_AC-CID', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN AC-CID', event_sql=\"$SQL_log\", event_notes='CID: $Xareacode[$o] - $Xoutbound_cid[$o]';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); } $o++; } } } $SUB=202; $ADD=31; } ###################### # ADD=211 adds the new list to the system ###################### if ($ADD==211) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from vicidial_lists where list_id='$list_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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) > 19) ) { echo "
LIST NOT ADDED - Please go back and look at the data you entered\n"; echo "
List ID must be between 2 and 8 characters in length\n"; echo "
List name must be at least 2 characters in length\n"; echo "
List ID must be greater than 100\n"; } else { echo "
LIST ADDED: $list_id\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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=311; } ###################### # ADD=2111 adds the new inbound group to the system ###################### if ($ADD==2111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 (preg_match('/\s/i',$group_id)) or (preg_match('/\-/i',$group_id)) or (preg_match("/\+/i",$group_id)) ) { echo "
GROUP NOT ADDED - Please go back and look at the data you entered\n"; echo "
Group ID must be between 2 and 20 characters in length and contain no ' -+'.\n"; echo "
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,na_call_url,user_group,group_handling) values('$group_id','$group_name','$group_color','$active','" . mysqli_real_escape_string($link, $web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','','','','$user_group','$group_handling');"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; $rslt=mysql_to_mysqli($stmtA, $link); $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; $rslt=mysql_to_mysqli($stmtA, $link); echo "
GROUP ADDED: $group_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } } $ADD=3111; } ###################### # ADD=2811 adds the new EMAIL inbound group to the system ###################### if ( ($ADD==2811) and ($SSallow_emails>0) ) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
EMAIL 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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
EMAIL 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 (preg_match('/\s/i',$group_id)) or (preg_match('/\-/i',$group_id)) or (preg_match("/\+/i",$group_id)) ) { echo "
GROUP NOT ADDED - Please go back and look at the data you entered\n"; echo "
Group ID must be between 2 and 20 characters in length and contain no ' -+'.\n"; echo "
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,na_call_url,user_group,group_handling) values('$group_id','$group_name','$group_color','$active','" . mysqli_real_escape_string($link, $web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','EMAIL','','','','','','$user_group','EMAIL');"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; $rslt=mysql_to_mysqli($stmtA, $link); $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; $rslt=mysql_to_mysqli($stmtA, $link); echo "
EMAIL GROUP ADDED: $group_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } } $ADD=3811; } ###################### # ADD=2011 adds copied inbound group to the system ###################### if ($ADD==2011) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 (preg_match('/\s/i',$group_id)) or (preg_match('/\-/i',$group_id)) or (preg_match("/\+/i",$group_id)) ) { echo "
GROUP NOT ADDED - Please go back and look at the data you entered\n"; echo "
Group ID must be between 2 and 20 characters in length and contain no ' -+'.\n"; echo "
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,na_call_url,on_hook_cid,action_xfer_cid,drop_callmenu,after_hours_callmenu,user_group,max_calls_method,max_calls_count,max_calls_action,dial_ingroup_cid,group_handling) 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,na_call_url,on_hook_cid,action_xfer_cid,drop_callmenu,after_hours_callmenu,user_group,max_calls_method,max_calls_count,max_calls_action,dial_ingroup_cid,group_handling from vicidial_inbound_groups where group_id=\"$source_group_id\";"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; $rslt=mysql_to_mysqli($stmtA, $link); $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; $rslt=mysql_to_mysqli($stmtA, $link); echo "
GROUP ADDED: $group_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } } $ADD=3111; } ###################### # ADD=2911 adds copied inbound group to the system ###################### if ( ($ADD==2911) and ($SSallow_emails>0) ) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
EMAIL 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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
EMAIL 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 (preg_match('/\s/i',$group_id)) or (preg_match('/\-/i',$group_id)) or (preg_match("/\+/i",$group_id)) ) { echo "
EMAIL GROUP NOT ADDED - Please go back and look at the data you entered\n"; echo "
Email group ID must be between 2 and 20 characters in length and contain no ' -+'.\n"; echo "
Email 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,na_call_url,on_hook_cid,action_xfer_cid,drop_callmenu,after_hours_callmenu,user_group,max_calls_method,max_calls_count,max_calls_action,dial_ingroup_cid,group_handling) 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,na_call_url,on_hook_cid,action_xfer_cid,drop_callmenu,after_hours_callmenu,user_group,max_calls_method,max_calls_count,max_calls_action,dial_ingroup_cid,group_handling from vicidial_inbound_groups where group_id=\"$source_group_id\";"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; $rslt=mysql_to_mysqli($stmtA, $link); $stmtA="INSERT INTO vicidial_campaign_stats_debug (campaign_id) values('$group_id');"; $rslt=mysql_to_mysqli($stmtA, $link); echo "
EMAIL GROUP ADDED: $group_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } } $ADD=3811; } ###################### # ADD=2311 adds the new did to the system ###################### if ($ADD==2311) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$did_pattern';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
DID NOT ADDED - there is already a DID in the system with this extension\n";} else { # or (preg_match("/\+/i",$did_pattern)) if ( (strlen($did_pattern) < 2) or (preg_match('/\s/i',$did_pattern)) or (preg_match('/\-/i',$did_pattern)) ) { echo "
DID NOT ADDED - Please go back and look at the data you entered\n"; echo "
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,user_group) values('$did_pattern','$did_description','$user_group');"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $did_id = $row[0]; echo "
DID ADDED: $did_pattern $did_description - $did_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } } $ADD=3311; } ###################### # ADD=2411 adds copied did to the system ###################### if ($ADD==2411) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$did_pattern';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 (preg_match('/\s/i',$source_did)) or (preg_match('/\s/i',$did_pattern)) or (preg_match("/\+/i",$source_did)) ) { echo "
DID NOT ADDED - Please go back and look at the data you entered\n"; echo "
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,custom_one,custom_two,custom_three,custom_four,custom_five,user_group) 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,custom_one,custom_two,custom_three,custom_four,custom_five,user_group from vicidial_inbound_dids where did_id=\"$source_did\";"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $did_id = $row[0]; echo "
DID ADDED: $did_pattern - $did_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=3311; } ###################### # ADD=2511 adds the new call menu to the system ###################### if ($ADD==2511) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from vicidial_call_menu where menu_id='$menu_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) { echo "
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 "
CALL MENU NOT ADDED - Please go back and look at the data you entered\n"; echo "
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 (preg_match('/\s/i',$menu_id)) ) { echo "
CALL MENU NOT ADDED - Please go back and look at the data you entered\n"; echo "
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,user_group) values('$menu_id','$menu_name','$user_group');"; $rslt=mysql_to_mysqli($stmt, $link); echo "
CALL MENU ADDED: $menu_id $menu_name\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); $ADD=3511; } } } } } ###################### # ADD=2611 adds copied call menu to the system ###################### if ($ADD==2611) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from vicidial_call_menu where menu_id='$menu_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) { echo "
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 "
CALL MENU NOT ADDED - Please go back and look at the data you entered\n"; echo "
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 (preg_match('/\s/i',$menu_id)) or (strlen($source_menu) < 2) or (preg_match('/\s/i',$source_menu)) ) { echo "
CALL MENU NOT ADDED - Please go back and look at the data you entered\n"; echo "
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,dtmf_field,user_group,qualify_sql) 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,dtmf_field,user_group,qualify_sql from vicidial_call_menu where menu_id=\"$source_menu\";"; $rslt=mysql_to_mysqli($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_to_mysqli($stmtA, $link); echo "
CALL MENU ADDED: $menu_id - $menu_name\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtA"; $SQL_log = preg_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_to_mysqli($stmt, $link); $ADD=3511; } } } } } ###################### # ADD=2711 adds the new filter phone group to the system ###################### if ($ADD==2711) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 (preg_match('/\s/i',$filter_phone_group_id)) ) { echo "
PHONE FILTER GROUP NOT ADDED - Please go back and look at the data you entered\n"; echo "
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,user_group) values('$filter_phone_group_id','$filter_phone_group_name','$filter_phone_group_description','$user_group');"; $rslt=mysql_to_mysqli($stmt, $link); echo "
PHONE FILTER GROUP ADDED: $filter_phone_group_id $filter_phone_group_name\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=3711; } ###################### # ADD=21111 adds new remote agents to the system ###################### if ($ADD==21111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_remote_agents where server_ip='$server_ip' and user_start='$user_start';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] < 1) {echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
REMOTE AGENTS NOT ADDED - Please go back and look at the data you entered\n"; echo "
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_to_mysqli($stmt, $link); echo "
REMOTE AGENTS ADDED: $user_start\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } } } $ADD=10000; } ###################### # ADD=22111 adds new extension group entry to the system ###################### if ($ADD==22111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
EXTENSION GROUP ENTRY NOT ADDED - Please go back and look at the data you entered\n"; echo "
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_to_mysqli($stmt, $link); $stmt="SELECT extension_id from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $extension_id = $row[0]; echo "
EXTENSION GROUP ENTRY ADDED: $extension_id - $extension_group_id - $extension\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=12000; } ###################### # ADD=211111 adds new user group to the system ###################### if ($ADD==211111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from vicidial_user_groups where user_group='$user_group';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
USER GROUP NOT ADDED - Please go back and look at the data you entered\n"; echo "
Group name and description must be at least 2 characters in length\n"; } else { $allowed_user_group_insert_SQL = '---ALL---'; $allowed_campaign_insert_SQL = '-ALL-CAMPAIGNS-'; # if admin user's user group does not have --ALL-- then add this new user group to their user group's allowable user groups if ($admin_viewable_groupsALL < 1) { $UPDATEadmin_viewable_groups = $LOGadmin_viewable_groups; $UPDATEadmin_viewable_groups = preg_replace("/ $/"," $user_group ",$UPDATEadmin_viewable_groups); $LOGadmin_viewable_groups = $UPDATEadmin_viewable_groups; $stmt="UPDATE vicidial_user_groups SET admin_viewable_groups='$UPDATEadmin_viewable_groups' where user_group='$LOGuser_group';"; $rslt=mysql_to_mysqli($stmt, $link); $allowed_user_group_insert_SQL = " $user_group -"; $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $LOGadmin_viewable_groupsSQL = "and user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; $whereLOGadmin_viewable_groupsSQL = "where user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; } if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) ) { $allowed_campaign_insert_SQL = $LOGallowed_campaigns; } $stmt="INSERT INTO vicidial_user_groups(user_group,group_name,allowed_campaigns,admin_viewable_groups) values('$user_group','$group_name','$allowed_campaign_insert_SQL','$allowed_user_group_insert_SQL');"; $rslt=mysql_to_mysqli($stmt, $link); echo "
USER GROUP ADDED: $user_group\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $ss_conf_ct = mysqli_num_rows($rslt); if ($ss_conf_ct > 0) { $row=mysqli_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" . mysqli_error());} #echo 'Connected successfully'; #mysql_select_db("$vtiger_dbname", $linkV); $linkV=mysqli_connect("$vtiger_server_ip", "$vtiger_login", "$vtiger_pass", "$vtiger_dbname"); if (!$linkV) { die('MySQL connect ERROR: ' . mysqli_error($linkV)); } ###################################### ##### BEGIN Add/Update group info in Vtiger $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; $rslt=mysql_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); $row=mysqli_fetch_row($rslt); $groupid = ($row[0] + 1); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmt, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; if ($DB) {echo "|$stmtA|\n";} $rslt=mysql_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from vicidial_scripts where script_id='$script_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
SCRIPT NOT ADDED - Please go back and look at the data you entered\n"; echo "
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','" . mysqli_real_escape_string($link, $script_text) . "','$active','$user_group');"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB > 0) {echo "|$stmt|";} echo "
SCRIPT ADDED: $script_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=1000000; } ###################### # ADD=21111111 adds new filter to the system ###################### if ($ADD==21111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
FILTER NOT ADDED - Please go back and look at the data you entered\n"; echo "
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',user_group='$user_group',lead_filter_comments='$lead_filter_comments',lead_filter_sql='" . mysqli_real_escape_string($link, $lead_filter_sql) . "';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB > 0) {echo "|$stmt|";} echo "
FILTER ADDED: $lead_filter_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=10000000; } ###################### # ADD=211111111 adds new call time definition to the system ###################### if ($ADD==211111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_call_times where call_time_id='$call_time_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
CALL TIME DEFINITION NOT ADDED - Please go back and look at the data you entered\n"; echo "
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',user_group='$user_group',ct_state_call_times='',ct_holidays='';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB > 0) {echo "|$stmt|";} echo "
CALL TIME ADDED: $call_time_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=311111111; } ###################### # ADD=2111111111 adds new state call time definition to the system ###################### if ($ADD==2111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_state_call_times where state_call_time_id='$call_time_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
STATE CALL TIME DEFINITION NOT ADDED - Please go back and look at the data you entered\n"; echo "
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',user_group='$user_group';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB > 0) {echo "|$stmt|";} echo "
STATE CALL TIME ADDED: $call_time_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=3111111111; } ###################### # ADD=2211111111 adds new holiday definition to the system ###################### if ($ADD==2211111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_call_time_holidays where holiday_id='$holiday_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
HOLIDAY DEFINITION NOT ADDED - there is already a holiday entry with this ID\n";} else { if ( (strlen($holiday_id) < 2) or (strlen($holiday_name) < 2) or (strlen($holiday_date) < 10) ) { echo "
HOLIDAY DEFINITION NOT ADDED - Please go back and look at the data you entered\n"; echo "
Holiday ID, name and date must be populated\n"; } else { $stmt="INSERT INTO vicidial_call_time_holidays SET holiday_id='$holiday_id',holiday_name='$holiday_name',holiday_comments='$holiday_comments',holiday_date='$holiday_date',holiday_status='INACTIVE',user_group='$user_group';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB > 0) {echo "|$stmt|";} echo "
HOLIDAY ADDED: $holiday_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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='HOLIDAYS', event_type='ADD', record_id='$holiday_id', event_code='ADMIN ADD HOLIDAY', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); } } } $ADD=3211111111; } ###################### # ADD=231111111 adds new shift definition to the system ###################### if ($ADD==231111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from vicidial_shifts where shift_id='$shift_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
SHIFT DEFINITION NOT ADDED - there is already a shift entry with this ID\n";} else { $shift_length_test = preg_replace('/:/i', '',$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 "
SHIFT DEFINITION NOT ADDED - Please go back and look at the data you entered\n"; echo "
Shift ID and name must be at least 2 characters in length\n"; echo "
Shift Start Time must be 4 digits in length and be a valid time\n"; echo "
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',report_option='$report_option',shift_weekdays='$SHIFT_weekdays',user_group='$user_group';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB > 0) {echo "|$stmt|";} echo "
SHIFT ADDED: $shift_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=331111111; } ###################### # ADD=21111111111 adds new phone to the system ###################### if ($ADD==21111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { ##### 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_to_mysqli($stmt, $link); $voi_ct = mysqli_num_rows($rslt); if ($voi_ct > 0) { $row=mysqli_fetch_row($rslt); $extension = ($row[0] + 1); $stmt="UPDATE vicidial_override_ids SET value='$extension' where id_table='phones' and active='1';"; $rslt=mysql_to_mysqli($stmt, $link); } ##### END ID override optional section ##### echo ""; $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
PHONE NOT ADDED - Please go back and look at the data you entered\n"; echo "
The following fields must have data: extension, server_ip, dialplan_number, voicemail_id, login, pass\n"; } else { echo "
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,user_group) 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','$user_group');"; $rslt=mysql_to_mysqli($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_to_mysqli($stmtA, $link); $stmtB="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$SSactive_voicemail_server';"; $rslt=mysql_to_mysqli($stmtB, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } } } } $ADD=31111111111; } ###################### # ADD=22111111111 adds new phone alias to the system ###################### if ($ADD==22111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from phones_alias where alias_id='$alias_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
PHONE ALIAS NOT ADDED - Please go back and look at the data you entered\n";} else { echo "
PHONE ALIAS ADDED\n"; $stmt="INSERT INTO phones_alias (alias_id,alias_name,logins_list,user_group) values('$alias_id','$alias_name','$logins_list','$user_group');"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } } $ADD=32111111111; } ###################### # ADD=23111111111 adds new group alias to the system ###################### if ($ADD==23111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from groups_alias where group_alias_id='$group_alias_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
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 "
GROUP ALIAS NOT ADDED - Please go back and look at the data you entered\n";} else { echo "
GROUP ALIAS ADDED\n"; $stmt="INSERT INTO groups_alias (group_alias_id,group_alias_name,caller_id_number,caller_id_name,active,user_group) values('$group_alias_id','$group_alias_name','$caller_id_number','$caller_id_name','$active','$user_group');"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } } $ADD=33111111111; } ###################### # ADD=211111111111 adds new server to the system ###################### if ($ADD==211111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from servers where server_id='$server_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
SERVER NOT ADDED - Please go back and look at the data you entered\n";} else { echo "
SERVER ADDED\n"; $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version,conf_secret,local_gmt,user_group) values('$server_id','$server_description','$server_ip','$active','$asterisk_version','$SSdefault_server_password','$SSdefault_local_gmt','$user_group');"; $rslt=mysql_to_mysqli($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_to_mysqli($stmtA, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=311111111111; } ###################### # ADD=221111111111 adds the new vicidial server trunk record to the system ###################### if ($ADD==221111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT max_vicidial_trunks from servers where server_ip='$server_ip';"; $rslt=mysql_to_mysqli($stmt, $link); $rowx=mysqli_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_to_mysqli($stmt, $link); $rowx=mysqli_fetch_row($rslt); $SUMvicidial_trunks = ($rowx[0] + $dedicated_trunks); if ($SUMvicidial_trunks > $MAXvicidial_trunks) { echo "
SERVER TRUNK RECORD NOT ADDED - the number of 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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
SERVER TRUNK RECORD NOT ADDED - Please go back and look at the data you entered\n"; echo "
campaign must be between 3 and 8 characters in length\n"; echo "
server_ip delay must be at least 7 characters\n"; echo "
trunks must be a digit from 0 to 9999\n"; } else { echo "
SERVER TRUNK RECORD ADDED: $campaign_id - $server_ip - $dedicated_trunks - $trunk_restriction\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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } } $ADD=311111111111; } ###################### # ADD=231111111111 adds new conf template to the system ###################### if ($ADD==231111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_conf_templates where template_id='$template_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
CONF TEMPLATE NOT ADDED - there is already a template in the system with this ID\n";} else { if (strlen($template_id) < 2) {echo "
CONF TEMPLATE NOT ADDED - Please go back and look at the data you entered\n";} else { echo "
CONF TEMPLATE ADDED\n"; $stmt="INSERT INTO vicidial_conf_templates (template_id,template_name,template_contents,user_group) values('$template_id','$template_name','$template_contents','$user_group');"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=331111111111; } ###################### # ADD=241111111111 adds new server carrier to the system ###################### if ($ADD==241111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_server_carriers where carrier_id='$carrier_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
CARRIER NOT ADDED - Please go back and look at the data you entered\n";} else { echo "
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,user_group) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N','$carrier_description','$user_group');"; $rslt=mysql_to_mysqli($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_to_mysqli($stmtA, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=341111111111; } ###################### # ADD=240111111111 adds copied server carrier to the system ###################### if ($ADD==240111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_server_carriers where carrier_id='$carrier_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
CARRIER NOT ADDED - Please go back and look at the data you entered\n";} else { echo "
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,user_group) SELECT \"$carrier_id\",\"$carrier_name\",registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,\"$server_ip\",\"N\",carrier_description,user_group from vicidial_server_carriers where carrier_id=\"$source_carrier\";"; $rslt=mysql_to_mysqli($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_to_mysqli($stmtA, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=341111111111; } ###################### # ADD=251111111111 adds new tts entry to the system ###################### if ($ADD==251111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_tts_prompts where tts_id='$tts_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
TTS ENTRY NOT ADDED - Please go back and look at the data you entered\n";} else { echo "
TTS ENTRY ADDED\n"; $stmt="INSERT INTO vicidial_tts_prompts SET tts_id='$tts_id',tts_name='$tts_name',active='$active',user_group='$user_group';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=351111111111; } ###################### # ADD=261111111111 adds new music on hold entry to the system ###################### if ($ADD==261111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_music_on_hold where moh_id='$moh_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
MUSIC ON HOLD ENTRY NOT ADDED - Please go back and look at the data you entered\n";} else { echo "
MUSIC ON HOLD ENTRY ADDED\n"; $stmt="INSERT INTO vicidial_music_on_hold SET moh_id='$moh_id',moh_name='$moh_name',random='$random',user_group='$user_group';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=361111111111; } ###################### # ADD=271111111111 adds new voicemail box to the system ###################### if ($ADD==271111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_voicemail where voicemail_id='$voicemail_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
VOICEMAIL BOX NOT ADDED - Please go back and look at the data you entered\n";} else { echo "
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',user_group='$user_group';"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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_to_mysqli($stmtA, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } } $ADD=371111111111; } ###################### # ADD=281111111111 adds new screen label to the system ###################### if ($ADD==281111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_screen_labels where label_id='$label_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
SCREEN LABEL NOT ADDED - Please go back and look at the data you entered\n";} else { echo "
SCREEN LABEL ADDED\n"; $stmt="INSERT INTO vicidial_screen_labels SET label_id='$label_id',label_name='$label_name',active='N',user_group='$user_group';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=381111111111; } ###################### # ADD=291111111111 adds new contact to the system ###################### if ($ADD==291111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { if ( (preg_match("/contact_information/",$SStables_use_alt_log_db)) and (strlen($SSalt_log_server_ip)>4) and (strlen($SSalt_log_dbname)>0) ) { $linkALT=mysql_connect("$SSalt_log_server_ip", "$SSalt_log_login", "$SSalt_log_pass"); mysql_select_db("$SSalt_log_dbname", $linkALT); } else {$linkALT = $link;} echo ""; $stmt="SELECT count(*) from contact_information where first_name='$first_name' and last_name='$last_name' and office_num='$office_num';"; $rslt=mysql_to_mysqli($stmt, $linkALT); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
CONTACT NOT ADDED - there is already a contact in the system with this name and number\n";} else { if (strlen($last_name) < 2) {echo "
CONTACT NOT ADDED - Please go back and look at the data you entered\n";} else { echo "
CONTACT ADDED\n"; $stmt="INSERT INTO contact_information SET first_name='$first_name',last_name='$last_name',office_num='$office_num',cell_num='$cell_num',other_num1='$other_num1',other_num2='$other_num2',bu_name='$bu_name',department='$department',group_name='$group_name',job_title='$job_title',location='$location';"; $rslt=mysql_to_mysqli($stmt, $linkALT); $contact_id = mysqli_insert_id($linkALT); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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='CONTACTS', event_type='ADD', record_id='$contact_id', event_code='ADMIN ADD CONTACT', event_sql=\"$SQL_log\", event_notes='$first_name $last_name $office_num';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); } } } $ADD=391111111111; } ###################### # ADD=2111111111111 adds new conference to the system ###################### if ($ADD==2111111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
CONFERENCE NOT ADDED - Please go back and look at the data you entered\n";} else { echo "
CONFERENCE ADDED\n"; $stmt="INSERT INTO conferences (conf_exten,server_ip) values('$conf_exten','$server_ip');"; $rslt=mysql_to_mysqli($stmt, $link); } } } $ADD=3111111111111; } ###################### # ADD=21111111111111 adds new vicidial conference to the system ###################### if ($ADD==21111111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
AGENT CONFERENCE NOT ADDED - there is already an agent conference in the system with this ID and server\n";} else { if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) {echo "
AGENT CONFERENCE NOT ADDED - Please go back and look at the data you entered\n";} else { echo "
AGENT CONFERENCE ADDED\n"; $stmt="INSERT INTO vicidial_conferences (conf_exten,server_ip) values('$conf_exten','$server_ip');"; $rslt=mysql_to_mysqli($stmt, $link); } } } $ADD=31111111111111; } ###################### # ADD=221111111111111 adds the new system status to the system ###################### if ($ADD==221111111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_campaign_statuses where status='$status_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
SYSTEM STATUS NOT ADDED - Please go back and look at the data you entered\n"; echo "
status must be between 1 and 8 characters in length\n"; echo "
status name must be between 2 and 30 characters in length\n"; } else { echo "
SYSTEM STATUS ADDED: $status_name - $status_id\n"; $stmt="INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed) values('$status_id','$status_name','$selectable','$human_answered','$category','$sale','$dnc','$customer_contact','$not_interested','$unworkable','$scheduled_callbacks','$completed');"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } } $ADD=321111111111111; } ###################### # ADD=231111111111111 adds the new status category to the system ###################### if ($ADD==231111111111111) { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; $stmt="SELECT count(*) from vicidial_status_categories where vsc_id='$vsc_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
STATUS CATEGORY NOT ADDED - Please go back and look at the data you entered\n"; echo "
ID must be between 2 and 20 characters in length\n"; echo "
name name must be between 2 and 50 characters in length\n"; } else { echo "
STATUS CATEGORY ADDED: $vsc_id - $vsc_name\n"; $stmt="SELECT count(*) from vicidial_status_categories where tovdad_display='Y' and vsc_id NOT IN('$vsc_id');"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ( ($row[0] > 3) and (preg_match('/Y/',$tovdad_display)) ) { $tovdad_display = 'N'; echo "
ERROR: There are already 4 Status Categories set to TimeOnVDAD Display\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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } $ADD=331111111111111; } ###################### # ADD=241111111111111 adds the new qc status code to the system ###################### //Moved to qc/QC_status_codes_include.php include file ###################################################################################################### ###################################################################################################### ####### 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 ""; if ( ( (strlen($pass) < 2) and ($SSpass_hash_enabled < 1) ) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) { echo "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
Password and Full Name each need to be at least 2 characters in length\n"; } else { if ($SSoutbound_autodial_active < 1) { $closer_default_blended = '0'; $delete_filters = '0'; $load_leads = '0'; } $pass_hash=''; $pass_hashSQL=''; if ($SSpass_hash_enabled > 0) { if (strlen($pass) > 1) { $pass = preg_replace("/\'|\"|\\\\|;| /","",$pass); $pass_hash = exec("../agc/bp.pl --pass=$pass"); $pass_hash = preg_replace("/PHASH: |\n|\r|\t| /",'',$pass_hash); $pass_hashSQL = ",pass_hash='$pass_hash'"; } $pass=''; } echo "
USER MODIFIED - ADMIN: $user\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',modify_shifts='$modify_shifts',modify_phones='$modify_phones',modify_carriers='$modify_carriers',modify_labels='$modify_labels',modify_statuses='$modify_statuses',modify_voicemail='$modify_voicemail',modify_audiostore='$modify_audiostore',modify_moh='$modify_moh',modify_tts='$modify_tts',preset_contact_search='$preset_contact_search',modify_contacts='$modify_contacts',modify_same_user_level='$modify_same_user_level',admin_hide_lead_data='$admin_hide_lead_data',admin_hide_phone_data='$admin_hide_phone_data',agentcall_email='$agentcall_email',modify_email_accounts='$modify_email_accounts',failed_login_count=0 $pass_hashSQL where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmt_grp_values|"; $SQL_log = preg_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_to_mysqli($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_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $ss_conf_ct = mysqli_num_rows($rslt); if ($ss_conf_ct > 0) { $row=mysqli_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" . mysqli_error());} #echo 'Connected successfully'; #mysql_select_db("$vtiger_dbname", $linkV); $linkV=mysqli_connect("$vtiger_server_ip", "$vtiger_login", "$vtiger_pass", "$vtiger_dbname"); if (!$linkV) { die('MySQL connect ERROR: ' . mysqli_error($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_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $vvr_ct = mysqli_num_rows($rslt); if ($vvr_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); $row=mysqli_fetch_row($rslt); $groupid = ($row[0] + 1); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmt, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='';"; if ($DB) {echo "|$stmtA|\n";} $rslt=mysql_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_fetch_row($rslt); $userid = $row[0]; $stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';"; $rslt=mysql_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';"; if ($DB) {echo "|$stmtB|\n";} $rslt=mysql_to_mysqli($stmtB, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} if ($usergroupcount < 1) { $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysqli_num_rows($rslt); $k=0; $VD_groups_list=''; while ($k < $VD_groups_ct) { $row=mysqli_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_to_mysqli($stmtC, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; if ($DB) {echo "|$stmtD|\n";} $rslt=mysql_to_mysqli($stmtD, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $userid = mysqli_insert_id($linkV); $stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';"; if ($DB) {echo "|$stmtB|\n";} $rslt=mysql_to_mysqli($stmtB, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; if ($DB) {echo "|$stmtC|\n";} $rslt=mysql_to_mysqli($stmtC, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtD = "UPDATE vtiger_users_seq SET id='$userid';"; if ($DB) {echo "|$stmtD|\n";} $rslt=mysql_to_mysqli($stmtD, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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 ""; if ( ( (strlen($pass) < 2) and ($SSpass_hash_enabled < 1) ) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) { echo "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
Password and Full Name each need to be at least 2 characters in length\n"; } else { if ($SSoutbound_autodial_active < 1) { $closer_default_blended = '0'; $delete_filters = '0'; $load_leads = '0'; } $pass_hash=''; $pass_hashSQL=''; if ($SSpass_hash_enabled > 0) { if (strlen($pass) > 1) { $pass = preg_replace("/\'|\"|\\\\|;| /","",$pass); $pass_hash = exec("../agc/bp.pl --pass=$pass"); $pass_hash = preg_replace("/PHASH: |\n|\r|\t| /",'',$pass_hash); $pass_hashSQL = ",pass_hash='$pass_hash'"; } $pass=''; } echo "
USER MODIFIED - ADMIN: $user\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',preset_contact_search='$preset_contact_search',failed_login_count=0 $pass_hashSQL where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $ss_conf_ct = mysqli_num_rows($rslt); if ($ss_conf_ct > 0) { $row=mysqli_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" . mysqli_error());} #echo 'Connected successfully'; #mysql_select_db("$vtiger_dbname", $linkV); $linkV=mysqli_connect("$vtiger_server_ip", "$vtiger_login", "$vtiger_pass", "$vtiger_dbname"); if (!$linkV) { die('MySQL connect ERROR: ' . mysqli_error($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_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $vvr_ct = mysqli_num_rows($rslt); if ($vvr_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); $row=mysqli_fetch_row($rslt); $groupid = ($row[0] + 1); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmt, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='';"; if ($DB) {echo "|$stmtA|\n";} $rslt=mysql_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_fetch_row($rslt); $userid = $row[0]; $stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';"; $rslt=mysql_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';"; if ($DB) {echo "|$stmtB|\n";} $rslt=mysql_to_mysqli($stmtB, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} if ($usergroupcount < 1) { $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysqli_num_rows($rslt); $k=0; $VD_groups_list=''; while ($k < $VD_groups_ct) { $row=mysqli_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_to_mysqli($stmtC, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; if ($DB) {echo "|$stmtD|\n";} $rslt=mysql_to_mysqli($stmtD, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $userid = mysqli_insert_id($linkV); $stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';"; if ($DB) {echo "|$stmtB|\n";} $rslt=mysql_to_mysqli($stmtB, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; if ($DB) {echo "|$stmtC|\n";} $rslt=mysql_to_mysqli($stmtC, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtD = "UPDATE vtiger_users_seq SET id='$userid';"; if ($DB) {echo "|$stmtD|\n";} $rslt=mysql_to_mysqli($stmtD, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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 ""; if ( ( (strlen($pass) < 2) and ($SSpass_hash_enabled < 1) ) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) { echo "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
Password and Full Name each need to be at least 2 characters in length\n"; } else { $pass_hash=''; $pass_hashSQL=''; if ($SSpass_hash_enabled > 0) { if (strlen($pass) > 1) { $pass = preg_replace("/\'|\"|\\\\|;| /","",$pass); $pass_hash = exec("../agc/bp.pl --pass=$pass"); $pass_hash = preg_replace("/PHASH: |\n|\r|\t| /",'',$pass_hash); $pass_hashSQL = ",pass_hash='$pass_hash'"; } $pass=''; } echo "
USER MODIFIED: $user\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',failed_login_count=0 $pass_hashSQL where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $ss_conf_ct = mysqli_num_rows($rslt); if ($ss_conf_ct > 0) { $row=mysqli_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" . mysqli_error());} #echo 'Connected successfully'; #mysql_select_db("$vtiger_dbname", $linkV); $linkV=mysqli_connect("$vtiger_server_ip", "$vtiger_login", "$vtiger_pass", "$vtiger_dbname"); if (!$linkV) { die('MySQL connect ERROR: ' . mysqli_error($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_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $vvr_ct = mysqli_num_rows($rslt); if ($vvr_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); $row=mysqli_fetch_row($rslt); $groupid = ($row[0] + 1); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmt, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='';"; if ($DB) {echo "|$stmtA|\n";} $rslt=mysql_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_fetch_row($rslt); $userid = $row[0]; $stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';"; $rslt=mysql_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtB = "UPDATE vtiger_user2role SET roleid='$roleid' where userid='$userid';"; if ($DB) {echo "|$stmtB|\n";} $rslt=mysql_to_mysqli($stmtB, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} if ($usergroupcount < 1) { $stmt="SELECT user_group FROM vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $VD_groups_ct = mysqli_num_rows($rslt); $k=0; $VD_groups_list=''; while ($k < $VD_groups_ct) { $row=mysqli_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_to_mysqli($stmtC, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; if ($DB) {echo "|$stmtD|\n";} $rslt=mysql_to_mysqli($stmtD, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $userid = mysqli_insert_id($linkV); $stmtB = "INSERT INTO vtiger_user2role SET userid='$userid',roleid='$roleid';"; if ($DB) {echo "|$stmtB|\n";} $rslt=mysql_to_mysqli($stmtB, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtC = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';"; if ($DB) {echo "|$stmtC|\n";} $rslt=mysql_to_mysqli($stmtC, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtD = "UPDATE vtiger_users_seq SET id='$userid';"; if ($DB) {echo "|$stmtD|\n";} $rslt=mysql_to_mysqli($stmtD, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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 ""; 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_audio_field = 'DISABLED'; $safe_harbor_menu_id = ''; $survey_camp_record_dir = '/home/survey'; $survey_dtmf_digits = '1238'; $survey_wait_sec = '10'; $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'; $call_count_limit = '0'; $call_count_target = '0'; $lead_order_randomize = 'N'; $lead_order_secondary = 'LEAD_ASCEND'; $amd_inbound_group = ''; $amd_callmenu = ''; } if ( (preg_match('/list_activation/',$stage)) or (preg_match('/test_call/',$stage)) ) { if (preg_match('/test_call/',$stage)) { $p=0; echo "
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_to_mysqli($stmtA, $link); $affected_rows = mysqli_affected_rows($link); $lead_id = mysqli_insert_id($link); ### LOG INSERTION Admin Log Table, for lead ### $SQL_log = "$stmtA|"; $SQL_log = preg_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_to_mysqli($stmt, $link); ### gather list_id overrides $stmt="SELECT campaign_cid_override FROM vicidial_lists where list_id='$manual_dial_list_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $CIDor_ct = mysqli_num_rows($rslt); $campaign_cid_override=''; if ($CIDor_ct > 0) { $row=mysqli_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','$old_server_ip','','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_to_mysqli($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('$old_server_ip','$campaign_id','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUT','MAIN','99')"; $rslt=mysql_to_mysqli($stmtC, $link); ### insert a record in the vicidial_dial_log table $stmtD = "INSERT INTO vicidial_dial_log SET caller_code='$VqueryCID',lead_id='$lead_id',server_ip='$old_server_ip',call_date='$SQLdate',extension='$VDAD_dial_exten',channel='$local_DEF$Ndialstring$local_AMP$ext_context',timeout='$Local_dial_timeout',outbound_cid='$CIDstring',context='$ext_context';"; $rslt=mysql_to_mysqli($stmtD, $link); ### LOG INSERTION Admin Log Table, for campaign ### $SQL_log = "$stmtA|$stmtB|$stmtC|"; $SQL_log = preg_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_to_mysqli($stmt, $link); if ($DB > 0) {echo "|$stmtA|\n|$stmtB|\n|$stmtC|\n";} echo " PLACED TO $phone_code $phone_number\n
"; } } if (preg_match('/list_activation/',$stage)) { $p=0; echo "
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_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmtB, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; $SQL_log = preg_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_to_mysqli($stmt, $link); if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} } } else { if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { echo "
CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
the campaign name needs to be at least 6 characters in length\n"; echo "
|$campaign_name|$active|\n"; } else { if ($form_end != 'END') { echo "
CAMPAIGN NOT MODIFIED - Please wait for the whole page to load before submitting the form\n"; } else { echo "
CAMPAIGN MODIFIED: $campaign_id\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 ( (!preg_match('/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' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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 .= "$group_id_values[$o] - $group_name_values[$o] - $VIG_priority
\n"; $o++; } if (strlen($groups_value)>2) {$groups_value .= " -";} } if ( ($pause_max < 10) or (strlen($pause_max)<2) ) {$pause_max=0;} if ( ($pause_max > 9) and ($pause_max <= $dial_timeout) ) {$pause_max = ($dial_timeout + 10);} $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='" . mysqli_real_escape_string($link, $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='" . mysqli_real_escape_string($link, $web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysqli_real_escape_string($link, $crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysqli_real_escape_string($link, $start_call_url) . "',dispo_call_url='" . mysqli_real_escape_string($link, $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='" . mysqli_real_escape_string($link, $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',na_call_url='" . mysqli_real_escape_string($link, $na_call_url) . "',pllb_grouping='$pllb_grouping',pllb_grouping_limit='$pllb_grouping_limit',call_count_limit='$call_count_limit',call_count_target='$call_count_target',callback_hours_block='$callback_hours_block',callback_list_calltime='$callback_list_calltime',user_group='$user_group',hopper_vlc_dup_check='$hopper_vlc_dup_check',in_group_dial='$in_group_dial',in_group_dial_select='$in_group_dial_select',safe_harbor_audio_field='$safe_harbor_audio_field',pause_after_next_call='$pause_after_next_call',owner_populate='$owner_populate',use_other_campaign_dnc='$use_other_campaign_dnc',allow_emails='$allow_emails',amd_inbound_group='$amd_inbound_group',amd_callmenu='$amd_callmenu',manual_dial_lead_id='$manual_dial_lead_id',dead_max='$dead_max',dispo_max='$dispo_max',pause_max='$pause_max',dead_max_dispo='$dead_max_dispo',dispo_max_dispo='$dispo_max_dispo' where campaign_id='$campaign_id';"; $rslt=mysql_to_mysqli($stmtA, $link); if ($reset_hopper == 'Y') { echo "
RESETTING CAMPAIGN LEAD HOPPER\n"; echo "
- 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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = preg_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_to_mysqli($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 ""; if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) { echo "
CAMPAIGN STATUS NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
the campaign id needs to be at least 2 characters in length\n"; echo "
the campaign status needs to be at least 1 characters in length\n"; } else { if (preg_match('/delete/',$stage)) { echo "
CUSTOM CAMPAIGN STATUS DELETED: $campaign_id - $status\n"; $stmt="DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status';"; $rslt=mysql_to_mysqli($stmtA, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } if (preg_match('/modify/', $stage)) { echo "
CUSTOM CAMPAIGN STATUS MODIFIED: $campaign_id - $status\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',completed='$completed' where campaign_id='$campaign_id' and status='$status';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) ) { echo "
CAMPAIGN HOT KEY NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
the campaign id needs to be at least 2 characters in length\n"; echo "
the campaign status needs to be at least 1 characters in length\n"; echo "
the campaign hotkey needs to be at least 1 characters in length\n"; } else { echo "
CUSTOM CAMPAIGN HOT KEY DELETED: $campaign_id - $status - $hotkey\n"; $stmt="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; 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_audio_field = 'DISABLED'; $safe_harbor_menu_id = ''; $voicemail_ext = ''; } if (preg_match('/list_activation/',$stage)) { $p=0; echo "
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_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmtB, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; $SQL_log = preg_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_to_mysqli($stmt, $link); if ($DB > 0) {echo "|$stmt|\n|$stmtB|\n";} } else { if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) { echo "
CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
the campaign name needs to be at least 6 characters in length\n"; } else { echo "
CAMPAIGN MODIFIED: $campaign_id\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 ( (!preg_match('/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_to_mysqli($stmtA, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = preg_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_to_mysqli($stmt, $link); if ($reset_hopper == 'Y') { echo "
RESETTING CAMPAIGN LEAD HOPPER\n"; echo "
- 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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; 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 "
CAMPAIGN LEAD RECYCLE NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
status must be between 1 and 6 characters in length\n"; echo "
attempt delay must be at least 120 seconds and less than 43200 seconds or 12 hours\n"; echo "
maximum attempts must be from 1 to 10\n"; } else { echo "
CAMPAIGN LEAD MODIFIED: $campaign_id - $status - $attempt_delay\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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) or (strlen($pause_code) > 6) or (strlen($pause_code_name) < 2) ) { echo "
AGENT PAUSE CODE NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
pause_code must be between 1 and 6 characters in length\n"; echo "
pause_code name must be between 2 and 30 characters in length\n"; } else { echo "
AGENT PAUSE CODE MODIFIED: $campaign_id - $pause_code - $pause_code_name\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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if (strlen($campaign_id) < 2) { echo "
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 "
QC SETTINGS MODIFIED: $campaign_id\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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if (strlen($campaign_id) < 2) { echo "
SURVEY SETTINGS NOT MODIFIED - Please go back and look at the data you entered\n"; } else { echo "
SURVEY SETTINGS MODIFIED: $campaign_id\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',survey_recording='$survey_recording',survey_wait_sec='$survey_wait_sec' where campaign_id='$campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; $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 "
LIST MIX NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
vcl_id must be between 1 and 20 characters in length\n"; echo "
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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
LIST MIX MODIFIED: $campaign_id - $vcl_id - $vcl_name\n"; } } ##### ADD a list mix container entry ##### if ($stage=='ADD') { echo ""; if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($list_id) < 1) ) { echo "
LIST MIX NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
vcl_id must be between 1 and 20 characters in length\n"; echo "
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' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
LIST MIX MODIFIED: $campaign_id - $vcl_id - $list_id\n"; } } ##### REMOVE a list mix container entry ##### if ($stage=='REMOVE') { echo ""; if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($list_id) < 1) ) { echo "
LIST MIX NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
vcl_id must be between 1 and 20 characters in length\n"; echo "
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' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $MIXentries = $MT; $MIXentries = explode(":", $row[0]); $Ms_to_print = (count($MIXentries) - 0); if ($Ms_to_print < 2) { echo "
LIST MIX NOT MODIFIED: You cannot delete the last list_id entry from a list mix\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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
LIST MIX MODIFIED: $campaign_id - $vcl_id - $list_id - $mix_container_item\n"; } } } ##### ADD a NEW list mix ##### if ($stage=='NEWMIX') { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { echo ""; if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($vcl_name) < 2) ) { echo "
LIST MIX NOT ADDED - Please go back and look at the data you entered\n"; echo "
vcl_id must be between 1 and 20 characters in length\n"; echo "
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' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) { echo "
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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
LIST MIX ADDED: $campaign_id - $vcl_id - $vcl_name\n"; } } } } ##### DELETE an existing list mix ##### if ($stage=='DELMIX') { echo ""; if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) ) { echo "
LIST MIX NOT DELETED - Please go back and look at the data you entered\n"; echo "
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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
LIST MIX DELETED: $campaign_id - $vcl_id - $vcl_name\n"; } } ##### Set list mix entry to active ##### if ($stage=='SETACTIVE') { echo ""; if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) ) { echo "
LIST MIX NOT ACTIVATED - Please go back and look at the data you entered\n"; echo "
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_to_mysqli($stmt, $link); $stmt="UPDATE vicidial_campaigns_list_mix SET status='ACTIVE' where vcl_id='$vcl_id' and campaign_id='$campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
LIST MIX ACTIVATED: $campaign_id - $vcl_id - $vcl_name\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 ""; if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) { echo "
PRESET NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
preset name must be between 1 and 40 characters in length\n"; echo "
preset number must be between 2 and 50 characters in length\n"; } else { echo "
PRESET MODIFIED: $campaign_id - $preset_name - $preset_number\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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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) and (strlen($list_id) > 1) ) { echo ""; if ($stage == 'territory_reset') { $p=0; echo "
TERRITORIES RESET"; $territory_reset_ct = count($territory_reset); while ($p < $territory_reset_ct) { $TERR_RESET .= "'$territory_reset[$p]',"; $p++; } $TERR_RESET = preg_replace("/,$/",'',$TERR_RESET); if (strlen($TERR_RESET) > 1) { $stmt = "UPDATE vicidial_list SET called_since_last_reset='N' where list_id='$list_id' and owner IN($TERR_RESET);"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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 TERRITORY RESET', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($DB > 0) {echo "|$stmt|\n";} } } else { if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) { echo "
LIST NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
list name must be at least 2 characters in length\n"; } else { if (strlen($reset_time) < 4) {$reset_time='';} if (strlen($expiration_date) < 10) {$expiration_date='2099-12-31';} echo "
LIST MODIFIED: $list_id\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='" . mysqli_real_escape_string($link, $web_form_address) . "',web_form_address_two='" . mysqli_real_escape_string($link, $web_form_address_two) . "',time_zone_setting='$time_zone_setting',inventory_report='$inventory_report',expiration_date='$expiration_date' where list_id='$list_id';"; $rslt=mysql_to_mysqli($stmt, $link); ## BEGIN QC Addition for Audited Comments $stmt="INSERT INTO vicidial_lists_custom (audit_comments, list_id) VALUES ('" . mysqli_real_escape_string($link, $audit_comments) . "','$list_id') ON DUPLICATE KEY UPDATE audit_comments='" . mysqli_real_escape_string($link, $audit_comments) . "';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "|$stmt|\n";} ## END QC Addition for Audited Comments ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); if ($reset_list == 'Y') { echo "
RESETTING LIST-CALLED-STATUS\n"; $stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; $rslt=mysql_to_mysqli($stmtB, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtB|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } if ($campaign_id != "$old_campaign_id") { echo "
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_to_mysqli($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 || $ADD==4811) { if ($SUB=='agents_select') { if ($LOGmodify_users==1) { echo ""; if ( (strlen($OLDuser_group) < 2) or (strlen($group_id) < 2) ) { echo "
USERS NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
group id and user group must be at least 2 characters in length\n"; } else { $stmt="SELECT user,closer_campaigns from vicidial_users where active='Y' and user_group='$OLDuser_group' $LOGadmin_viewable_groupsSQL order by user;"; $rsltx=mysql_to_mysqli($stmt, $link); $users_to_print = mysqli_num_rows($rsltx); $ARIUG_changenotes=''; $o=0; while ($users_to_print > $o) { $rowx=mysqli_fetch_row($rsltx); $ARIUG_user[$o] = $rowx[0]; $ARIUG_close[$o] = $rowx[1]; $ARIUG_check[$o] = ''; if (preg_match("/ $group_id /",$ARIUG_close[$o])) {$ARIUG_check[$o] = 'CHECKED';} if ( ($ARIUG_check[$o]=='') and ($stage=='add') ) { if (strlen($ARIUG_close[$o]) < 4) {$ARIUG_close[$o]=' - ';} $stmtA="UPDATE vicidial_users set closer_campaigns=' $group_id$ARIUG_close[$o]' where user='$ARIUG_user[$o]';"; $rslt=mysql_to_mysqli($stmtA, $link); if ($DB > 0) {echo "|$stmtA|";} $ARIUG_changenotes .= "added $group_id to selected in-groups|"; $ARIUG_code = "USER INGROUP VIGA ADD"; } if ( ($ARIUG_check[$o]=='CHECKED') and ($stage=='remove') ) { $ARIUG_close[$o] = preg_replace("/ $group_id /",' ',$ARIUG_close[$o]); $stmtB="UPDATE vicidial_users set closer_campaigns='$ARIUG_close[$o]' where user='$ARIUG_user[$o]';"; $rslt=mysql_to_mysqli($stmtB, $link); if ($DB > 0) {echo "|$stmtB|";} $ARIUG_changenotes .= "removed $group_id from selected in-groups|"; $ARIUG_code = "USER INGROUP VIGA REMOVE"; } if (strlen($ARIUG_changenotes) > 10) { ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtDlog|"; $SQL_log = preg_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='$ARIUG_user[$o]', event_code='$ARIUG_code', event_sql=\"$SQL_log\", event_notes='$ARIUG_changenotes';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); } $o++; } } } else { echo "You do not have permission to view this page\n"; exit; } } else { if ($LOGmodify_ingroups==1) { echo ""; if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) { echo "
GROUP NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
group name and group color must be at least 2 characters in length\n"; } else { if ($form_end != 'END') { echo "
GROUP NOT MODIFIED - Please wait for the whole page to load before submitting the form\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 = preg_replace('/[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]/','',$no_agent_action_value); echo "
GROUP MODIFIED: $group_id\n"; $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysqli_real_escape_string($link, $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='" . mysqli_real_escape_string($link, $web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysqli_real_escape_string($link, $start_call_url) . "',dispo_call_url='" . mysqli_real_escape_string($link, $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='" . mysqli_real_escape_string($link, $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',na_call_url='" . mysqli_real_escape_string($link, $na_call_url) . "',on_hook_cid='$on_hook_cid',action_xfer_cid='$action_xfer_cid',drop_callmenu='$drop_callmenu',after_hours_callmenu='$after_hours_callmenu',user_group='$user_group',max_calls_method='$max_calls_method',max_calls_count='$max_calls_count',max_calls_action='$max_calls_action',dial_ingroup_cid='$dial_ingroup_cid' where group_id='$group_id';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } } else { echo "You do not have permission to view this page\n"; exit; } } $ADD-=1000; #$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 ""; if ( (strlen($did_id) < 1) or (strlen($did_pattern) < 1) ) { echo "
DID NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
did_extension must be at least 1 character in length\n"; } else { echo "
DID MODIFIED: $did_pattern\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',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five',user_group='$user_group' where did_id='$did_id';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if (strlen($menu_id) < 1) { echo "
CALL MENU NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
menu_id must be at least 1 character in length\n"; } else { echo "
CALL MENU MODIFIED: $menu_id\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',dtmf_field='$dtmf_field',user_group='$user_group',qualify_sql='$qualify_sql' where menu_id='$menu_id';"; $rslt=mysql_to_mysqli($stmt, $link); $h=0; $option_value_list='|'; while ($h <= 20) { $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 = preg_replace('/[^-\_0-9A-Z]/','',$option_value); $option_description = preg_replace('/[^- \:\/\_0-9a-zA-Z]/','',$option_description); $option_route = preg_replace('/[^-\_0-9a-zA-Z]/', '',$option_route); $option_route_value = preg_replace('/[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]/','',$option_route_value); $option_route_value_context = preg_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_to_mysqli($stmtA, $link); $row=mysqli_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_to_mysqli($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_to_mysqli($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_to_mysqli($stmtA, $link); $row=mysqli_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_to_mysqli($stmtA, $link); $stmtAX .= "$stmtA|"; } } $option_value_list .= "$option_value|"; $h++; } ## delete existing database records that were not in the submit while ($h <= 20) { 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_to_mysqli($stmtA, $link); $row=mysqli_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_to_mysqli($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_to_mysqli($stmtA, $link); $stmtAX .= "$stmtA|"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtAX"; $SQL_log = preg_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_to_mysqli($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 ""; if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_name) < 2) or (strlen($filter_phone_group_name) > 40) ) { echo "
FILTER PHONE GROUP NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
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',user_group='$user_group' where filter_phone_group_id='$filter_phone_group_id';"; $rslt=mysql_to_mysqli($stmt, $link); echo "
FILTER PHONE GROUP MODIFIED\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; $stmt="SELECT count(*) from vicidial_users where user='$user_start' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] < 1) {echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
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 "
REMOTE AGENTS NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
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_to_mysqli($stmt, $link); echo "
REMOTE AGENTS MODIFIED\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if ( (strlen($extension_id) < 1) or (strlen($extension_group_id) < 2) or (strlen($extension) < 2) or (strlen($rank) < 1) ) { echo "
EXTENSION GROUP ENTRY NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
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_to_mysqli($stmt, $link); echo "
EXTENSION GROUP ENTRY MODIFIED\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) { echo "
USER GROUP NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
Group name and description must be at least 2 characters in length\n"; } else { if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) { echo "You are not allowed to edit your own user group\n"; exit; } else { $p=0; $GROUP_shifts=' '; $group_shifts_ct = count($group_shifts); while ($p <= $group_shifts_ct) { $group_shifts[$p] = preg_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] = preg_replace('/[^- \_0-9a-zA-Z]/','',$agent_status_viewable_groups[$p]); $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; $p++; } $p=0; $Vadmin_viewable_groups=' '; $admin_viewable_groups_ct = count($admin_viewable_groups); while ($p <= $admin_viewable_groups_ct) { $admin_viewable_groups[$p] = preg_replace('/[^- \_0-9a-zA-Z]/','',$admin_viewable_groups[$p]); $Vadmin_viewable_groups .= "$admin_viewable_groups[$p] "; $p++; } $p=0; $Vadmin_viewable_call_times=' '; $admin_viewable_call_times_ct = count($admin_viewable_call_times); while ($p <= $admin_viewable_call_times_ct) { $admin_viewable_call_times[$p] = preg_replace('/[^- \_0-9a-zA-Z]/','',$admin_viewable_call_times[$p]); $Vadmin_viewable_call_times .= "$admin_viewable_call_times[$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); # update allowed_camapigns with values that the editor cant see http://www.vicidial.org/VICIDIALforum/viewtopic.php?f=5&t=26101 if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) ) { $changer_allowed_campaigns = preg_replace("/ -/",'',$LOGallowed_campaigns); $changer_allowed_campaigns = explode(" ", $changer_allowed_campaigns); $stmt="SELECT allowed_campaigns FROM vicidial_user_groups WHERE user_group='$OLDuser_group';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $old_allowed_rows = mysqli_num_rows($rslt); if ($old_allowed_rows > 0) { $row=mysqli_fetch_row($rslt); $old_allowed = $row[0]; } if ( (!preg_match('/-ALL/',$old_allowed)) ) { $invis_campaigns=""; $campaigns_value = preg_replace("/ -/",'',$campaigns_value); $old_allowed = preg_replace("/ -/",'',$old_allowed); $old_allowed = explode(" ", $old_allowed); foreach ($old_allowed as $oac) { if (!in_array($oac, $changer_allowed_campaigns)) { $invis_campaigns .= "$oac "; } } $campaigns_value .= " $invis_campaigns-"; } } $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='" . mysqli_real_escape_string($link, $webphone_url_override) . "',webphone_systemkey_override='$webphone_systemkey_override',webphone_dialpad_override='$webphone_dialpad_override',admin_viewable_groups='$Vadmin_viewable_groups',admin_viewable_call_times='$Vadmin_viewable_call_times' where user_group='$OLDuser_group';"; $rslt=mysql_to_mysqli($stmt, $link); echo "
USER GROUP MODIFIED\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $ss_conf_ct = mysqli_num_rows($rslt); if ($ss_conf_ct > 0) { $row=mysqli_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" . mysqli_error());} #echo 'Connected successfully'; #mysql_select_db("$vtiger_dbname", $linkV); $linkV=mysqli_connect("$vtiger_server_ip", "$vtiger_login", "$vtiger_pass", "$vtiger_dbname"); if (!$linkV) { die('MySQL connect ERROR: ' . mysqli_error($linkV)); } ###################################### ##### BEGIN Add/Update group info in Vtiger $stmt="SELECT count(*) from vtiger_groups where groupname='$user_group';"; $rslt=mysql_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_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_to_mysqli($stmt, $linkV); if ($DB) {echo "$stmt\n";} if (!$rslt) {die('Could not execute: ' . mysqli_error());} $row=mysqli_fetch_row($rslt); $groupid = $row[0]; $stmtA = "UPDATE vtiger_groups SET description='$group_name' where groupid='$groupid';"; if ($DB) {echo "|$stmtA|\n";} $rslt=mysql_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmt, $linkV); $row=mysqli_fetch_row($rslt); $groupid = ($row[0] + 1); if (!$rslt) {die('Could not execute: ' . mysqli_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_to_mysqli($stmt, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_error());} $stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$user_group',description='$group_name';"; if ($DB) {echo "|$stmtA|\n";} $rslt=mysql_to_mysqli($stmtA, $linkV); if (!$rslt) {die('Could not execute: ' . mysqli_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 "\n"; echo "\n"; echo ""; if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) { echo "
SCRIPT NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
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='" . mysqli_real_escape_string($link, $script_text) . "', active='$active',user_group='$user_group' where script_id='$script_id';"; $rslt=mysql_to_mysqli($stmt, $link); echo "
SCRIPT MODIFIED\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 "\n"; echo "\n"; echo ""; if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) { echo "
FILTER NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
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='" . mysqli_real_escape_string($link, $lead_filter_sql) . "',user_group='$user_group' where lead_filter_id='$lead_filter_id';"; $rslt=mysql_to_mysqli($stmt, $link); echo "
FILTER MODIFIED\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) { echo "
CALL TIME NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
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',user_group='$user_group' where call_time_id='$call_time_id';"; $rslt=mysql_to_mysqli($stmt, $link); echo "
CALL TIME MODIFIED\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) { echo "
STATE CALL TIME NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
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',user_group='$user_group' where state_call_time_id='$call_time_id';"; $rslt=mysql_to_mysqli($stmt, $link); echo "
STATE CALL TIME MODIFIED\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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='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_to_mysqli($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=4211111111 modify holiday in the system ###################### if ($ADD==4211111111) { if ($LOGmodify_call_times==1) { echo ""; if ( (strlen($holiday_id) < 2) or (strlen($holiday_name) < 2) or (strlen($holiday_date) < 10) ) { echo "
HOLIDAY NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
Holiday ID, name and date must be populated\n"; } else { $ct_default_start = preg_replace('/\D/', '', $ct_default_start); $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); $stmt="UPDATE vicidial_call_time_holidays set holiday_name='$holiday_name', holiday_comments='$holiday_comments', holiday_date='$holiday_date', holiday_status='$holiday_status', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop',user_group='$user_group', default_afterhours_filename_override='$default_afterhours_filename_override' where holiday_id='$holiday_id';"; $rslt=mysql_to_mysqli($stmt, $link); echo "
HOLIDAY MODIFIED\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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='HOLIDAYS', event_type='MODIFY', record_id='$holiday_id', event_code='ADMIN MODIFY HOLIDAY', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); } } else { echo "You do not have permission to view this page\n"; exit; } $ADD=3211111111; # go to holiday modification form below } ###################### # ADD=431111111 modify shift in the system ###################### if ($ADD==431111111) { if ( ($LOGmodify_call_times==1) or ($LOGmodify_shifts==1) ) { echo ""; $shift_length_test = preg_replace('/:/i', '',$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 "
SHIFT DEFINITION NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
Shift ID and name must be at least 2 characters in length\n"; echo "
Shift Start Time must be 4 digits in length and be a valid time\n"; echo "
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',report_option='$report_option',user_group='$user_group',report_rank='$report_rank' where shift_id='$shift_id';"; $rslt=mysql_to_mysqli($stmt, $link); echo "
SHIFT MODIFIED\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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) or ($LOGmodify_phones==1) ) { echo ""; $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ( ($row[0] > 0) and ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) {echo "
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 "
PHONE NOT MODIFIED - Please go back and look at the data you entered\n";} else { $stmt="SELECT count(*) from vicidial_voicemail where voicemail_id='$voicemail_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
PHONE NOT MODIFIED - there is already a Voicemail ID in the system with this ID\n";} else { echo "
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='" . mysqli_real_escape_string($link, $local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysqli_real_escape_string($link, $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',user_group='$user_group',voicemail_greeting='$voicemail_greeting',voicemail_dump_exten_no_inst='$voicemail_dump_exten_no_inst' where extension='$old_extension' and server_ip='$old_server_ip';"; $rslt=mysql_to_mysqli($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_to_mysqli($stmtA, $link); $stmtB="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$SSactive_voicemail_server';"; $rslt=mysql_to_mysqli($stmtB, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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) or ($LOGmodify_phones==1) ) { echo ""; $stmt="SELECT count(*) from phones_alias where alias_id='$alias_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ( (strlen($alias_id) < 1) or (strlen($alias_name) < 2) ) {echo "
PHONE ALIAS NOT MODIFIED - Please go back and look at the data you entered\n";} else { echo "
PHONE ALIAS MODIFIED: $alias_id\n"; $stmt="UPDATE phones_alias set alias_name='$alias_name', logins_list='$logins_list', user_group='$user_group' where alias_id='$alias_id';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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) or ($LOGmodify_phones==1) ) { echo ""; $stmt="SELECT count(*) from groups_alias where group_alias_id='$group_alias_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ( (strlen($group_alias_id) < 1) or (strlen($group_alias_name) < 2) ) {echo "
GROUP ALIAS NOT MODIFIED - Please go back and look at the data you entered\n";} else { echo "
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',user_group='$user_group' where group_alias_id='$group_alias_id';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; $stmt="SELECT count(*) from servers where server_id='$server_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ( ($row[0] > 0) and ($server_id != $old_server_id) ) {echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ( ($row[0] > 0) and ($server_ip != $old_server_ip) ) {echo "
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 "
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',user_group='$user_group',auto_restart_asterisk='$auto_restart_asterisk',asterisk_temp_no_restart='$asterisk_temp_no_restart',voicemail_dump_exten_no_inst='$voicemail_dump_exten_no_inst' where server_id='$old_server_id';"; $rslt=mysql_to_mysqli($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_to_mysqli($stmtA, $link); echo "
SERVER MODIFIED: $server_ip\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; $stmt="SELECT max_vicidial_trunks from servers where server_ip='$server_ip';"; $rslt=mysql_to_mysqli($stmt, $link); $rowx=mysqli_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_to_mysqli($stmt, $link); $rowx=mysqli_fetch_row($rslt); $SUMvicidial_trunks = ($rowx[0] + $dedicated_trunks); if ($SUMvicidial_trunks > $MAXvicidial_trunks) { echo "
SERVER TRUNK RECORD NOT ADDED - the number of 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 "
SERVER TRUNK RECORD NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
campaign must be between 3 and 8 characters in length\n"; echo "
server_ip delay must be at least 7 characters\n"; echo "
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_to_mysqli($stmt, $link); echo "
SERVER TRUNK RECORD MODIFIED: $campaign_id - $server_ip - $dedicated_trunks - $trunk_restriction\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if ( (strlen($template_id) < 1) or (strlen($template_name) < 1) ) {echo "
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',user_group='$user_group' where template_id='$template_id';"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and user_group='$user_group';"; $rslt=mysql_to_mysqli($stmtA, $link); echo "
CONF TEMPLATE MODIFIED: $template_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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) or ($LOGmodify_carriers==1) ) { echo ""; if ( (strlen($carrier_id) < 1) or (strlen($server_ip) < 7) or (strlen($protocol) < 1) ) {echo "
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',user_group='$user_group' where carrier_id='$carrier_id';"; $rslt=mysql_to_mysqli($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_to_mysqli($stmtA, $link); echo "
CARRIER MODIFIED: $carrier_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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) or ($LOGmodify_tts==1) ) { echo ""; if ( (strlen($tts_id) < 2) or (strlen($tts_name) < 5) ) {echo "
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\",user_group='$user_group' where tts_id='$tts_id';"; $rslt=mysql_to_mysqli($stmt, $link); echo "
TTS ENTRY MODIFIED: $tts_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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) or ($LOGmodify_moh==1) ) { echo ""; 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 "
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_to_mysqli($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_to_mysqli($stmtA, $link); echo "
MUSIC ON HOLD ENTRY MODIFIED: $moh_id - $filename\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtA|"; $SQL_log = preg_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_to_mysqli($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 "
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',user_group='$user_group' where moh_id='$moh_id';"; $rslt=mysql_to_mysqli($stmt, $link); $stmtLIST = $stmt; $stmt="SELECT filename,rank from vicidial_music_on_hold_files where moh_id='$moh_id' order by rank;"; $rsltx=mysql_to_mysqli($stmt, $link); $mohfiles_to_print = mysqli_num_rows($rsltx); $ranks = ($mohfiles_to_print + 1); $o=0; while ($mohfiles_to_print > $o) { $rowx=mysqli_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_to_mysqli($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_to_mysqli($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_to_mysqli($stmtA, $link); echo "
MUSIC ON HOLD ENTRY MODIFIED: $moh_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtLIST|$stmtA|"; $SQL_log = preg_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_to_mysqli($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) or ($LOGmodify_voicemail==1) ) { echo ""; if ( (strlen($voicemail_id) < 2) or (strlen($fullname) < 2) ) {echo "
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',user_group='$user_group',voicemail_greeting='$voicemail_greeting' where voicemail_id='$voicemail_id';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "|$stmt|";} $stmt="SELECT active_voicemail_server from system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $active_voicemail_server = $row[0]; $sounds_updateSQL=''; if ($SSallow_voicemail_greeting > 0) {$sounds_updateSQL = ",sounds_update='Y'";} $stmtA="UPDATE servers SET rebuild_conf_files='Y'$sounds_updateSQL where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$active_voicemail_server';"; $rslt=mysql_to_mysqli($stmtA, $link); echo "
VOICEMAIL BOX MODIFIED: $voicemail_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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) or ($LOGmodify_labels==1) ) { echo ""; if ( (strlen($label_id) < 2) or (strlen($label_name) < 2) ) {echo "
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',user_group='$user_group' where label_id='$label_id';"; $rslt=mysql_to_mysqli($stmt, $link); echo "
SCREEN LABEL MODIFIED: $label_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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=491111111111 modify contact record in the system ###################### if ($ADD==491111111111) { if ( ($LOGmodify_servers==1) or ($LOGmodify_contacts==1) ) { echo ""; if (strlen($contact_id) < 1) {echo "
CONTACT NOT MODIFIED - Please go back and look at the data you entered\n";} else { if ( (preg_match("/contact_information/",$SStables_use_alt_log_db)) and (strlen($SSalt_log_server_ip)>4) and (strlen($SSalt_log_dbname)>0) ) { $linkALT=mysql_connect("$SSalt_log_server_ip", "$SSalt_log_login", "$SSalt_log_pass"); mysql_select_db("$SSalt_log_dbname", $linkALT); } else {$linkALT = $link;} $stmt="UPDATE contact_information set first_name='$first_name',last_name='$last_name',office_num='$office_num',cell_num='$cell_num',other_num1='$other_num1',other_num2='$other_num2',bu_name='$bu_name',department='$department',group_name='$group_name',job_title='$job_title',location='$location' where contact_id='$contact_id';"; $rslt=mysql_to_mysqli($stmt, $linkALT); echo "
CONTACT MODIFIED: $contact_id\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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='CONTACTS', event_type='MODIFY', record_id='$contact_id', event_code='ADMIN MODIFY CONTACT', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); } } else { echo "You do not have permission to view this page\n"; exit; } $ADD=391111111111; # go to contact entry modification form below } ###################### # ADD=4111111111111 modify conference record in the system ###################### if ($ADD==4111111111111) { if ($LOGast_admin_access==1) { echo ""; $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) {echo "
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 "
CONFERENCE NOT MODIFIED - Please go back and look at the data you entered\n";} else { echo "
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_to_mysqli($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 ""; $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ( ($row[0] > 0) and ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) {echo "
AGENT 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 "
AGENT CONFERENCE NOT MODIFIED - Please go back and look at the data you entered\n";} else { echo "
AGENT 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_to_mysqli($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 ""; echo "
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); $m=0; $altlog_count = count($tables_use_alt_log_db); $altlog_array = $tables_use_alt_log_db; while ($m < $altlog_count) { $new_altlog_value .= "$altlog_array[$m],"; $m++; } $tables_use_alt_log_db = preg_replace("/,$/","",$new_altlog_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='" . mysqli_real_escape_string($link, $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',noanswer_log='$noanswer_log',alt_log_server_ip='$alt_log_server_ip',alt_log_dbname='$alt_log_dbname',alt_log_login='$alt_log_login',alt_log_pass='$alt_log_pass',tables_use_alt_log_db='$tables_use_alt_log_db',did_agent_log='$did_agent_log',campaign_cid_areacodes_enabled='$campaign_cid_areacodes_enabled',pllb_grouping_limit='$pllb_grouping_limit',did_ra_extensions_enabled='$did_ra_extensions_enabled',expanded_list_stats='$expanded_list_stats',contacts_enabled='$contacts_enabled',call_menu_qualify_enabled='$call_menu_qualify_enabled',admin_list_counts='$admin_list_counts',allow_voicemail_greeting='$allow_voicemail_greeting',queuemetrics_socket='$queuemetrics_socket',queuemetrics_socket_url='$queuemetrics_socket_url',enhanced_disconnect_logging='$enhanced_disconnect_logging',allow_emails='$allow_emails',level_8_disable_add='$level_8_disable_add',queuemetrics_record_hold='$queuemetrics_record_hold',country_code_list_stats='$country_code_list_stats';"; $rslt=mysql_to_mysqli($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_to_mysqli($stmtB, $link); } ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|"; $SQL_log = preg_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_to_mysqli($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) or ($LOGmodify_statuses==1) ) { echo ""; if (preg_match('/delete/',$stage)) { if ( (strlen($status) < 1) or (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$status)) ) { echo "
SYSTEM STATUS NOT DELETED - Please go back and look at the data you entered\n"; echo "
the system status cannot be a reserved status: B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n"; echo "
the system status needs to be at least 1 characters in length\n"; } else { echo "
SYSTEM STATUS DELETED: $status\n"; $stmt="DELETE FROM vicidial_statuses where status='$status';"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="DELETE FROM vicidial_campaign_hotkeys where status='$status';"; $rslt=mysql_to_mysqli($stmtA, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } if (preg_match('/modify/', $stage)) { if ( (strlen($status) < 1) or (strlen($status_name) < 2) ) { echo "
SYSTEM STATUS NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
the system status needs to be at least 1 characters in length\n"; echo "
the system status name needs to be at least 1 characters in length\n"; } else { echo "
SYSTEM STATUS MODIFIED: $status\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',completed='$completed' where status='$status';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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) or ($LOGmodify_statuses==1) ) { echo ""; if ( (strlen($vsc_id) < 2) or (preg_match("/^UNDEFINED$/i",$vsc_id)) ) { echo "
STATUS CATEGORY NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
the status category cannot be a reserved category: UNDEFINED\n"; echo "
the status category needs to be at least 2 characters in length\n"; } else { if (preg_match('/delete/',$stage)) { echo "
STATUS CATEGORY DELETED: $vsc_id\n"; $stmt="DELETE FROM vicidial_status_categories where vsc_id='$vsc_id';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } if (preg_match('/modify/', $stage)) { echo "
STATUS CATEGORY MODIFIED: $vsc_id\n"; $stmt="SELECT count(*) from vicidial_status_categories where tovdad_display='Y' and vsc_id NOT IN('$vsc_id');"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ( ($row[0] > 3) and (preg_match('/Y/',$tovdad_display)) ) { $tovdad_display = 'N'; echo "
ERROR: There are already 4 Status Categories set to TimeOnVDAD Display\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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if (preg_match('/delete/',$stage)) { if ( (strlen($code) < 1) or (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$code)) ) { echo "
QC STATUS CODE NOT DELETED - Please go back and look at the data you entered\n"; echo "
the qc status code cannot be a reserved status: B,NA,DNC,NA,DROP,INCALL,QUEUE,NEW\n"; echo "
the qc status code needs to be at least 1 characters in length\n"; } else { echo "
QC STATUS CODE DELETED: $code\n"; $stmt="DELETE FROM vicidial_qc_codes where code='$code';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } if (preg_match('/modify/', $stage)) { if ( (strlen($code) < 1) or (strlen($code_name) < 2) ) { echo "
QC STATUS CODE NOT MODIFIED - Please go back and look at the data you entered\n"; echo "
the qc status code needs to be at least 1 characters in length\n"; echo "
the qc status code name needs to be at least 1 characters in length\n"; } else { echo "
QC STATUS CODE MODIFIED: $code\n"; $stmt="UPDATE vicidial_qc_codes SET code_name='$code_name' where code='$code';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if ( (strlen($user) < 2) or ($LOGdelete_users < 1) ) { echo "
USER NOT DELETED - Please go back and look at the data you entered\n"; echo "
User be at least 2 characters in length\n"; } else { echo "
USER DELETION CONFIRMATION: $user\n"; echo "

Click here to delete user $user


\n"; } $ADD='3'; # go to user modification below } ###################### # ADD=51 confirmation before deletion of campaign ###################### if ($ADD==51) { echo ""; if ( (strlen($campaign_id) < 2) or ($LOGdelete_campaigns < 1) ) { echo "
CAMPAIGN NOT DELETED - Please go back and look at the data you entered\n"; echo "
Campaign_id be at least 2 characters in length\n"; } else { echo "
CAMPAIGN DELETION CONFIRMATION: $campaign_id\n"; echo "

Click here to delete campaign $campaign_id


\n"; } $ADD='31'; # go to campaign modification below } ###################### # ADD=52 confirmation before logging all agents out of campaign of campaign ###################### if ($ADD==52) { echo ""; if (strlen($campaign_id) < 2) { echo "
AGENTS NOT LOGGED OUT OF CAMPAIGN - Please go back and look at the data you entered\n"; echo "
Campaign_id be at least 2 characters in length\n"; } else { echo "
AGENT LOGOUT CONFIRMATION: $campaign_id\n"; echo "

Click here to log all agents out of $campaign_id


\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 (preg_match('/IN/i', $stage)) {$group_id=$campaign_id;} echo ""; if (strlen($campaign_id) < 2) { echo "
VDAC NOT CLEARED FOR CAMPAIGN - Please go back and look at the data you entered\n"; echo "
Campaign_id be at least 2 characters in length\n"; } else { echo "
VDAC CLEAR CONFIRMATION: $campaign_id\n"; echo "

Click here to delete the oldest LIVE record in VDAC for $campaign_id


\n"; } # go to campaign modification below if (preg_match('/IN/i', $stage)) {$ADD='3111';} else {$ADD='31';} } ###################### # ADD=511 confirmation before deletion of list ###################### if ($ADD==511) { echo ""; if ( (strlen($list_id) < 2) or ($LOGdelete_lists < 1) ) { echo "
LIST NOT DELETED - Please go back and look at the data you entered\n"; echo "
List_id be at least 2 characters in length\n"; } else { echo "
LIST DELETION CONFIRMATION: $list_id\n"; echo "

Click here to delete list and all of its leads $list_id


\n"; } $ADD='311'; # go to campaign modification below } ###################### # ADD=5111 confirmation before deletion of in-group ###################### if ($ADD==5111) { echo ""; if ( (strlen($group_id) < 2) or ($LOGdelete_ingroups < 1) ) { echo "
IN-GROUP NOT DELETED - Please go back and look at the data you entered\n"; echo "
Group_id be at least 2 characters in length\n"; } else { echo "
IN-GROUP DELETION CONFIRMATION: $group_id\n"; echo "

Click here to delete in-group $group_id


\n"; } $ADD='3111'; # go to in-group modification below } ###################### # ADD=5311 confirmation before deletion of did ###################### if ($ADD==5311) { echo ""; if ( (strlen($did_id) < 1) or ($LOGdelete_dids < 1) ) { echo "
DID NOT DELETED - Please go back and look at the data you entered\n"; echo "
did_id be at least 1 characters in length\n"; } else { echo "
DID DELETION CONFIRMATION: $menu_id\n"; echo "

Click here to delete DID $did_id


\n"; } $ADD='3311'; # go to did modification below } ###################### # ADD=5511 confirmation before deletion of call menu ###################### if ($ADD==5511) { echo ""; if ( (strlen($menu_id) < 2) or ($LOGdelete_dids < 1) ) { echo "
CALL MENU NOT DELETED - Please go back and look at the data you entered\n"; echo "
menu_id be at least 2 characters in length\n"; } else { echo "
CALL MENU DELETION CONFIRMATION: $menu_id\n"; echo "

Click here to delete CALL MENU $menu_id


\n"; } $ADD='3511'; # go to call menu modification below } ###################### # ADD=5711 confirmation before deletion of filter phone group ###################### if ($ADD==5711) { echo ""; if ( (strlen($filter_phone_group_id) < 2) or ($LOGdelete_dids < 1) ) { echo "
FILTER PHONE GROUP NOT DELETED - Please go back and look at the data you entered\n"; echo "
filter_phone_group_id be at least 2 characters in length\n"; } else { echo "
FILTER PHONE GROUP DELETION CONFIRMATION: $filter_phone_group_id\n"; echo "

Click here to delete FILTER PHONE GROUP $filter_phone_group_id


\n"; } $ADD='3711'; # go to filter phone group modification below } ###################### # ADD=51111 confirmation before deletion of remote agent record ###################### if ($ADD==51111) { echo ""; if ( (strlen($remote_agent_id) < 1) or ($LOGdelete_remote_agents < 1) ) { echo "
REMOTE AGENT NOT DELETED - Please go back and look at the data you entered\n"; echo "
Remote_agent_id be at least 2 characters in length\n"; } else { echo "
REMOTE AGENT DELETION CONFIRMATION: $remote_agent_id\n"; echo "

Click here to delete remote agent $remote_agent_id


\n"; } $ADD='31111'; # go to remote agent modification below } ###################### # ADD=52111 confirmation before deletion of extension group record ###################### if ($ADD==52111) { echo ""; if ( (strlen($extension_id) < 1) or ($LOGdelete_remote_agents < 1) ) { echo "
EXTENSION GROUP ENTRY NOT DELETED - Please go back and look at the data you entered\n"; echo "
extension_id be at least 1 characters in length\n"; } else { echo "
EXTENSION GROUP ENTRY DELETION CONFIRMATION: $extension_id\n"; echo "

Click here to delete extension group entry $extension_id


\n"; } $ADD='32111'; # go to extension group modification below } ###################### # ADD=511111 confirmation before deletion of user group record ###################### if ($ADD==511111) { echo ""; if ( (strlen($user_group) < 2) or ($LOGdelete_user_groups < 1) ) { echo "
USER GROUP NOT DELETED - Please go back and look at the data you entered\n"; echo "
User_group be at least 2 characters in length\n"; } else { echo "
USER GROUP DELETION CONFIRMATION: $user_group\n"; echo "

Click here to delete user group $user_group


\n"; } $ADD='311111'; # go to user group modification below } ###################### # ADD=5111111 confirmation before deletion of script record ###################### if ($ADD==5111111) { echo ""; if ( (strlen($script_id) < 2) or ($LOGdelete_scripts < 1) ) { echo "
SCRIPT NOT DELETED - Please go back and look at the data you entered\n"; echo "
Script_id must be at least 2 characters in length\n"; } else { echo "
SCRIPT DELETION CONFIRMATION: $script_id\n"; echo "

Click here to delete script $script_id


\n"; } $ADD='3111111'; # go to script modification below } ###################### # ADD=51111111 confirmation before deletion of filter record ###################### if ($ADD==51111111) { echo ""; if ( (strlen($lead_filter_id) < 2) or ($LOGdelete_filters < 1) ) { echo "
FILTER NOT DELETED - Please go back and look at the data you entered\n"; echo "
Filter ID must be at least 2 characters in length\n"; } else { echo "
FILTER DELETION CONFIRMATION: $lead_filter_id\n"; echo "

Click here to delete filter $lead_filter_id


\n"; } $ADD='31111111'; # go to filter modification below } ###################### # ADD=511111111 confirmation before deletion of call time record ###################### if ($ADD==511111111) { echo ""; if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) { echo "
CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; echo "
Call Time ID must be at least 2 characters in length\n"; } else { echo "
CALL TIME DELETION CONFIRMATION: $call_time_id\n"; echo "

Click here to delete call time $call_time_id


\n"; } $ADD='311111111'; # go to call time modification below } ###################### # ADD=5111111111 confirmation before deletion of state call time record ###################### if ($ADD==5111111111) { echo ""; if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) { echo "
STATE CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; echo "
Call Time ID must be at least 2 characters in length\n"; } else { echo "
STATE CALL TIME DELETION CONFIRMATION: $call_time_id\n"; echo "

Click here to delete state call time $call_time_id


\n"; } $ADD='3111111111'; # go to state call time modification below } ###################### # ADD=5211111111 confirmation before deletion of holiday record ###################### if ($ADD==5211111111) { echo ""; if ( (strlen($holiday_id) < 2) or ($LOGdelete_call_times < 1) ) { echo "
HOLIDAY NOT DELETED - Please go back and look at the data you entered\n"; echo "
Holiday ID must be at least 2 characters in length\n"; } else { echo "
HOLIDAY DELETION CONFIRMATION: $holiday_id\n"; echo "

Click here to delete holiday $holiday_id


\n"; } $ADD='3211111111'; # go to holiday modification below } ###################### # ADD=531111111 confirmation before deletion of shift record ###################### if ($ADD==531111111) { echo ""; if ( (strlen($shift_id) < 2) or ($LOGdelete_call_times < 1) ) { echo "
SHIFT NOT DELETED - Please go back and look at the data you entered\n"; echo "
Shift ID must be at least 2 characters in length\n"; } else { echo "
SHIFT DELETION CONFIRMATION: $shift_id\n"; echo "

Click here to delete shift $shift_id


\n"; } $ADD='331111111'; # go to call time modification below } ###################### # ADD=51111111111 confirmation before deletion of phone record ###################### if ($ADD==51111111111) { echo ""; if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($LOGast_delete_phones < 1) ) { echo "
PHONE NOT DELETED - Please go back and look at the data you entered\n"; echo "
Extension be at least 2 characters in length\n"; echo "
Server IP be at least 7 characters in length\n"; } else { echo "
PHONE DELETION CONFIRMATION: $extension - $server_ip\n"; echo "

Click here to delete phone $extension - $server_ip


\n"; } $ADD='31111111111'; # go to phone modification below } ###################### # ADD=52111111111 confirmation before deletion of phone alias record ###################### if ($ADD==52111111111) { echo ""; if ( (strlen($alias_id) < 1) or ($LOGast_delete_phones < 1) ) { echo "
PHONE ALIAS NOT DELETED - Please go back and look at the data you entered\n"; echo "
Alias ID must be at least 2 characters in length\n"; } else { echo "
PHONE ALIAS DELETION CONFIRMATION: $alias_id\n"; echo "

Click here to delete phone alias $alias_id


\n"; } $ADD='32111111111'; # go to phone alias modification below } ###################### # ADD=53111111111 confirmation before deletion of group alias record ###################### if ($ADD==53111111111) { echo ""; if ( (strlen($group_alias_id) < 1) or ($LOGast_delete_phones < 1) ) { echo "
GROUP ALIAS NOT DELETED - Please go back and look at the data you entered\n"; echo "
Group Alias ID must be at least 2 characters in length\n"; } else { echo "
GROUP ALIAS DELETION CONFIRMATION: $group_alias_id\n"; echo "

Click here to delete group alias $group_alias_id


\n"; } $ADD='33111111111'; # go to group alias modification below } ###################### # ADD=511111111111 confirmation before deletion of server record ###################### if ($ADD==511111111111) { echo ""; if ( (strlen($server_id) < 2) or (strlen($server_ip) < 7) or ($LOGast_delete_phones < 1) ) { echo "
SERVER NOT DELETED - Please go back and look at the data you entered\n"; echo "
Server ID be at least 2 characters in length\n"; echo "
Server IP be at least 7 characters in length\n"; } else { echo "
SERVER DELETION CONFIRMATION: $server_id - $server_ip\n"; echo "

Click here to delete phone $server_id - $server_ip


\n"; } $ADD='311111111111'; # go to server modification below } ###################### # ADD=531111111111 confirmation before deletion of conf template record ###################### if ($ADD==531111111111) { echo ""; if (strlen($template_id) < 2) { echo "
CONF TEMPLATE NOT DELETED - Please go back and look at the data you entered\n"; echo "
Template ID be at least 2 characters in length\n"; } else { echo "
CONF TEMPLATE DELETION CONFIRMATION: $template_id - $template_name\n"; echo "

Click here to delete conf template $template_id - $template_name


\n"; } $ADD='331111111111'; # go to conf template modification below } ###################### # ADD=541111111111 confirmation before deletion of carrier record ###################### if ($ADD==541111111111) { echo ""; if (strlen($carrier_id) < 2) { echo "
CARRIER NOT DELETED - Please go back and look at the data you entered\n"; echo "
Carrier ID be at least 2 characters in length\n"; } else { echo "
CARRIER DELETION CONFIRMATION: $carrier_id - $carrier_name\n"; echo "

Click here to delete carrier $carrier_id - $carrier_name


\n"; } $ADD='341111111111'; # go to carrier modification below } ###################### # ADD=551111111111 confirmation before deletion of tts record ###################### if ($ADD==551111111111) { echo ""; if (strlen($tts_id) < 2) { echo "
TTS ENTRY NOT DELETED - Please go back and look at the data you entered\n"; echo "
TTS ID be at least 2 characters in length\n"; } else { echo "
TTS ENTRY DELETION CONFIRMATION: $tts_id - $tts_name\n"; echo "

Click here to delete tts entry $tts_id - $tts_name


\n"; } $ADD='351111111111'; # go to tts entry modification below } ###################### # ADD=561111111111 confirmation before deletion of music on hold record ###################### if ($ADD==561111111111) { echo ""; if (strlen($moh_id) < 2) { echo "
MUSIC ON HOLD ENTRY NOT DELETED - Please go back and look at the data you entered\n"; echo "
MOH ID be at least 2 characters in length\n"; } else { echo "
MUSIC ON HOLD ENTRY DELETION CONFIRMATION: $moh_id - $moh_name\n"; echo "

Click here to delete music on hold entry $moh_id - $moh_name


\n"; } $ADD='361111111111'; # go to music on hold entry modification below } ###################### # ADD=571111111111 confirmation before deletion of voicemail record ###################### if ($ADD==571111111111) { echo ""; if (strlen($voicemail_id) < 2) { echo "
VOICEMAIL BOX NOT DELETED - Please go back and look at the data you entered\n"; echo "
Voicemail ID be at least 2 characters in length\n"; } else { echo "
VOICEMAIL BOX DELETION CONFIRMATION: $voicemail_id - $fullname\n"; echo "

Click here to delete voicemail box $voicemail_id - $fullname


\n"; } $ADD='371111111111'; # go to voicemail entry modification below } ###################### # ADD=581111111111 confirmation before deletion of screen label record ###################### if ($ADD==581111111111) { echo ""; if (strlen($label_id) < 2) { echo "
SCREEN LABEL NOT DELETED - Please go back and look at the data you entered\n"; echo "
Label ID be at least 2 characters in length\n"; } else { echo "
SCREEN LABEL DELETION CONFIRMATION: $label_id - $label_name\n"; echo "

Click here to delete screen label $label_id - $label_name


\n"; } $ADD='381111111111'; # go to screen label entry modification below } ###################### # ADD=591111111111 confirmation before deletion of contact record ###################### if ($ADD==591111111111) { echo ""; if (strlen($contact_id) < 1) { echo "
CONTACT NOT DELETED - Please go back and look at the data you entered\n"; echo "
Contact ID must be at least 1 character in length\n"; } else { echo "
CONTACT DELETION CONFIRMATION: $contact_id - $first_name - $last_name\n"; echo "

Click here to delete contact $contact_id - $first_name - $last_name


\n"; } $ADD='391111111111'; # go to contact entry modification below } ###################### # ADD=5111111111111 confirmation before deletion of conference record ###################### if ($ADD==5111111111111) { echo ""; if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($LOGast_delete_phones < 1) ) { echo "
CONFERENCE NOT DELETED - Please go back and look at the data you entered\n"; echo "
Conference must be at least 2 characters in length\n"; echo "
Server IP be at least 7 characters in length\n"; } else { echo "
CONFERENCE DELETION CONFIRMATION: $conf_exten - $server_ip\n"; echo "

Click here to delete phone $conf_exten - $server_ip


\n"; } $ADD='3111111111111'; # go to conference modification below } ###################### # ADD=51111111111111 confirmation before deletion of vicidial conference record ###################### if ($ADD==51111111111111) { echo ""; if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($LOGast_delete_phones < 1) ) { echo "
AGENT CONFERENCE NOT DELETED - Please go back and look at the data you entered\n"; echo "
Conference must be at least 2 characters in length\n"; echo "
Server IP be at least 7 characters in length\n"; } else { echo "
AGENT CONFERENCE DELETION CONFIRMATION: $conf_exten - $server_ip\n"; echo "

Click here to delete phone $conf_exten - $server_ip


\n"; } $ADD='31111111111111'; # go to vicidial conference modification below } ###################################################################################################### ###################################################################################################### ####### 6 series, delete records ###################################################################################################### ###################################################################################################### ###################### # ADD=6 delete user record ###################### if ($ADD==6) { echo ""; if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) { echo "
USER NOT DELETED - Please go back and look at the data you entered\n"; echo "
User be at least 2 characters in length\n"; } else { if ( ($LOGmodify_same_user_level < 1) and ($user=='$PHP_AUTH_USER') ) { echo "You are not allowed to edit your own user\n"; exit; } else { $stmtA="DELETE from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($stmtA, $link); $stmt="DELETE from vicidial_campaign_agents where user='$user';"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_inbound_group_agents where user='$user';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
USER DELETION COMPLETED: $user\n"; echo "

\n"; } } $ADD='0'; # go to user list } ###################### # ADD=61 delete campaign record ###################### if ($ADD==61) { echo ""; if ( ( strlen($campaign_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_campaigns < 1) ) { echo "
CAMPAIGN NOT DELETED - Please go back and look at the data you entered\n"; echo "
Campaign_id be at least 2 characters in length\n"; } else { $stmtA="DELETE from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL limit 1;"; $rslt=mysql_to_mysqli($stmtA, $link); $stmt="DELETE from vicidial_campaign_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_campaign_hotkeys where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_callbacks where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_campaign_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_lead_recycle where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_campaign_server_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_server_trunks where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_pause_codes where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_xfer_presets where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_xfer_stats where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_campaign_cid_areacodes where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); echo "
REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($campaign_id)\n"; $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
CAMPAIGN DELETION COMPLETED: $campaign_id\n"; echo "

\n"; } $ADD='10'; # go to campaigns list } ###################### # ADD=62 Logout all agents from a campaign ###################### if ($ADD==62) { if ($LOGmodify_campaigns==1) { echo ""; if (strlen($campaign_id) < 2) { echo "
AGENTS NOT LOGGED OUT OF CAMPAIGN - Please go back and look at the data you entered\n"; echo "
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' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "
$stmt\n";} $vla_ct = mysqli_num_rows($rslt); $k=0; while ($vla_ct > $k) { $row=mysqli_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_to_mysqli($stmt, $link); if ($DB) {echo "
$stmt\n";} $val_ct = mysqli_num_rows($rslt); if ($val_ct > 0) { $row=mysqli_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
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 "
$stmt\n";} $rslt=mysql_to_mysqli($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 "
$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); } } $stmt="DELETE from vicidial_live_agents where user='$VLA_user[$k]';"; if ($DB) {echo "
$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if (strlen($VAL_user_group) < 1) { $stmt = "SELECT user_group FROM vicidial_users where user='$VLA_user[$k]' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "
$stmt\n";} $val_ct = mysqli_num_rows($rslt); if ($val_ct > 0) { $row=mysqli_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 "
$stmt\n";} $rslt=mysql_to_mysqli($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_to_mysqli($stmt, $link); if ($DB) {echo "
$stmt\n";} $qm_conf_ct = mysqli_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysqli_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_to_mysqli($stmtB, $linkB); if ($DB) {echo "
$stmtB\n";} $qml_ct = mysqli_num_rows($rsltB); if ($qml_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $linkB); $affected_rows = mysqli_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]' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "
$stmt\n";} $cqpe_ct = mysqli_num_rows($rslt); if ($cqpe_ct > 0) { $row=mysqli_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_to_mysqli($stmtB, $linkB); if ($DB) {echo "
$stmtB\n";} $qml_ct = mysqli_num_rows($rsltB); if ($qml_ct > 0) { $row=mysqli_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_to_mysqli($stmt, $linkB); if ($DB) {echo "$stmt\n";} $amq_conf_ct = mysqli_num_rows($rslt); $i=0; while ($i < $amq_conf_ct) { $row=mysqli_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_to_mysqli($stmt, $linkB); $affected_rows = mysqli_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 "
$stmtB\n";} $rsltB=mysql_to_mysqli($stmtB, $linkB); } } echo "\n"; $k++; } ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
AGENT LOGOUT COMPLETED: $campaign_id\n"; echo "

\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 (preg_match('/IN/i', $stage)) {$group_id=$campaign_id;} echo ""; if (strlen($campaign_id) < 2) { echo "
VDAC NOT CLEARED FOR CAMPAIGN - Please go back and look at the data you entered\n"; echo "
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' $LOGallowed_campaignsSQL order by call_time limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
LAST VDAC RECORD CLEARED FOR CAMPAIGN: $campaign_id\n"; echo "

\n"; } } else { echo "You do not have permission to view this page\n"; exit; } # go to campaign modification below if (preg_match('/IN/i', $stage)) {$ADD='3111';} else {$ADD='31';} } ###################### # ADD=65 delete campaign lead recycle in the system ###################### if ($ADD==65) { if ($LOGmodify_campaigns==1) { echo ""; if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) { echo "
CAMPAIGN LEAD RECYCLE NOT DELETED - Please go back and look at the data you entered\n"; echo "
status must be between 1 and 6 characters in length\n"; echo "
attempt delay must be at least 120 seconds\n"; echo "
maximum attempts must be from 1 to 10\n"; } else { echo "
CAMPAIGN LEAD RECYCLE DELETED: $campaign_id - $status - $attempt_delay\n"; $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial_statuses LIKE \"% $status %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] < 1) {echo "
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 "
AUTO ALT DIAL STATUS NOT DELETED - Please go back and look at the data you entered\n"; echo "
status must be between 1 and 6 characters in length\n"; } else { echo "
AUTO ALT DIAL STATUS DELETED: $campaign_id - $status\n"; $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $auto_alt_dial_statuses = preg_replace("/\s$status\s/i", " ",$row[0]); $stmt="UPDATE vicidial_campaigns set auto_alt_dial_statuses='$auto_alt_dial_statuses' where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) ) { echo "
CAMPAIGN PAUSE CODE NOT DELETED - Please go back and look at the data you entered\n"; echo "
pause code must be between 1 and 6 characters in length\n"; } else { echo "
CAMPAIGN PAUSE CODE DELETED: $campaign_id - $pause_code\n"; $stmt="DELETE FROM vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and dial_statuses LIKE \"% $status %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] < 1) {echo "
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 "
CAMPAIGN DIAL STATUS NOT REMOVED - Please go back and look at the data you entered\n"; echo "
status must be between 1 and 6 characters in length\n"; } else { echo "
CAMPAIGN DIAL STATUS REMOVED: $campaign_id - $status\n"; $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $dial_statuses = preg_replace("/\s$status\s/i", " ",$row[0]); $stmt="UPDATE vicidial_campaigns set dial_statuses='$dial_statuses' where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) ) { echo "
CAMPAIGN PRESET NOT DELETED - Please go back and look at the data you entered\n"; echo "
preset name must be between 1 and 40 characters in length\n"; } else { echo "
CAMPAIGN PRESET DELETED: $campaign_id - $preset_name\n"; $stmt="DELETE FROM vicidial_xfer_presets where campaign_id='$campaign_id' and preset_name='$preset_name' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE FROM vicidial_xfer_stats where campaign_id='$campaign_id' and preset_name='$preset_name' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if ( ( strlen($list_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_lists < 1) ) { echo "
LIST NOT DELETED - Please go back and look at the data you entered\n"; echo "
List_id be at least 2 characters in length\n"; } else { $stmt="DELETE from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); echo "
REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($list_id)\n"; $stmt="DELETE from vicidial_hopper where list_id='$list_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); echo "
REMOVING LIST LEADS FROM LIST TABLE\n"; $stmt="DELETE from vicidial_list where list_id='$list_id';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
LIST DELETION COMPLETED: $list_id\n"; echo "

\n"; } $ADD='100'; # go to lists list } ###################### # ADD=6111 delete in-group record ###################### if ($ADD==6111) { echo ""; if ( (strlen($group_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_ingroups < 1) ) { echo "
IN-GROUP NOT DELETED - Please go back and look at the data you entered\n"; echo "
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') $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($stmtA, $link); $stmt="DELETE from vicidial_inbound_group_agents where group_id='$group_id';"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_live_inbound_agents where group_id='$group_id';"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_campaign_stats where campaign_id='$group_id';"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_campaign_stats_debug where campaign_id='$group_id';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
IN-GROUP DELETION COMPLETED: $group_id\n"; echo "

\n"; } $ADD='1000'; # go to in-group list } ###################### # ADD=6311 delete did record ###################### if ($ADD==6311) { echo ""; if ( (strlen($did_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_dids < 1) ) { echo "
DID NOT DELETED - Please go back and look at the data you entered\n"; echo "
did_id be at least 1 characters in length\n"; } else { $stmt="DELETE from vicidial_inbound_dids where did_id='$did_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
DID DELETION COMPLETED: $did_id\n"; echo "

\n"; } $ADD='1300'; # go to did list } ###################### # ADD=6511 delete call menu record ###################### if ($ADD==6511) { echo ""; if ( (strlen($menu_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_dids < 1) ) { echo "
CALL MENU NOT DELETED - Please go back and look at the data you entered\n"; echo "
menu_id be at least 1 characters in length\n"; } else { $stmt="DELETE from vicidial_call_menu where menu_id='$menu_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="DELETE from vicidial_call_menu_options where menu_id='$menu_id' limit 17;"; $rslt=mysql_to_mysqli($stmtA, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtA"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
CALL MENU DELETION COMPLETED: $menu_id\n"; echo "

\n"; } $ADD='1500'; # go to call menu list } ###################### # ADD=6711 delete filter phone group record ###################### if ($ADD==6711) { echo ""; if ( (strlen($filter_phone_group_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_dids < 1) ) { echo "
FILTER PHONE GROUP NOT DELETED - Please go back and look at the data you entered\n"; echo "
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' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="DELETE from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; $rslt=mysql_to_mysqli($stmtA, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtA"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
FILTER PHONE GROUP DELETION COMPLETED: $filter_phone_group_id\n"; echo "

\n"; } $ADD='1700'; # go to filter phone group list } ###################### # ADD=61111 delete remote agent record ###################### if ($ADD==61111) { echo ""; if ( (strlen($remote_agent_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) { echo "
REMOTE AGENT NOT DELETED - Please go back and look at the data you entered\n"; echo "
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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
REMOTE AGENT DELETION COMPLETED: $remote_agent_id\n"; echo "

\n"; } $ADD='10000'; # go to remote agents list } ###################### # ADD=62111 delete extension group record ###################### if ($ADD==62111) { echo ""; if ( (strlen($extension_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) { echo "
EXTENSION GROUP ENTRY NOT DELETED - Please go back and look at the data you entered\n"; echo "
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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
EXTENSION GROUP ENTRY DELETION COMPLETED: $extension_id\n"; echo "

\n"; } $ADD='12000'; # go to extension group list } ###################### # ADD=611111 delete user group record ###################### if ($ADD==611111) { echo ""; if ( (strlen($user_group) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_user_groups < 1) ) { echo "
USER GROUP NOT DELETED - Please go back and look at the data you entered\n"; echo "
User_group be at least 2 characters in length\n"; } else { if ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) { echo "You are not allowed to edit your own user group\n"; exit; } else { $stmt="DELETE from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
USER GROUP DELETION COMPLETED: $user_group\n"; echo "

\n"; } } $ADD='100000'; # go to user group list } ###################### # ADD=6111111 delete script record ###################### if ($ADD==6111111) { echo ""; if ( (strlen($script_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_scripts < 1) ) { echo "
SCRIPT NOT DELETED - Please go back and look at the data you entered\n"; echo "
Script_id be at least 2 characters in length\n"; } else { $stmt="DELETE from vicidial_scripts where script_id='$script_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
SCRIPT DELETION COMPLETED: $script_id\n"; echo "

\n"; } $ADD='1000000'; # go to script list } ###################### # ADD=61111111 delete filter record ###################### if ($ADD==61111111) { echo ""; if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) { echo "
FILTER NOT DELETED - Please go back and look at the data you entered\n"; echo "
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' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
FILTER DELETION COMPLETED: $lead_filter_id\n"; echo "

\n"; } $ADD='10000000'; # go to filter list } ###################### # ADD=611111111 delete call times record ###################### if ($ADD==611111111) { echo ""; if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) { echo "
CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; echo "
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' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
CALL TIME DELETION COMPLETED: $call_time_id\n"; echo "

\n"; } $ADD='100000000'; # go to call times list } ###################### # ADD=6111111111 delete state call times record ###################### if ($ADD==6111111111) { echo ""; if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) { echo "
STATE CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; echo "
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' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($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_to_mysqli($stmt, $link); $sct_to_print = mysqli_num_rows($rslt); $sct_list=''; $o=0; while ($sct_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $sct_ids[$o] = "$rowx[0]"; $sct_states[$o] = "$rowx[1]"; $o++; } $o=0; while ($sct_to_print > $o) { $sct_states[$o] = preg_replace("/\|$call_time_id\|/i", '|',$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_to_mysqli($stmt, $link); echo "$stmt\n"; echo "State Rule Removed: $sct_ids[$o]
\n"; $o++; } ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
STATE CALL TIME DELETION COMPLETED: $call_time_id\n"; echo "

\n"; } $ADD='1000000000'; # go to call times list } ###################### # ADD=6211111111 delete holiday record ###################### if ($ADD==6211111111) { echo ""; if ( (strlen($holiday_id) < 2) or ($LOGdelete_call_times < 1) ) { echo "
HOLIDAY NOT DELETED - Please go back and look at the data you entered\n"; echo "
Holiday ID must be at least 2 characters in length\n"; } else { $stmtA="DELETE from vicidial_call_time_holidays where holiday_id='$holiday_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($stmtA, $link); $stmt="SELECT call_time_id,ct_holidays from vicidial_call_times where ct_holidays LIKE \"%|$holiday_id|%\" order by call_time_id;"; $rslt=mysql_to_mysqli($stmt, $link); $hct_to_print = mysqli_num_rows($rslt); $hct_list=''; $o=0; while ($hct_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $hct_ids[$o] = "$rowx[0]"; $hct_holidays[$o] = "$rowx[1]"; $o++; } $o=0; while ($hct_to_print > $o) { $hct_holidays[$o] = preg_replace("/\|$holiday_id\|/i", '|',$hct_holidays[$o]); $stmt="UPDATE vicidial_call_times set ct_holidays='$hct_holidays[$o]' where call_time_id='$hct_ids[$o]';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "|$stmt|\n";} echo "Holiday Rule Removed: $hct_ids[$o]
\n"; $o++; } ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = preg_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='HOLIDAYS', event_type='DELETE', record_id='$holiday_id', event_code='ADMIN DELETE HOLIDAY', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); echo "
HOLIDAY DELETION COMPLETED: $holiday_id\n"; echo "

\n"; } $ADD='1200000000'; # go to holidays list } ###################### # ADD=631111111 delete shift record ###################### if ($ADD==631111111) { echo ""; if ( (strlen($shift_id) < 2) or ($LOGdelete_call_times < 1) ) { echo "
SHIFT NOT DELETED - Please go back and look at the data you entered\n"; echo "
Shift ID must be at least 2 characters in length\n"; } else { $stmt="DELETE from vicidial_shifts where shift_id='$shift_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
SHIFT DELETION COMPLETED: $shift_id\n"; echo "

\n"; } $ADD='130000000'; # go to shifts list } ###################### # ADD=61111111111 delete phone record ###################### if ($ADD==61111111111) { echo ""; if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { echo "
PHONE NOT DELETED - Please go back and look at the data you entered\n"; echo "
Extension be at least 2 characters in length\n"; echo "
Server IP be at least 7 characters in length\n"; } else { $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($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_to_mysqli($stmtA, $link); $stmtB="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$SSactive_voicemail_server';"; $rslt=mysql_to_mysqli($stmtB, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
PHONE DELETION COMPLETED: $extension - $server_ip\n"; echo "

\n"; } $ADD='10000000000'; # go to phone list } ###################### # ADD=62111111111 delete phone alias record ###################### if ($ADD==62111111111) { echo ""; if ( (strlen($alias_id) < 2) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { echo "
PHONE ALIAS NOT DELETED - Please go back and look at the data you entered\n"; echo "
Alias ID must be at least 2 characters in length\n"; } else { $stmt="DELETE from phones_alias where alias_id='$alias_id' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
PHONE ALIAS DELETION COMPLETED: $alias_id\n"; echo "

\n"; } $ADD='12000000000'; # go to phone alias list } ###################### # ADD=63111111111 delete group alias record ###################### if ($ADD==63111111111) { echo ""; if ( (strlen($group_alias_id) < 2) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { echo "
GROUP ALIAS NOT DELETED - Please go back and look at the data you entered\n"; echo "
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' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
GROUP ALIAS DELETION COMPLETED: $group_alias_id\n"; echo "

\n"; } $ADD='13000000000'; # go to group alias list } ###################### # ADD=611111111111 delete server record ###################### if ($ADD==611111111111) { echo ""; if ( (strlen($server_id) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { echo "
SERVER NOT DELETED - Please go back and look at the data you entered\n"; echo "
Server ID be at least 2 characters in length\n"; echo "
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' $LOGadmin_viewable_groupsSQL limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
SERVER DELETION COMPLETED: $server_id - $server_ip\n"; echo "

\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 ""; if ( (strlen($campaign_id) < 2) or (strlen($server_ip) < 7) ) { echo "
SERVER TRUNK RECORD NOT DELETED - Please go back and look at the data you entered\n"; echo "
campaign must be between 3 and 8 characters in length\n"; echo "
server_ip delay must be at least 7 characters\n"; } else { echo "
SERVER TRUNK RECORD DELETED: $campaign_id - $server_ip\n"; $stmt="DELETE FROM vicidial_server_trunks where campaign_id='$campaign_id' and server_ip='$server_ip';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($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 ""; if ( (strlen($template_id) < 2) or ($CoNfIrM != 'YES') ) { echo "
CONF TEMPLATE NOT DELETED - Please go back and look at the data you entered\n"; echo "
Template ID be at least 2 characters in length\n"; } else { $stmt="UPDATE phones SET template_id='' where template_id='$template_id';"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="UPDATE vicidial_server_carriers SET template_id='' where template_id='$template_id';"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="DELETE from vicidial_conf_templates where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
CONF TEMPLATE DELETION COMPLETED: $server_id - $server_ip\n"; echo "

\n"; } $ADD='130000000000'; # go to conf template list } ###################### # ADD=641111111111 delete carrier record ###################### if ($ADD==641111111111) { echo ""; if ( (strlen($carrier_id) < 2) or ($CoNfIrM != 'YES') ) { echo "
CARRIER NOT DELETED - Please go back and look at the data you entered\n"; echo "
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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $CARRIERserver_ip = $row[0]; $stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
CARRIER DELETION COMPLETED: $carrier_id\n"; echo "

\n"; } $ADD='140000000000'; # go to carrier list } ###################### # ADD=651111111111 delete tts record ###################### if ($ADD==651111111111) { echo ""; if ( (strlen($tts_id) < 2) or ($CoNfIrM != 'YES') ) { echo "
TTS ENTRY NOT DELETED - Please go back and look at the data you entered\n"; echo "
TTS ID be at least 2 characters in length\n"; } else { $stmt="DELETE from vicidial_tts_prompts where tts_id='$tts_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
TTS DELETION COMPLETED: $tts_id\n"; echo "

\n"; } $ADD='150000000000'; # go to tts entry list } ###################### # ADD=661111111111 delete music on hold record ###################### if ($ADD==661111111111) { echo ""; if ( (strlen($moh_id) < 2) or ($CoNfIrM != 'YES') ) { echo "
MUSIC ON HOLD ENTRY NOT DELETED - Please go back and look at the data you entered\n"; echo "
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_to_mysqli($stmt, $link); $stmtA="DELETE from vicidial_music_on_hold_files where moh_id='$moh_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmtA, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtA|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
MUSIC ON HOLD DELETION COMPLETED: $moh_id\n"; echo "

\n"; } $ADD='160000000000'; # go to music on hold entry list } ###################### # ADD=671111111111 delete voicemail record ###################### if ($ADD==671111111111) { echo ""; if ( (strlen($voicemail_id) < 2) or ($CoNfIrM != 'YES') ) { echo "
VOICEMAIL BOX NOT DELETED - Please go back and look at the data you entered\n"; echo "
Voicemail ID be at least 2 characters in length\n"; } else { $stmt="DELETE from vicidial_voicemail where voicemail_id='$voicemail_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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_to_mysqli($stmtA, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
VOICEMAIL BOX DELETION COMPLETED: $voicemail_id\n"; echo "

\n"; } $ADD='170000000000'; # go to voicemail entry list } ###################### # ADD=681111111111 delete screen labels record ###################### if ($ADD==681111111111) { echo ""; if ( (strlen($label_id) < 2) or ($CoNfIrM != 'YES') ) { echo "
SCREEN LABEL NOT DELETED - Please go back and look at the data you entered\n"; echo "
Label ID be at least 2 characters in length\n"; } else { $stmt="DELETE from vicidial_screen_labels where label_id='$label_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
SCREEN LABEL DELETION COMPLETED: $label_id\n"; echo "

\n"; } $ADD='180000000000'; # go to screen labels entry list } ###################### # ADD=691111111111 delete contact record ###################### if ($ADD==691111111111) { echo ""; if ( (strlen($contact_id) < 1) or ($CoNfIrM != 'YES') ) { echo "
CONTACT NOT DELETED - Please go back and look at the data you entered\n"; echo "
Contact ID be at least 1 character in length\n"; } else { if ( (preg_match("/contact_information/",$SStables_use_alt_log_db)) and (strlen($SSalt_log_server_ip)>4) and (strlen($SSalt_log_dbname)>0) ) { $linkALT=mysql_connect("$SSalt_log_server_ip", "$SSalt_log_login", "$SSalt_log_pass"); mysql_select_db("$SSalt_log_dbname", $linkALT); } else {$linkALT = $link;} $stmt="DELETE from contact_information where contact_id='$contact_id';"; $rslt=mysql_to_mysqli($stmt, $linkALT); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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='CONTACTS', event_type='DELETE', record_id='$contact_id', event_code='ADMIN DELETE CONTACT', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); echo "
CONTACT DELETION COMPLETED: $contact_id\n"; echo "

\n"; } $ADD='190000000000'; # go to contacts entry list } ###################### # ADD=6111111111111 delete conference record ###################### if ($ADD==6111111111111) { echo ""; if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { echo "
CONFERENCE NOT DELETED - Please go back and look at the data you entered\n"; echo "
Conference be at least 2 characters in length\n"; echo "
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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
CONFERENCE DELETION COMPLETED: $conf_exten - $server_ip\n"; echo "

\n"; } $ADD='1000000000000'; # go to conference list } ###################### # ADD=61111111111111 delete vicidial conference record ###################### if ($ADD==61111111111111) { echo ""; if ( (strlen($conf_exten) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGast_delete_phones < 1) ) { echo "
AGENT CONFERENCE NOT DELETED - Please go back and look at the data you entered\n"; echo "
Conference be at least 2 characters in length\n"; echo "
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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "
AGENT CONFERENCE DELETION COMPLETED: $conf_exten - $server_ip\n"; echo "

\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 "
\n"; echo ""; $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,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,modify_email_accounts,failed_login_count,last_login_date,last_ip from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $modify_shifts = $row[84]; $modify_phones = $row[85]; $modify_carriers = $row[86]; $modify_labels = $row[87]; $modify_statuses = $row[88]; $modify_voicemail = $row[89]; $modify_audiostore = $row[90]; $modify_moh = $row[91]; $modify_tts = $row[92]; $preset_contact_search = $row[93]; $modify_contacts = $row[94]; $modify_same_user_level = $row[95]; $admin_hide_lead_data = $row[96]; $admin_hide_phone_data = $row[97]; $agentcall_email = $row[98]; $modify_email_accounts = $row[99]; $failed_login_count = $row[100]; $last_login_date = $row[101]; $last_ip = $row[102]; if ( ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) or ( ($LOGmodify_same_user_level < 1) and ($LOGuser_level > 8) and ($user_level > 8) ) ) { echo "
You do not have permissions to modify this user: $user\n"; } else { echo "
MODIFY A USERS RECORD: $user\n"; if ($LOGuser_level > 8) {echo "\n";} else { if ($LOGalter_agent_interface == "1") {echo "\n";} else {echo "\n";} } if ($SScustom_fields_enabled < 1) { echo "\n"; } echo "\n"; echo "
\n"; echo "\n"; if ($SSpass_hash_enabled > 0) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\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_to_mysqli($stmt, $link); $Uterrs_to_print = mysqli_num_rows($rslt); $Uterrs_list=''; $o=0; while ($Uterrs_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $Uterrs_list .= "$rowx[0] - $rowx[1]
\n"; $o++; } echo "\n"; } if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "1") ) { echo "\n"; echo "\n"; echo "\n"; if ($SSuser_territories_active > 0) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSallow_emails > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; if ($SSoutbound_autodial_active > 0) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSqc_features_active > 0) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } } if ($LOGuser_level > 8) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; #9BB9FB #B9CBFD echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SScustom_fields_enabled > 0) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSoutbound_autodial_active > 0) { echo "\n"; echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSallow_emails > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ( ($LOGmodify_same_user_level < 1) or ($LOGuser_level < 9) ) { echo "\n"; } else { echo "\n"; } } echo "\n"; echo "
User Number: $user$NWB#users-user$NWE
PASSWORD IS ENCRYPTED, ONLY ENTER IN A PASSWORD BELOW IF YOU WANT TO CHANGE IT!
Password: $NWB#users-pass$NWE     Strength:
Force Change Password: $NWB#users-force_change_password$NWE
Last Login Info: $last_login_date - $failed_login_count - $last_ip$NWB#users-user$NWE
Full Name: $NWB#users-full_name$NWE
User Level: $NWB#users-user_level$NWE
User Group: $NWB#users-user_group$NWE
Phone Login: $NWB#users-phone_login$NWE
Phone Pass: $NWB#users-phone_pass$NWE
Active: $NWB#users-active$NWE
Voicemail ID: voicemail chooser$NWB#users-voicemail_id$NWE
Email: $NWB#users-optional$NWE
User Code: $NWB#users-optional$NWE
Main Territory: $NWB#users-optional$NWE
User Territories: $Uterrs_list
AGENT INTERFACE OPTIONS:
Agent Choose Ingroups: $NWB#users-agent_choose_ingroups$NWE
Agent Choose Blended: $NWB#users-agent_choose_blended$NWE
Agent Choose Territories: $NWB#users-agent_choose_territories$NWE
Hot Keys Active: $NWB#users-hotkeys_active$NWE
Scheduled Callbacks: $NWB#users-scheduled_callbacks$NWE
Agent-Only Callbacks: $NWB#users-agentonly_callbacks$NWE
Agent Call Manual: $NWB#users-agentcall_manual$NWE
Agent Call Email: $NWB#users-agentcall_email$NWE
Agent Recording: $NWB#users-agent_recording$NWE
Agent Transfers: $NWB#users-agent_transfers$NWE
Closer Default Blended: $NWB#users-closer_default_blended$NWE
Agent Recording Override: $NWB#users-agent_recording_override$NWE
Agent Alter Customer Data Override: $NWB#users-alter_custdata_override$NWE
Agent Alter Customer Phone Override: $NWB#users-alter_custphone_override$NWE
Agent Shift Enforcement Override: $NWB#users-agent_shift_enforcement_override$NWE
Agent Call Log View Override: $NWB#users-agent_call_log_view_override$NWE
Agent Lead Search Override: $NWB#users-agent_lead_search_override$NWE
Alert Enabled: $alert_enabled $NWB#users-alert_enabled$NWE
Allow Alerts: $NWB#users-allow_alerts$NWE
Preset Contact Search: $NWB#users-preset_contact_search$NWE
Campaign Ranks: $NWB#users-campaign_ranks$NWE
\n"; echo "\n"; echo "$RANKcampaigns_list"; echo "
\n"; echo "
Inbound Groups: $NWB#users-closer_campaigns$NWE
\n"; echo "\n"; echo "$RANKgroups_list"; echo "
\n"; echo "
Custom 1: $NWB#users-custom_one$NWE
Custom 2: $NWB#users-custom_two$NWE
Custom 3: $NWB#users-custom_three$NWE
Custom 4: $NWB#users-custom_four$NWE
Custom 5: $NWB#users-custom_five$NWE
QC Enabled: $NWB#users-qc_enabled$NWE
QC User Level: $NWB#users-qc_user_level$NWE
QC Pass: $NWB#users-qc_pass$NWE
QC Finish: $NWB#users-qc_finish$NWE
QC Commit: $NWB#users-qc_commit$NWE
ADMIN REPORT OPTIONS:
Realtime Block User Info: $NWB#users-realtime_block_user_info$NWE
Admin Hide Lead Data: $NWB#users-admin_hide_lead_data$NWE
Admin Hide Phone Data: $NWB#users-admin_hide_phone_data$NWE
ADMIN INTERFACE OPTIONS:
View Reports: $NWB#users-view_reports$NWE
Alter Agent Interface Options: $NWB#users-alter_agent_interface_options$NWE
Modify Users: $NWB#users-modify_sections$NWE
Change Agent Campaign: $NWB#users-change_agent_campaign$NWE
Delete Users: $NWB#users-delete_users$NWE
Modify User Groups: $NWB#users-modify_sections$NWE
Delete User Groups: $NWB#users-delete_user_groups$NWE
Modify Lists: $NWB#users-modify_sections$NWE
Delete Lists: $NWB#users-delete_lists$NWE
Load Leads: $NWB#users-load_leads$NWE
Modify Leads: $NWB#users-modify_leads$NWE
Download Lists: $NWB#users-modify_leads$NWE
Export Reports: $NWB#users-export_reports$NWE
Delete From DNC Lists: $NWB#users-delete_from_dnc$NWE
Custom Fields Modify: $NWB#users-custom_fields_modify$NWE
Modify Campaigns: $NWB#users-modify_sections$NWE
Campaign Detail: $NWB#users-campaign_detail$NWE
Delete Campaigns: $NWB#users-delete_campaigns$NWE
Modify In-Groups: $NWB#users-modify_sections$NWE
Delete In-Groups: $NWB#users-delete_ingroups$NWE
Modify DIDs: $NWB#users-modify_sections$NWE
Delete DIDs: $NWB#users-delete_ingroups$NWE
Modify Remote Agents: $NWB#users-modify_sections$NWE
Delete Remote Agents: $NWB#users-delete_remote_agents$NWE
Modify Scripts: $NWB#users-modify_sections$NWE
Delete Scripts: $NWB#users-delete_scripts$NWE
Modify Filters: $NWB#users-modify_sections$NWE
Delete Filters: $NWB#users-delete_filters$NWE
AGC Admin Access: $NWB#users-ast_admin_access$NWE
AGC Delete Phones: $NWB#users-ast_delete_phones$NWE
Modify Call Times: $NWB#users-modify_call_times$NWE
Delete Call Times: $NWB#users-delete_call_times$NWE
Modify Servers: $NWB#users-modify_sections$NWE
Modify Shifts: $NWB#users-modify_sections$NWE
Modify Phones: $NWB#users-modify_sections$NWE
Modify Carriers: $NWB#users-modify_sections$NWE
Modify Email Accounts: $NWB#users-modify_email_accounts$NWE
Modify Labels: $NWB#users-modify_sections$NWE
Modify Statuses: $NWB#users-modify_sections$NWE
Modify Voicemail: $NWB#users-modify_sections$NWE
Modify Audio Store: $NWB#users-modify_sections$NWE
Modify Music On Hold: $NWB#users-modify_sections$NWE
Modify TTS: $NWB#users-modify_sections$NWE
Modify Contacts: $NWB#users-modify_sections$NWE
CallCard Access: $NWB#users-modify_sections$NWE
Agent API Access: $NWB#users-vdc_agent_api_access$NWE
Add Timeclock Log Record: $NWB#users-add_timeclock_log$NWE
Modify Timeclock Log Record: $NWB#users-modify_timeclock_log$NWE
Delete Timeclock Log Record: $NWB#users-delete_timeclock_log$NWE
Manager Shift Enforcement Override: $NWB#users-manager_shift_enforcement_override$NWE
Modify Same User Level: $NWB#users-modify_same_user_level$NWE
\n"; if ($LOGdelete_users > 0) { echo "

DELETE THIS USER\n"; } echo "

Click here for user time sheet\n"; echo "

Click here for user status\n"; echo "

Click here for user stats\n"; echo "

Click here for user multiple day status detail report\n"; echo "

Click here for user CallBack Holds\n"; if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this record
\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 ( (!preg_match("/$campaign_id/i", $LOGallowed_campaigns)) and (!preg_match("/ALL-CAMPAIGNS/i",$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_to_mysqli($stmt, $link); } if ($stage=='hide_dialable') { $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); } if ($stage=='show_leadscount') { $stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); } if ($stage=='hide_leadscount') { $stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); } $stmt="SELECT enable_vtiger_integration,vtiger_url from system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check,in_group_dial,in_group_dial_select,safe_harbor_audio_field,pause_after_next_call,owner_populate,use_other_campaign_dnc,allow_emails,amd_inbound_group,amd_callmenu,survey_wait_sec,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $park_ext = $row[9]; $park_file_name = $row[10]; $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]; $na_call_url = $row[195]; $survey_recording = $row[196]; $pllb_grouping = $row[197]; $pllb_grouping_limit = $row[198]; $call_count_limit = $row[199]; $call_count_target = $row[200]; $callback_hours_block = $row[201]; $callback_list_calltime = $row[202]; $user_group = $row[203]; $hopper_vlc_dup_check = $row[204]; $in_group_dial = $row[205]; $in_group_dial_select = $row[206]; $safe_harbor_audio_field = $row[207]; $pause_after_next_call = $row[208]; $owner_populate = $row[209]; $use_other_campaign_dnc = $row[210]; $allow_emails = $row[211]; $amd_inbound_group = $row[212]; $amd_callmenu = $row[213]; $survey_wait_sec = $row[214]; $manual_dial_lead_id = $row[215]; $dead_max = $row[216]; $dispo_max = $row[217]; $pause_max = $row[218]; $dead_max_dispo = $row[219]; $dispo_max_dispo = $row[220]; if (preg_match('/DISABLED/', $list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} else {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} if ($auto_alt_dial == 'MULTI_LEAD') {$ALTmultiDISABLE=1; $ALTmultiLINK="Multi-Alt-Settings";} else {$ALTmultiDISABLE=0; $ALTmultiLINK='';} $stmt="SELECT count(*) from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and status='ACTIVE' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $rowx=mysqli_fetch_row($rslt); if ($rowx[0] < 1) { $mixes_list="\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' $LOGallowed_campaignsSQL limit 1"; $rslt=mysql_to_mysqli($stmt, $link); $mixes_to_print = mysqli_num_rows($rslt); $mixes_list="\n"; $o=0; while ($mixes_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $mixes_list .= "\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,completed from vicidial_statuses order by status;"; $rslt=mysql_to_mysqli($stmt, $link); $statuses_to_print = mysqli_num_rows($rslt); $statuses_list=''; $dial_statuses_list=''; $qc_statuses_list=''; $survey_ni_status_list=''; $o=0; while ($statuses_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $statuses_list .= "\n"; if ($rowx[0] != 'CBHOLD') { $dial_statuses_list .= "\n"; if ($survey_ni_status == $rowx[0]) { $survey_ni_status_list .= "\n"; } else { $survey_ni_status_list .= "\n"; } } $statname_list["$rowx[0]"] = "$rowx[1]"; $LRstatuses_list .= "\n"; if (preg_match('/Y/i', $rowx[2])) {$HKstatuses_list .= "\n";} $qc_statuses_list .= " $o) { $rowx=mysqli_fetch_row($rslt); $statuses_list .= "\n"; if ($rowx[0] != 'CBHOLD') {$dial_statuses_list .= "\n";} $statname_list["$rowx[0]"] = "$rowx[1]"; $LRstatuses_list .= "\n"; if (preg_match('/Y/i', $rowx[2])) {$HKstatuses_list .= "\n";} $qc_statuses_list .= " $o) { $rowx=mysqli_fetch_row($rslt); $Dgroups_menu .= "\n"; $o++; } if ($Dgroups_selected < 1) {$Dgroups_menu .= "\n";} else {$Dgroups_menu .= "\n";} $nxLOGadmin_viewable_groupsSQL = $LOGadmin_viewable_groupsSQL; if (strlen($xfer_groupsSQL) < 6) {$nxLOGadmin_viewable_groupsSQL = $whereLOGadmin_viewable_groupsSQL;} ##### get in-groups listings for dynamic transfer group pulldown list menu $stmt="SELECT group_id,group_name from vicidial_inbound_groups $xfer_groupsSQL $nxLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_to_mysqli($stmt, $link); $Xgroups_to_print = mysqli_num_rows($rslt); $Xgroups_menu=''; $Xgroups_selected=0; $o=0; while ($Xgroups_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $Xgroups_menu .= "\n"; $o++; } if ($Xgroups_selected < 1) {$Xgroups_menu .= "\n";} else {$Xgroups_menu .= "\n";} ##### get in-groups listings for dynamic AMD inbound group pulldown list menu $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_to_mysqli($stmt, $link); $AMDgroups_to_print = mysqli_num_rows($rslt); $AMDgroups_menu=''; $AMDgroups_selected=0; $o=0; while ($AMDgroups_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $AMDgroups_menu .= "\n"; $o++; } if ($AMDgroups_selected < 1) {$AMDgroups_menu .= "\n";} else {$AMDgroups_menu .= "\n";} ##### get callmenus listings for dynamic AMD callmenu pulldown list menu $stmt="SELECT menu_id from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id;"; $rslt=mysql_to_mysqli($stmt, $link); $AMDmenus_to_print = mysqli_num_rows($rslt); $AMDmenus_menu=''; $AMDmenus_selected=0; $o=0; while ($AMDmenus_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $AMDmenus_menu .= "\n"; $o++; } if ($AMDmenus_selected < 1) {$AMDmenus_menu .= "\n";} else {$AMDmenus_menu .= "\n";} ##### get agent screen label listings for dynamic pulldown list menu $stmt="SELECT label_id,label_name from vicidial_screen_labels where active='Y' $LOGadmin_viewable_groupsSQL order by label_id;"; $rslt=mysql_to_mysqli($stmt, $link); $labels_to_print = mysqli_num_rows($rslt); $labels_menu=''; $o=0; while ($labels_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $labels_menu .= "\n"; $o++; } $stmt="SELECT count(*) from servers where active='Y' and active_agent_login_server='Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $agent_servers_count=$row[0]; $stmt="SELECT count(*) from phones_alias $whereLOGadmin_viewable_groupsSQL;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $phones_alias_count=$row[0]; 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;} if ($SUB==202) {$camp_accid_color=$subcamp_color;} else {$camp_accid_color=$campaigns_color;} echo " $campaign_id:
"; echo "\n"; echo ""; echo ""; echo ""; echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; echo ""; echo ""; echo ""; } echo ""; if ($enable_xfer_presets == 'ENABLED') { echo ""; } if ($SScampaign_cid_areacodes_enabled == '1') { echo ""; } if ($SSqc_features_active > 0) { echo ""; } if ($SSoutbound_autodial_active < 1) { echo "\n"; } echo "\n"; echo "
  Basic Detail StatusesHotKeysLead RecyclingAuto Alt DialList MixSurveyPause CodesPresetsAC-CIDQC Real-Time
\n"; echo "
\n"; echo ""; echo "
\n"; if ($SUB < 1) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSenable_second_webform > 0) { echo "\n"; } echo "\n"; echo "\n"; if ($SSallow_emails > 0) { echo "\n"; } else { echo "\n"; } if ($SSoutbound_autodial_active > 0) { echo "\n"; $o=0; while ($Ds_to_print > $o) { $o++; $Dstatus = $Dstatuses[$o]; echo "\n"; } else { echo "$Dstatus - $statname_list[$Dstatus]         \n"; echo "REMOVE\n"; } } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ( (preg_match("/RATIO|ADAPT/",$dial_method)) and ($SSdisable_auto_dial > 0) ) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "\n"; echo "\n"; echo "\n"; if ($SSoutbound_autodial_active > 0) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSoutbound_autodial_active > 0) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} if ($SScustom_fields_enabled > 0) {$cfwHTML = '';} echo "\n"; echo "\n"; echo "\n"; if ($SSoutbound_autodial_active > 0) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSoutbound_autodial_active > 0) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSoutbound_autodial_active > 0) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSoutbound_autodial_active > 0) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSuser_territories_active > 0) { echo "\n"; } echo "\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 "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSoutbound_autodial_active > 0) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\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' $LOGadmin_viewable_groupsSQL order by group_alias_id;"; $rslt=mysql_to_mysqli($stmt, $link); $group_alias_to_print = mysqli_num_rows($rslt); $group_alias_menu=''; $group_alias_selected=0; $o=0; while ($group_alias_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $group_alias_menu .= "\n"; $o++; } echo "\n"; } if ($SSenable_vtiger_integration > 0) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } else { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } if ($SSenable_queuemetrics_logging > 0) { echo "\n"; echo "\n"; } else { echo "\n"; echo "\n"; } if ( ($agent_servers_count > 1) and ($phones_alias_count > 0) ) { echo "\n"; echo "\n"; } else { echo "\n"; echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($campaign_allow_inbound == 'Y') { echo "\n"; } echo "\n"; if ($allow_closers == 'Y') { echo "\n"; } echo "\n"; echo "\n"; echo "
Campaign ID: $campaign_id$NWB#campaigns-campaign_id$NWE
Campaign Name: $NWB#campaigns-campaign_name$NWE
Campaign Description: $NWB#campaigns-campaign_description$NWE
Campaign Change Date: $campaign_changedate   $NWB#campaigns-campaign_changedate$NWE
Campaign Login Date: $campaign_logindate   $NWB#campaigns-campaign_logindate$NWE
Campaign Call Date: $campaign_calldate   $NWB#campaigns-campaign_calldate$NWE
\n"; horizontal_bar_chart($campaign_id,'8','campaign',$link,'total_calls','call count',1,'',''); echo "
Active: $NWB#campaigns-active$NWE
Admin User Group: $NWB#campaigns-user_group$NWE
Park Music-on-Hold: moh chooser $NWB#campaigns-park_ext$NWE
Web Form: $NWB#campaigns-web_form_address$NWE
Web Form Two: $NWB#campaigns-web_form_address$NWE
Web Form Target: $NWB#campaigns-web_form_target$NWE
Allow Closers: $NWB#campaigns-allow_closers$NWE
Allow Emails: $NWB#campaigns-allow_emails$NWE
Allow Inbound and Blended: $NWB#campaigns-campaign_allow_inbound$NWE
Dial Status $o: \n"; if ($DEFstatusDISABLED > 0) { echo "$Dstatus - $statname_list[$Dstatus]         \n"; echo "REMOVE
Add A Dial Status to Call:   \n"; echo "     $NWB#campaigns-dial_status$NWE
List Order: "; if ($ALTmultiDISABLE > 0) { echo " $ALTmultiLINK"; } else { echo "$NWB#campaigns-lead_order$NWE\n"; } echo "
List Order Randomize: "; if ($ALTmultiDISABLE > 0) { echo " $ALTmultiLINK"; } else { echo "$NWB#campaigns-lead_order_randomize$NWE"; } echo "
List Order Secondary: "; if ($ALTmultiDISABLE > 0) { echo " $ALTmultiLINK"; } else { echo "$NWB#campaigns-lead_order_secondary$NWE"; } echo "
List Mix: "; if ($ALTmultiDISABLE > 0) { echo " $ALTmultiLINK"; } else { echo "$NWB#campaigns-list_order_mix$NWE"; } echo "
Lead Filter: "; if ($ALTmultiDISABLE > 0) { echo " $ALTmultiLINK"; } else { echo "$NWB#campaigns-lead_filter_id$NWE"; } echo "
Drop Lockout Time: $NWB#campaigns-drop_lockout_time$NWE
Call Count Limit: $NWB#campaigns-call_count_limit$NWE
Call Count Target: $NWB#campaigns-call_count_target$NWE
Minimum Hopper Level: $NWB#campaigns-hopper_level$NWE
Automatic Hopper Level: $NWB#campaigns-use_auto_hopper$NWE
Automatic Hopper Multiplier: $NWB#campaigns-hopper_level$NWE
Auto Trim Hopper: $NWB#campaigns-auto_trim_hopper$NWE
Hopper VLC Dup Check: $NWB#campaigns-hopper_vlc_dup_check$NWE
Force Reset of Hopper: $NWB#campaigns-force_reset_hopper$NWE
Auto-dialing has been disabled on this system
Dial Method: $NWB#campaigns-dial_method$NWE
Auto Dial Level: (0 = off)$NWB#campaigns-auto_dial_level$NWE       ADAPT OVERRIDE
Auto Dial Level Threshold: $NWB#campaigns-dial_level_threshold$NWE       agents:
Available Only Tally: $NWB#campaigns-available_only_ratio_tally$NWE
Available Only Tally Threshold: $NWB#campaigns-available_only_tally_threshold$NWE       agents:
Drop Percentage Limit: % $NWB#campaigns-adaptive_dropped_percentage$NWE
Maximum Adapt Dial Level: number only $NWB#campaigns-adaptive_maximum_level$NWE
Latest Server Time: 4 digits only $NWB#campaigns-adaptive_latest_server_time$NWE
Adapt Intensity Modifier: $NWB#campaigns-adaptive_intensity$NWE
Dial Level Difference Target: $NWB#campaigns-adaptive_dl_diff_target$NWE
Dial Level Difference Target Method: $NWB#campaigns-dl_diff_target_method$NWE
Concurrent Transfers: $NWB#campaigns-concurrent_transfers$NWE
Queue Priority: $NWB#campaigns-queue_priority$NWE
Multiple Campaign Drop Rate Group: $NWB#campaigns-drop_rate_group$NWE
Inbound Queue No Dial: $NWB#campaigns-inbound_queue_no_dial$NWE
Auto Alt-Number Dialing: $NWB#campaigns-auto_alt_dial$NWE $ALTmultiLINK
Next Agent Call: $NWB#campaigns-next_agent_call$NWE
Local Call Time: $NWB#campaigns-local_call_time$NWE
\n"; $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$local_call_time';"; $rslt=mysql_to_mysqli($stmt, $link); $call_times_to_print = mysqli_num_rows($rslt); if ($call_times_to_print > 0) { $rowx=mysqli_fetch_row($rslt); $ct_state_call_times = $rowx[0]; $state_rules = explode('|',$ct_state_call_times); $ct_srs = ((count($state_rules)) - 2); if ($ct_srs < 0) {$ct_hrs=0;} echo "State rules defined for this call time: $ct_srs\n"; } else {echo "Call time not found!: $local_call_time\n";} echo "
Dial Timeout: in seconds$NWB#campaigns-dial_timeout$NWE
Dial Prefix: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#campaigns-dial_prefix$NWE
Manual Dial Prefix: $NWB#campaigns-manual_dial_prefix$NWE
Omit Phone Code: $NWB#campaigns-omit_phone_code$NWE
Campaign CallerID: $NWB#campaigns-campaign_cid$NWE\n"; $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and campaign_cid_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $rowx=mysqli_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
Custom CallerID: $NWB#campaigns-use_custom_cid$NWE
Routing Extension: $NWB#campaigns-campaign_vdad_exten$NWE
Campaign Rec exten: $NWB#campaigns-campaign_rec_exten$NWE
Campaign Recording: $NWB#campaigns-campaign_recording$NWE
Campaign Rec Filename: $NWB#campaigns-campaign_rec_filename$NWE
Recording Delay: in seconds$NWB#campaigns-allcalls_delay$NWE
Call Notes Per Call: $NWB#campaigns-per_call_notes$NWE
Agent Lead Search: $NWB#campaigns-agent_lead_search$NWE
Agent Lead Search Method: $NWB#campaigns-agent_lead_search_method$NWE
Script: $NWB#campaigns-campaign_script$NWE\n"; $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and agent_script_override != '' and active='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $rowx=mysqli_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
Get Call Launch: $NWB#campaigns-get_call_launch$NWE
Answering Machine Message: audio chooser $NWB#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' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $rowx=mysqli_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
WaitForSilence Options: $NWB#campaigns-waitforsilence_options$NWE
AMD send to Action: $NWB#campaigns-amd_send_to_vmx$NWE
CPD AMD Action: $NWB#campaigns-cpd_amd_action$NWE
AMD Inbound Group: $NWB#campaigns-amd_inbound_group$NWE\n"; echo "
AMD Call Menu: $NWB#campaigns-amd_callmenu$NWE\n"; echo "
Transfer-Conf DTMF 1: $NWB#campaigns-xferconf_a_dtmf$NWE
Transfer-Conf Number 1: $NWB#campaigns-xferconf_a_dtmf$NWE
Transfer-Conf DTMF 2: $NWB#campaigns-xferconf_a_dtmf$NWE
Transfer-Conf Number 2: $NWB#campaigns-xferconf_a_dtmf$NWE
Transfer-Conf Number 3: $NWB#campaigns-xferconf_a_dtmf$NWE
Transfer-Conf Number 4: $NWB#campaigns-xferconf_a_dtmf$NWE
Transfer-Conf Number 5: $NWB#campaigns-xferconf_a_dtmf$NWE
Enable Transfer Presets: $NWB#campaigns-enable_xfer_presets$NWE
Hide Transfer Number to Dial: $NWB#campaigns-hide_xfer_number_to_dial$NWE
Quick Transfer Button: $NWB#campaigns-quick_transfer_button$NWE
Custom 3-Way Button Transfer: $NWB#campaigns-custom_3way_button_transfer$NWE
PrePopulate Transfer Preset: $NWB#campaigns-prepopulate_transfer_preset$NWE
Park Call IVR: $NWB#campaigns-ivr_park_call$NWE
Park Call IVR AGI: $NWB#campaigns-ivr_park_call_agi$NWE
Timer Action: $NWB#campaigns-timer_action$NWE
Timer Action Message: $NWB#campaigns-timer_action_message$NWE
Timer Action Seconds: $NWB#campaigns-timer_action_seconds$NWE
Timer Action Destination: $NWB#campaigns-timer_action_destination$NWE
Alt Number Dialing: $NWB#campaigns-alt_number_dialing$NWE
Scheduled Callbacks: $NWB#campaigns-scheduled_callbacks$NWE
Scheduled Callbacks Alert: $NWB#campaigns-scheduled_callbacks_alert$NWE
Scheduled Callbacks Count: $NWB#campaigns-scheduled_callbacks_count$NWE
Scheduled Callbacks Days Limit: $NWB#campaigns-callback_days_limit$NWE
Scheduled Callbacks Hours Block: $NWB#campaigns-callback_hours_block$NWE
Scheduled Callbacks Calltime Block: $NWB#campaigns-callback_list_calltime$NWE
My Callbacks Checkbox Default: $NWB#campaigns-my_callback_option$NWE
Drop Call Seconds: $NWB#campaigns-drop_call_seconds$NWE
Drop Action: $NWB#campaigns-drop_action$NWE
Safe Harbor Exten: $NWB#campaigns-safe_harbor_exten$NWE
Safe Harbor Audio: audio chooser $NWB#campaigns-safe_harbor_audio$NWE
Safe Harbor Audio Field: $NWB#campaigns-safe_harbor_audio_field$NWE
Safe Harbor Call Menu: $NWB#campaigns-safe_harbor_menu_id$NWE
Voicemail: voicemail chooser$NWB#campaigns-voicemail_ext$NWE
Drop Transfer Group: $NWB#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' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $rowx=mysqli_fetch_row($rslt); if ($rowx[0] > 0) {echo " LIST OVERRIDE ACTIVE";} echo "
Disable Dispo Screen: $NWB#campaigns-disable_dispo_screen$NWE
Disable Dispo Status: $NWB#campaigns-disable_dispo_status$NWE
Wrap Up Seconds: $NWB#campaigns-wrapup_seconds$NWE
Wrap Up Message: $NWB#campaigns-wrapup_message$NWE
Dead Call Max Seconds: $NWB#campaigns-dead_max$NWE
Dead Call Max Status: $NWB#campaigns-dead_max_dispo$NWE
Dispo Call Max Seconds: $NWB#campaigns-dispo_max$NWE
Dispo Call Max Status: $NWB#campaigns-dispo_max_dispo$NWE
Agent Pause Max Seconds: $NWB#campaigns-pause_max$NWE
Use Internal DNC List: $NWB#campaigns-use_internal_dnc$NWE
Use Campaign DNC List: $NWB#campaigns-use_campaign_dnc$NWE
Other Campaign DNC: $NWB#campaigns-use_other_campaign_dnc$NWE
Agent Pause Codes Active: $NWB#campaigns-agent_pause_codes_active$NWE
Auto Pause Pre-Call Work: $NWB#campaigns-auto_pause_precall$NWE
Auto Resume Pre-Call Work: $NWB#campaigns-auto_resume_precall$NWE
Auto Pause Pre-Call Code: $NWB#campaigns-auto_pause_precall_code$NWE
Campaign Stats Refresh: $NWB#campaigns-campaign_stats_refresh$NWE
Real-Time Agent Time Stats: $NWB#campaigns-realtime_agent_time_stats$NWE
Disable Alter Customer Data: $NWB#campaigns-disable_alter_custdata$NWE
Disable Alter Customer Phone: $NWB#campaigns-disable_alter_custphone$NWE
Allow No-Hopper-Leads Logins: $NWB#campaigns-no_hopper_leads_logins$NWE
No Hopper Dialing: $NWB#campaigns-no_hopper_dialing$NWE
Owner Only Dialing: $NWB#campaigns-agent_dial_owner_only$NWE
Owner Populate: $NWB#campaigns-owner_populate$NWE
Agent Select Territories: $NWB#campaigns-agent_select_territories$NWE
Agent Display Dialable Leads: $NWB#campaigns-agent_display_dialable_leads$NWE
Agent Screen Labels: $NWB#campaigns-screen_labels$NWE
Status Display Fields: $NWB#campaigns-status_display_fields$NWE
Agent Display Queue Count: $NWB#campaigns-display_queue_count$NWE
Agent View Calls in Queue: $NWB#campaigns-view_calls_in_queue$NWE
View Calls in Queue Launch: $NWB#campaigns-view_calls_in_queue_launch$NWE
Agent Grab Calls in Queue: $NWB#campaigns-grab_calls_in_queue$NWE
Agent Call Re-Queue Button: $NWB#campaigns-call_requeue_button$NWE
Agent Pause After Each Call: $NWB#campaigns-pause_after_each_call$NWE
Agent Pause After Next Call Link: $NWB#campaigns-pause_after_next_call$NWE
Manual Dial Override: $NWB#campaigns-manual_dial_override$NWE
Manual Dial List ID: $NWB#campaigns-manual_dial_list_id$NWE
Manual Dial Filter: $NWB#campaigns-manual_dial_filter$NWE
Manual Preview Dial: $NWB#campaigns-manual_preview_dial$NWE
Manual Dial by Lead ID: $NWB#campaigns-manual_dial_lead_id$NWE
Manual Call Time Check: $NWB#campaigns-manual_dial_call_time_check$NWE
Manual Dial API: $NWB#campaigns-api_manual_dial$NWE
Manual Dial CID: $NWB#campaigns-manual_dial_cid$NWE
Phone Post Time Difference Alert: $NWB#campaigns-post_phone_time_diff_alert$NWE
In-Group Manual Dial: $NWB#campaigns-in_group_dial$NWE
In-Group Manual Dial Select: $NWB#campaigns-in_group_dial_select$NWE
Agent Screen Clipboard Copy: $NWB#campaigns-agent_clipboard_copy$NWE
Agent Screen Extended Alt Dial: $NWB#campaigns-agent_extended_alt_dial$NWE
3-Way Call Outbound CallerID: $NWB#campaigns-three_way_call_cid$NWE
3-Way Call Dial Prefix: $NWB#campaigns-three_way_dial_prefix$NWE
Customer 3-Way Hangup Logging: $NWB#campaigns-customer_3way_hangup_logging$NWE
Customer 3-Way Hangup Seconds: $NWB#campaigns-customer_3way_hangup_seconds$NWE
Customer 3-Way Hangup Action: $NWB#campaigns-customer_3way_hangup_action$NWE
Group Alias Allowed: $NWB#campaigns-agent_allow_group_alias$NWE
Default Group Alias: $NWB#campaigns-default_group_alias$NWE
Vtiger Search Category: $NWB#campaigns-vtiger_search_category$NWE
Vtiger Search Dead Accounts: $NWB#campaigns-vtiger_search_dead$NWE
Vtiger Create Call Record: $NWB#campaigns-vtiger_create_call_record$NWE
Vtiger Create Lead Record: $NWB#campaigns-vtiger_create_lead_record$NWE
Vtiger Status Call: $NWB#campaigns-vtiger_status_call$NWE
Vtiger Screen Login: $NWB#campaigns-vtiger_screen_login$NWE
QM CallStatus Override: $NWB#campaigns-queuemetrics_callstatus$NWE
QM Phone Environment: $NWB#campaigns-queuemetrics_phone_environment$NWE
PLLB Grouping: $NWB#campaigns-pllb_grouping$NWE
PLLB Grouping Limit: $NWB#campaigns-pllb_grouping_limit$NWE
CRM Popup Login: $NWB#campaigns-crm_popup_login$NWE
CRM Popup Address: $NWB#campaigns-crm_login_address$NWE
Start Call URL: $NWB#campaigns-start_call_url$NWE
Dispo Call URL: $NWB#campaigns-dispo_call_url$NWE
No Agent Call URL: $NWB#campaigns-na_call_url$NWE
Extension Append CID: $NWB#campaigns-extension_appended_cidname$NWE
Blind Monitor Warning: $NWB#campaigns-blind_monitor_warning$NWE
Blind Monitor Notice: $NWB#campaigns-blind_monitor_message$NWE
Blind Monitor Filename: audio chooser $NWB#campaigns-blind_monitor_filename$NWE
Allowed Inbound Groups:
"; echo " $NWB#campaigns-closer_campaigns$NWE
\n"; echo "$groups_list"; echo "
Default Transfer Group: $NWB#campaigns-default_xfer_group$NWE
Allowed Transfer Groups:
"; echo " $NWB#campaigns-xfer_groups$NWE
\n"; echo "$XFERgroups_list"; echo "
\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSoutbound_autodial_active > 0) { echo "
LISTS WITHIN THIS CAMPAIGN:   $NWB#campaign_lists$NWE\n"; echo "
\n"; echo ""; $LISTlink='stage=LISTIDDOWN'; $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPAIGNlink='stage=CAMPAIGNDOWN'; $CALLDATElink='stage=CALLDATEDOWN'; $SQLorder='order by list_id'; if (preg_match('/LISTIDUP/i', $stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (preg_match('/LISTIDDOWN/i', $stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} if (preg_match('/LISTNAMEUP/i', $stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} if (preg_match('/LISTNAMEDOWN/i', $stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (preg_match('/TALLYUP/i', $stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (preg_match('/TALLYDOWN/i', $stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (preg_match('/ACTIVEUP/i', $stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} if (preg_match('/ACTIVEDOWN/i', $stage)) {$SQLorder='order by active desc'; $ACTIVElink='stage=ACTIVEUP';} if (preg_match('/CAMPAIGNUP/i',$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} if (preg_match('/CAMPAIGNUP/i', $stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} if (preg_match('/CALLDATEUP/i', $stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (preg_match('/CALLDATEDOWN/i', $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,DATE_FORMAT(expiration_date,'%Y%m%d') from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' $LOGallowed_campaignsSQL group by list_id $SQLorder"; if ($SSadmin_list_counts < 1) {$stmt="SELECT list_id,list_name,list_description,'X' as tally,active,list_lastcalldate,campaign_id,DATE_FORMAT(expiration_date,'%Y%m%d') from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL $SQLorder";} $rslt=mysql_to_mysqli($stmt, $link); $lists_to_print = mysqli_num_rows($rslt); echo "
\n"; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo ""; echo ""; echo "\n"; echo "\n"; $o=0; while ($lists_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "\n"; echo "
LIST IDLIST NAMEDESCRIPTIONLEADS COUNTACTIVELAST CALL DATEMODIFY
$row[0] $row[1] $row[2] $row[3] $row[4]"; if (preg_match('/Y/',$row[4])) { $active_lists++; $camp_lists .= "'$row[0]',"; echo ""; } else { $inactive_lists++; echo ""; if ($row[7] < $EXPtestdate) {echo "EXP";} else {echo " ";} echo " $row[5]MODIFY

\n"; $filterSQL = $filtersql_list[$lead_filter_id]; $filterSQL = preg_replace("/\\\\/","",$filterSQL); $filterSQL = preg_replace('/^and|and$|^or|or$/i', '',$filterSQL); if (strlen($filterSQL)>4) {$fSQL = "and ($filterSQL)";} else {$fSQL = '';} $camp_lists = preg_replace('/.$/i','',$camp_lists);; echo "
This campaign has $active_lists active lists and $inactive_lists inactive lists

\n"; $dial_statuses_original = $dial_statuses; 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,completed from vicidial_statuses order by status;"; $rslt=mysql_to_mysqli($stmt, $link); $statuses_to_print = mysqli_num_rows($rslt); $o=0; while ($statuses_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $statuses_name_list["$rowx[0]"] = "$rowx[1]"; $statuses_complete_list["$rowx[0]"] = "$rowx[2]"; $o++; } $stmt="SELECT status,status_name,completed from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by status;"; $rslt=mysql_to_mysqli($stmt, $link); $Cstatuses_to_print = mysqli_num_rows($rslt); $o=0; while ($Cstatuses_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $statuses_name_list["$rowx[0]"] = "$rowx[1]"; $statuses_complete_list["$rowx[0]"] = "$rowx[2]"; $o++; } # end grab status names echo "
STATUSES WITHIN THE ACTIVE LISTS FOR THIS CAMPAIGN:\n"; echo " - HIDE
"; if ($SSexpanded_list_stats > 0) { echo "\n"; $dialable_total=0; $complete_total=0; $fSQL = ''; $stmt="SELECT lead_filter_sql from vicidial_lead_filters where lead_filter_id='$lead_filter_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $filters_to_print = mysqli_num_rows($rslt); if ($filters_to_print > 0) { $rowx=mysqli_fetch_row($rslt); $filterSQL = $rowx[0]; $filterSQL = preg_replace("/\\\\/","",$filterSQL); $filterSQL = preg_replace('/^and|and$|^or|or$/i', '',$filterSQL); if (strlen($filterSQL)>4) {$fSQL = "and ($filterSQL)";} else {$fSQL = '';} } echo "\n"; } else { echo "
STATUSSTATUS NAMECALLEDNOT CALLEDDIALABLEPENETRATION
\n"; echo "\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_to_mysqli($stmt, $link); $statuses_to_print = mysqli_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=mysqli_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 (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} if ($dispo == 'CBHOLD') { $CLB=""; $CLE=""; } else { $CLB=''; $CLE=''; } if ($SSexpanded_list_stats > 0) { ### call function to calculate dialable leads $single_status=1; $dial_statuses=" $dispo -"; if ($statuses_complete_list[$dispo] == 'Y') {$Xdialable_count=0;} else {$Xdialable_count = dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$fSQL);} $dialable_total = ($dialable_total + $Xdialable_count); ### get number of complete calls of this status for penetration calculations $Xcomplete_count = complete_leads($DB,$link,$dial_statuses,$camp_lists,$call_count_limit,$single_status,$campaign_id); $complete_total = ($complete_total + $Xcomplete_count); $dispo_total = ($lead_list['Y'][$dispo] + $lead_list['N'][$dispo]); if ( ($Xcomplete_count < 1) or ($dispo_total < 1) ) {$complete_pct = "0";} else { $complete_pct = intval(($Xcomplete_count / $dispo_total) * 100); } echo "\n"; } else { echo "\n"; } $o++; } } if ($SSexpanded_list_stats > 0) { if ( ($complete_total < 1) or ($lead_list[count] < 1) ) {$total_complete_pct = "0";} else {$total_complete_pct = intval(($complete_total / $lead_list[count]) * 100);} echo "\n"; echo "\n"; } else { echo "\n"; echo "\n"; } echo "
STATUSSTATUS NAMECALLEDNOT CALLED
$CLB$dispo$CLE$statuses_name_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]." $Xdialable_count $complete_pct%  
$CLB$dispo$CLE$statuses_name_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]    
TOTAL$lead_list[count]$dialable_total $total_complete_pct%  
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; unset($lead_list); } else { echo "SHOW LEAD STATUSES IN THIS CAMPAIGN

"; } echo "
\n"; if ($display_dialable_count == 'Y') { ### call function to calculate and print dialable leads $single_status=0; $dial_statuses = $dial_statuses_original; dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$fSQL); echo " - HIDE

"; } else { echo "Popup Dialable Leads Count"; echo " - SHOW

"; } $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL and status IN('READY');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $rowx=mysqli_fetch_row($rslt); $hopper_leads = "$rowx[0]"; echo "This campaign has $hopper_leads leads in the dial hopper

\n"; echo "Click here to see what leads are in the hopper right now

\n"; echo "Click here to see a VDAD report for this campaign

\n"; } echo "Click here to see all CallBack Holds in this campaign

\n"; if ($SSoutbound_autodial_active > 0) { if ( ($SStest_campaign_calls > 0) and ($campaign_active == 'Y') ) { ##### get list of active asterisk server for dynamic pulldown list menu $stmt="SELECT server_id,server_ip from servers where active='Y' and active_asterisk_server='Y' $LOGadmin_viewable_groupsSQL order by server_id;"; $rslt=mysql_to_mysqli($stmt, $link); $servers_to_print = mysqli_num_rows($rslt); $servers_menu="\n"; $os=0; while ($servers_to_print > $os) { $rowx=mysqli_fetch_row($rslt); $servers_menu .= "\n"; $os++; } echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "Test Outbound Call: "; echo "code:   "; echo "number:   "; echo "server:   "; echo "   $NWB#settings-test_campaign_calls$NWE


\n"; } else { echo "Test calling disabled

\n"; } } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this campaign
\n"; } echo "
\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_to_mysqli($stmt, $link); $cats_to_print = mysqli_num_rows($rslt); $cats_list=""; $o=0; while ($cats_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $cats_list .= "\n"; $catsname_list["$rowx[0]"] = substr($rowx[1],0,20); $o++; } echo "
\n"; echo "
CUSTOM STATUSES WITHIN THIS CAMPAIGN:   $NWB#campaign_statuses$NWE
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\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_to_mysqli($stmt, $link); $cats_to_print = mysqli_num_rows($rslt); $cats_list=""; $o=0; while ($cats_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $cats_list .= "\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,completed from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by status;"; $rslt=mysql_to_mysqli($stmt, $link); $statuses_to_print = mysqli_num_rows($rslt); $o=0; while ($statuses_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $AScategory = $rowx[4]; $o++; if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; echo "\n"; echo "\n"; } echo "
S
T
A
T
U
S
DESCRIPTIONCATEGORY
A
G
E
N
T
 
S
E
L
E
C
T
A
B
L
E
H
U
M
A
N
 
A
N
S
W
E
R
S
A
L
E
D
N
C
C
U
S
T
O
M
E
R
 
C
O
N
T
A
C
T
N
O
T
 
I
N
T
E
R
E
S
T
E
D
U
N
W
O
R
K
A
B
L
E
S
C
H
E
D
U
L
E
D
 
C
A
L
L
B
A
C
K
C
O
M
P
L
E
T
E
D
MODIFY/DELETE
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "$rowx[0]
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "         \n"; echo "   \n"; if (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$rowx[0])) { echo "DELETE\n"; } else { echo "DELETE\n"; } echo "
\n"; echo "
ADD NEW CUSTOM CAMPAIGN STATUS
\n"; echo "\n"; echo "\n"; echo "Status:   \n"; echo "Description:   \n"; echo "Selectable:   \n"; echo "Human Answer:  
\n"; echo "Sale:   \n"; echo "DNC:   \n"; echo "Customer Contact:   \n"; echo "Not Interested:  
\n"; echo "Unworkable:   \n"; echo "Callback:   \n"; echo "Completed:   \n"; echo "Category: \n"; echo "  
\n"; echo "
\n"; echo "

\n"; } ##### CAMPAIGN HOTKEYS ##### if ($SUB==23) { echo "
CUSTOM HOT KEYS WITHIN THIS CAMPAIGN:   $NWB#campaign_hotkeys$NWE
\n"; echo "\n"; echo "\n"; $stmt="SELECT status,hotkey,status_name,selectable,campaign_id from vicidial_campaign_hotkeys where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by hotkey;"; $rslt=mysql_to_mysqli($stmt, $link); $statuses_to_print = mysqli_num_rows($rslt); $o=0; while ($statuses_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $o++; if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; } echo "
HOT KEYSTATUSDESCRIPTIONDELETE
$rowx[1]$rowx[0]$rowx[2]DELETE
\n"; echo "
ADD NEW CUSTOM CAMPAIGN HOT KEY
\n"; echo "\n"; echo "\n"; echo "\n"; echo "Hotkey:   \n"; echo "Status:   \n"; echo "
\n"; echo "

\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' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $lists_to_print = mysqli_num_rows($rslt); $camp_lists=''; $o=0; while ($lists_to_print > $o) { $rowx=mysqli_fetch_row($rslt); if (preg_match('/Y/', $rowx[1])) {$camp_lists .= "'$rowx[0]',";} $o++; } $camp_lists = preg_replace('/.$/i','',$camp_lists);; $stmt="SELECT recycle_id,campaign_id,status,attempt_delay,attempt_maximum,active from vicidial_lead_recycle where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by status;"; $rslt=mysql_to_mysqli($stmt, $link); $recycle_to_print = mysqli_num_rows($rslt); $o=0; while ($recycle_to_print > $o) { $rowx=mysqli_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 "

LEAD RECYCLING WITHIN THIS CAMPAIGN:   $NWB#lead_recycle$NWE
\n"; echo "\n"; echo "\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_to_mysqli($stmt, $link); $counts_to_print = mysqli_num_rows($rslt); if ($counts_to_print > 0) { $rowx=mysqli_fetch_row($rslt); $recycle_limit = $rowx[0]; } } if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $o++; } echo "
STATUSATTEMPT DELAYATTEMPT MAXIMUMLEADS AT LIMITACTIVE DELETE
  $RECYCLE_status[$o]
\n"; echo "\n"; echo "\n"; echo "
$recycle_limit   DELETE
\n"; echo "
ADD NEW CAMPAIGN LEAD RECYCLE
\n"; echo "\n"; echo "\n"; echo "\n"; echo "Status:   \n"; echo "Attempt Delay: \n"; echo "Attempt Maximum: \n"; echo "
\n"; echo "

\n"; echo "
\n"; echo "* Lead counts taken from active lists in the campaign only.\n"; } ##### CAMPAIGN AUTO-ALT-NUMBER DIALING ##### if ($SUB==26) { echo "

AUTO ALT NUMBER DIALING FOR THIS CAMPAIGN:   $NWB#auto_alt_dial_statuses$NWE
\n"; echo "\n"; echo "\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 (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} $o++; echo "\n"; echo "\n"; } echo "
STATUSESDELETE
$AADstatuses[$o]DELETE
\n"; echo "
ADD NEW AUTO ALT NUMBER DIALING STATUS
\n"; echo "\n"; echo "\n"; echo "Status:   \n"; echo "
\n"; echo "

\n"; } ##### CAMPAIGN PAUSE CODES ##### if ($SUB==27) { echo "

AGENT PAUSE CODES FOR THIS CAMPAIGN:   $NWB#pause_codes$NWE
\n"; echo "\n"; echo "\n"; $stmt="SELECT pause_code,pause_code_name,billable,campaign_id from vicidial_pause_codes where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by pause_code;"; $rslt=mysql_to_mysqli($stmt, $link); $pause_codes_to_print = mysqli_num_rows($rslt); $o=0; while ($pause_codes_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $o++; if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "
PAUSE CODESBILLABLEMODIFYDELETE
$rowx[0]\n"; echo "\n"; echo "\n"; echo "  \n"; echo "
DELETE
\n"; echo "
ADD NEW AGENT PAUSE CODE
\n"; echo "\n"; echo "\n"; echo "Pause Code: \n"; echo "Pause Code Name: \n"; echo "   Billable: \n"; echo "
\n"; echo "

\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' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $lists_to_print = mysqli_num_rows($rslt); $qc_lists_list=''; $p=0; while ($lists_to_print > $p) { $rowx=mysqli_fetch_row($rslt); $qc_lists_list .= " $o) { $rowx=mysqli_fetch_row($rslt); $QCscripts_list .= "\n"; $scriptname_list["$rowx[0]"] = "$rowx[1]"; $o++; } ##### get shifts listings for pulldown $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_to_mysqli($stmt, $link); $shifts_to_print = mysqli_num_rows($rslt); $QCshifts_list=""; $o=0; while ($shifts_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $QCshifts_list .= "\n"; $shiftname_list["$rowx[0]"] = "$rowx[1]"; $o++; } echo "

QC SETTINGS FOR THIS CAMPAIGN:
\n"; echo "
\n"; echo "\n"; echo "\n"; # echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "QC Enabled: $NWB#campaigns-qc_enabled$NWE
QC Statuses:
$NWB#campaigns-qc_statuses$NWE
$qc_statuses_list
QC Lists:
$NWB#campaigns-qc_lists$NWE
$qc_lists_list
QC WebForm: $NWB#campaigns-qc_web_form_address$NWE
QC Script: $NWB#campaigns-qc_script$NWE
QC Shift: $NWB#campaigns-qc_shift_id$NWE
QC Get Record Launch: $NWB#campaigns-qc_get_record_launch$NWE
QC Show Recording: $NWB#campaigns-qc_show_recording$NWE
\n"; echo "

\n"; } ##### CAMPAIGN SURVEY SETTINGS ##### if ($SUB=='20A') { echo "

SURVEY SETTINGS FOR THIS CAMPAIGN:
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "
Survey First Audio File: audio chooser $NWB#campaigns-survey_first_audio_file$NWE
Survey DTMF Digits: $NWB#campaigns-survey_dtmf_digits$NWE
Survey Not Interested Digit: $NWB#campaigns-survey_ni_digit$NWE
Survey Wait Seconds: $NWB#campaigns-survey_wait_sec$NWE
Survey Opt-in Audio File: audio chooser $NWB#campaigns-survey_opt_in_audio_file$NWE
Survey Not Interested Audio File: audio chooser $NWB#campaigns-survey_ni_audio_file$NWE
Survey Method: $NWB#campaigns-survey_method$NWE
Survey No-Response Action: $NWB#campaigns-survey_no_response_action$NWE
Survey Not Interested Status: $NWB#campaigns-survey_ni_status$NWE
Survey Third Digit: $NWB#campaigns-survey_third_digit$NWE
Survey Third Audio File: audio chooser $NWB#campaigns-survey_third_audio_file$NWE
Survey Third Status: $NWB#campaigns-survey_third_status$NWE
Survey Third Extension: $NWB#campaigns-survey_third_exten$NWE
Survey Fourth Digit: $NWB#campaigns-survey_fourth_digit$NWE
Survey Fourth Audio File: audio chooser $NWB#campaigns-survey_fourth_audio_file$NWE
Survey Fourth Status: $NWB#campaigns-survey_fourth_status$NWE
Survey Fourth Extension: $NWB#campaigns-survey_fourth_exten$NWE
Survey Response Digit Map: $NWB#campaigns-survey_response_digit_map$NWE
Survey Survey Xfer Extension: $NWB#campaigns-survey_xfer_exten$NWE
Survey Campaign Recording Directory: $NWB#campaigns-survey_camp_record_dir$NWE
Voicemail: voicemail chooser $NWB#campaigns-voicemail_ext$NWE
Survey Call Menu: $NWB#campaigns-survey_menu_id$NWE
Survey Recording: $NWB#campaigns-survey_recording$NWE
\n"; echo "

\n"; } ##### CAMPAIGN PRESETS ##### if ($SUB==201) { $stmt="SELECT preset_name,preset_number,preset_dtmf,preset_hide_number from vicidial_xfer_presets where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by preset_name;"; $rslt=mysql_to_mysqli($stmt, $link); $presets_to_print = mysqli_num_rows($rslt); echo "

$presets_to_print PRESETS FOR THIS CAMPAIGN:   $NWB#xfer_presets$NWE
\n"; echo "
ADD NEW PRESET -
\n"; echo "\n"; echo "\n"; echo "Preset Name: \n"; echo " Number: \n"; echo " DTMF: \n"; echo "   Hide Number:  \n"; echo "
\n"; echo "

\n"; echo "
\n"; echo "\n"; $o=0; while ($presets_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $o++; if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "
# PRESET NAMENUMBERDTMFHIDEMODIFYDELETE
$o $rowx[0]\n"; echo "\n"; echo "\n"; echo "  DELETE
\n"; } ##### CAMPAIGN AREACODE CID ##### if ($SUB==202) { echo "

AREACODE CIDS FOR THIS CAMPAIGN:   $NWB#campaign_cid_areacodes$NWE
\n"; if ($use_custom_cid != 'AREACODE') {echo "
The campaign setting Custom CallerID is not set to AREACODE!
";} echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; $stmt="SELECT areacode,outbound_cid,active,cid_description,call_count_today from vicidial_campaign_cid_areacodes where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by areacode,outbound_cid;"; $rslt=mysql_to_mysqli($stmt, $link); $accids_to_print = mysqli_num_rows($rslt); $o=0; while ($accids_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $Xareacode[$o] = $rowx[0]; $Xoutbound_cid[$o] = $rowx[1]; $Xactive[$o] = $rowx[2]; $Xcid_description[$o] = $rowx[3]; $Xcall_count_today[$o] = $rowx[4]; $o++; } $o=0; while ($accids_to_print > $o) { $ct = ($o + 1); if ($ct == '1') { $bgcolor='bgcolor="#9BB9FB"'; $bgac = $Xareacode[$o]; } else { if ($Xareacode[$o] != $bgac) { if (preg_match("/1$|3$|5$|7$|9$/i", $bgct)) {$bgcolor='bgcolor="#9BB9FB"';} else {$bgcolor='bgcolor="#B9CBFD"';} $bgct++; $bgac = $Xareacode[$o]; } } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $o++; } echo "
#AREACODECID NUMBERDESCRIPTIONACTIVECALLSDELETE
  $ct   $Xareacode[$o]   $Xoutbound_cid[$o]\n"; if ($Xactive[$o] == 'Y') { echo ""; } else { echo ""; } echo "   $Xcall_count_today[$o]   DELETE
\n"; echo "

\n"; echo "
ADD NEW AREACODE CID
\n"; echo "\n"; echo "\n"; echo "\n"; echo "Areacode: \n"; echo "Outbound CID:
\n"; echo "Description: \n"; echo "
\n"; echo "

\n"; } if ($SUB < 1) { echo "

\n"; echo "LOG ALL AGENTS OUT OF THIS CAMPAIGN

\n"; # echo "EMERGENCY VDAC CLEAR FOR THIS CAMPAIGN

\n"; if ($LOGdelete_campaigns > 0) { echo "

DELETE THIS CAMPAIGN\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 ( (!preg_match("/$campaign_id/i", $LOGallowed_campaigns)) and (!preg_match("/ALL-CAMPAIGNS/i",$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_to_mysqli($stmt, $link); } if ($stage=='hide_dialable') { $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); } if ($stage=='show_leadscount') { $stmt="UPDATE vicidial_campaigns set display_leads_count='Y' where campaign_id='$campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); } if ($stage=='hide_leadscount') { $stmt="UPDATE vicidial_campaigns set display_leads_count='N' where campaign_id='$campaign_id';"; $rslt=mysql_to_mysqli($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,user_group,allow_emails,call_count_limit from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $user_group = $row[131]; $allow_emails = $row[132]; $call_count_limit = $row[133]; if (preg_match('/DISABLED/', $list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} else {$DEFlistDISABLE = 'disabled'; $DEFstatusDISABLED=1;} if ($auto_alt_dial == 'MULTI_LEAD') {$ALTmultiDISABLE=1; $ALTmultiLINK="Multi-Alt-Settings";} else {$ALTmultiDISABLE=0; $ALTmultiLINK='';} $stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed from vicidial_statuses order by status;"; $rslt=mysql_to_mysqli($stmt, $link); $statuses_to_print = mysqli_num_rows($rslt); $statuses_list=''; $dial_statuses_list=''; $o=0; while ($statuses_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $statuses_list .= "\n"; if ($rowx[0] != 'CBHOLD') {$dial_statuses_list .= "\n";} $statname_list["$rowx[0]"] = "$rowx[1]"; $LRstatuses_list .= "\n"; if (preg_match('/Y/i', $rowx[2])) {$HKstatuses_list .= "\n";} $o++; } $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by status;"; $rslt=mysql_to_mysqli($stmt, $link); $Cstatuses_to_print = mysqli_num_rows($rslt); $o=0; while ($Cstatuses_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $statuses_list .= "\n"; if ($rowx[0] != 'CBHOLD') {$dial_statuses_list .= "\n";} $statname_list["$rowx[0]"] = "$rowx[1]"; $LRstatuses_list .= "\n"; if (preg_match('/Y/i', $rowx[2])) {$HKstatuses_list .= "\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' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $rowx=mysqli_fetch_row($rslt); if ($rowx[0] < 1) { $mixes_list="\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' $LOGallowed_campaignsSQL limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); $mixes_to_print = mysqli_num_rows($rslt); $mixes_list="\n"; $o=0; while ($mixes_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $mixes_list .= "\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 "\n"; echo ""; echo ""; echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; } echo "\n"; echo "\n"; if ($SSoutbound_autodial_active < 1) { echo ""; } echo "
$campaign_id: Basic View Detail View List Mix Real-Time Screen  
\n"; if ($SUB < 1) { echo "
\n"; echo ""; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSallow_emails > 0) { echo "\n"; } if ($SSoutbound_autodial_active > 0) { echo "\n"; $o=0; while ($Ds_to_print > $o) { $o++; $Dstatus = $Dstatuses[$o]; echo "\n"; } else { echo "$Dstatus - $statname_list[$Dstatus]         \n"; echo "REMOVE\n"; } } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ( (preg_match("/RATIO|ADAPT/",$dial_method)) and ($SSdisable_auto_dial > 0) ) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "
Campaign ID: $campaign_id$NWB#campaigns-campaign_id$NWE
Campaign Name: $NWB#campaigns-campaign_name$NWE
Campaign Description: $row[57]$NWB#campaigns-campaign_description$NWE
Campaign Change Date: $campaign_changedate   $NWB#campaigns-campaign_changedate$NWE
Campaign Login Date: $campaign_logindate   $NWB#campaigns-campaign_logindate$NWE
Active: $NWB#campaigns-active$NWE
Admin User Group: $user_group $NWB#campaigns-user_group$NWE
Park Music-on-Hold: $row[10] $NWB#campaigns-park_ext$NWE
Web Form: $row[11]$NWB#campaigns-web_form_address$NWE
Allow Closers: $row[12] $NWB#campaigns-allow_closers$NWE
Default Transfer Group: $default_xfer_group $NWB#campaigns-default_xfer_group$NWE
Allow Emails: $allow_emails $NWB#campaigns-allow_emails$NWE
Allow Inbound and Blended: $campaign_allow_inbound $NWB#campaigns-campaign_allow_inbound$NWE
Dial Status $o: \n"; if ($DEFstatusDISABLED > 0) { echo "$Dstatus - $statname_list[$Dstatus]         \n"; echo "REMOVE
Add A Dial Status to Call:   \n"; echo "     $NWB#campaigns-dial_status$NWE
List Order: "; if ($ALTmultiDISABLE > 0) { echo " $ALTmultiLINK"; } else { echo "$NWB#campaigns-lead_order$NWE"; } echo "
List Mix: "; if ($ALTmultiDISABLE > 0) { echo " $ALTmultiLINK"; } else { echo "$NWB#campaigns-list_order_mix$NWE"; } echo "
Lead Filter: "; if ($ALTmultiDISABLE > 0) { echo " $ALTmultiLINK"; } else { echo "$NWB#campaigns-lead_filter_id$NWE"; } echo "
Minimum Hopper Level: $NWB#campaigns-hopper_level$NWE
Force Reset of Hopper: $NWB#campaigns-force_reset_hopper$NWE
Auto-dialing has been disabled on this system
Dial Method: $NWB#campaigns-dial_method$NWE
Auto Dial Level: (0 = off)$NWB#campaigns-auto_dial_level$NWE
Adapt Intensity Modifier: $NWB#campaigns-adaptive_intensity$NWE
Script: $script_id
Get Call Launch: $get_call_launch
\n"; echo "
\n"; if ($SSoutbound_autodial_active > 0) { echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
LISTS WITHIN THIS CAMPAIGN:   $NWB#campaign_lists$NWE\n"; echo "
\n"; echo ""; $LISTlink='stage=LISTIDDOWN'; $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPAIGNlink='stage=CAMPAIGNDOWN'; $CALLDATElink='stage=CALLDATEDOWN'; $SQLorder='order by list_id'; if (preg_match('/LISTIDUP/i', $stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (preg_match('/LISTIDDOWN/i', $stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} if (preg_match('/LISTNAMEUP/i', $stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} if (preg_match('/LISTNAMEDOWN/i', $stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (preg_match('/TALLYUP/i', $stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (preg_match('/TALLYDOWN/i', $stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (preg_match('/ACTIVEUP/i', $stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} if (preg_match('/ACTIVEDOWN/i', $stage)) {$SQLorder='order by active desc'; $ACTIVElink='stage=ACTIVEUP';} if (preg_match('/CAMPAIGNUP/i',$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} if (preg_match('/CAMPAIGNUP/i', $stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} if (preg_match('/CALLDATEUP/i', $stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (preg_match('/CALLDATEDOWN/i', $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,DATE_FORMAT(expiration_date,'%Y%m%d') from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id and campaign_id='$campaign_id' $LOGallowed_campaignsSQL group by list_id $SQLorder"; if ($SSadmin_list_counts < 1) {$stmt="SELECT list_id,list_name,list_description,'X' as tally,active,list_lastcalldate,campaign_id,DATE_FORMAT(expiration_date,'%Y%m%d') from vicidial_lists where campaign_id='$campaign_id' $LOGallowed_campaignsSQL $SQLorder";} $rslt=mysql_to_mysqli($stmt, $link); $lists_to_print = mysqli_num_rows($rslt); echo "
\n"; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo ""; echo ""; echo "\n"; echo "\n"; $o=0; while ($lists_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "\n"; echo "
LIST IDLIST NAMEDESCRIPTIONLEADS COUNTACTIVELAST CALL DATEMODIFY
$row[0] $row[1] $row[2] $row[3] $row[4]"; if (preg_match('/Y/',$row[4])) { $active_lists++; $camp_lists .= "'$row[0]',"; echo ""; } else { $inactive_lists++; echo ""; if ($row[7] < $EXPtestdate) {echo "EXP";} else {echo " ";} echo " $row[5]MODIFY

\n"; echo "
\n"; $filterSQL = $filtersql_list[$lead_filter_id]; $filterSQL = preg_replace("/\\\\/","",$filterSQL); $filterSQL = preg_replace('/^and|and$|^or|or$/i', '',$filterSQL); if (strlen($filterSQL)>4) {$fSQL = "and ($filterSQL)";} else {$fSQL = '';} $camp_lists = preg_replace('/.$/i','',$camp_lists);; echo "This campaign has $active_lists active lists and $inactive_lists inactive lists

\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_to_mysqli($stmt, $link); $statuses_to_print = mysqli_num_rows($rslt); $o=0; while ($statuses_to_print > $o) { $rowx=mysqli_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' $LOGallowed_campaignsSQL order by status;"; $rslt=mysql_to_mysqli($stmt, $link); $Cstatuses_to_print = mysqli_num_rows($rslt); $o=0; while ($Cstatuses_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $statuses_name_list["$rowx[0]"] = "$rowx[1]"; $o++; } # end grab status names echo "
STATUSES WITHIN THE ACTIVE LISTS FOR THIS CAMPAIGN:\n"; echo " - HIDE
"; echo "\n"; echo "\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_to_mysqli($stmt, $link); $statuses_to_print = mysqli_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=mysqli_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 (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} if ($dispo == 'CBHOLD') { $CLB=""; $CLE=""; } else { $CLB=''; $CLE=''; } echo "\n"; $o++; } } echo "\n"; echo "\n"; echo "
STATUSSTATUS NAMECALLEDNOT CALLED
$CLB$dispo$CLE$statuses_name_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; unset($lead_list); } else { echo "SHOW LEAD STATUSES IN THIS CAMPAIGN

"; } if ($display_dialable_count == 'Y') { ### call function to calculate and print dialable leads $single_status=0; dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$fSQL); echo " - HIDE

"; } else { echo "Popup Dialable Leads Count"; echo " - SHOW

"; } $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY') $LOGallowed_campaignsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $rowx=mysqli_fetch_row($rslt); $hopper_leads = "$rowx[0]"; echo "This campaign has $hopper_leads leads in the dial hopper

\n"; echo "Click here to see what leads are in the hopper right now

\n"; echo "Click here to see a VDAD report for this campaign

\n"; } echo "Click here to see all CallBack Holds in this campaign

\n"; if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this campaign
\n"; } echo "\n"; echo "
\n"; ### list of agent rank or skill-level for this campaign echo "
\n"; echo "
AGENT RANKS FOR THIS CAMPAIGN:
\n"; echo "\n"; echo "\n"; $stmt="SELECT vu.user,vca.campaign_rank,vca.calls_today,full_name,vca.campaign_grade from vicidial_campaign_agents vca, vicidial_users vu where campaign_id='$campaign_id' and active='Y' and vu.user=vca.user $LOGadmin_viewable_groupsSQL order by vu.user;"; $rsltx=mysql_to_mysqli($stmt, $link); $users_to_print = mysqli_num_rows($rsltx); $o=0; while ($users_to_print > $o) { $rowx=mysqli_fetch_row($rsltx); $o++; if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; } echo "
USER     RANK     GRADE     CALLS TODAY
$rowx[0] - $rowx[3]$rowx[1]$rowx[4]$rowx[2]

\n"; echo "LOG ALL AGENTS OUT OF THIS CAMPAIGN

\n"; if ($LOGdelete_campaigns > 0) { echo "

DELETE THIS CAMPAIGN\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 ( (!preg_match("/$campaign_id/i", $LOGallowed_campaigns)) and (!preg_match("/ALL-CAMPAIGNS/i",$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' $LOGallowed_campaignsSQL order by list_id;"; $rslt=mysql_to_mysqli($stmt, $link); $mixlists_to_print = mysqli_num_rows($rslt); $mixlists_list=""; $o=0; while ($mixlists_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $mixlists_list .= "\n"; $mixlistsname_list["$rowx[0]"] = "$rowx[1]"; $o++; } echo "

LIST MIXES FOR THIS CAMPAIGN:   $NWB#campaigns-list_order_mix$NWE
\n"; echo "
WARNING, we only recommend List Mix for advanced users, Please read the Manager Manual
\n"; $stmt="SELECT dial_statuses from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $statuses = mysqli_num_rows($rslt); if ($statuses > 0) { $rowy=mysqli_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' $LOGallowed_campaignsSQL order by status, vcl_id;"; $rslt=mysql_to_mysqli($stmt, $link); $listmixes = mysqli_num_rows($rslt); $o=0; while ($listmixes > $o) { $rowx=mysqli_fetch_row($rslt); $vcl_id=$rowx[0]; $o++; if ($o < 2) {$tablecolor='bgcolor="#99FF99"'; $bgcolor='bgcolor="#CCFFCC"';} else { if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$tablecolor='bgcolor="#B9CBFD"'; $bgcolor='bgcolor="#9BB9FB"';} else {$tablecolor='bgcolor="#9BB9FB"'; $bgcolor='bgcolor="#B9CBFD"';} } echo "
\n"; echo ""; echo "\n"; echo "\n"; echo "\n"; } else {echo "$rowx[5]\n";} echo "\n"; echo "\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 "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $q++; } echo "\n"; echo "\n"; echo "\n"; $X='X'; echo "\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "$vcl_id:\n"; echo "\n"; echo "     DELETE LIST MIX
Status: \n"; if ($rowx[5]=='INACTIVE') { echo "$rowx[5]\n"; echo "SET TO ACTIVEMethod:\n"; echo "
LIST IDPRIORITY% MIXSTATUSES
\n"; echo "\n"; echo "List: $MIXdetailsLIST   REMOVE\n"; echo " \n"; echo "ADD   \n"; echo "REMOVE\n"; echo "
\n"; echo "Difference %: \n"; echo "   \n"; echo "\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "List: \n"; if ($q > 39) {$AE_disabled = 'DISABLED';} else {$AE_disabled = '';} echo "\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "
CHANGE: \n"; echo "ALL   \n"; echo "EMPTY\n"; echo "
\n"; echo " \n"; echo "ADD   \n"; echo "REMOVE\n"; echo "
\n"; } echo "

ADD NEW LIST MIX
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "Mix ID: Mix Name: Mix Method: "; echo "
List: Dial Status:  
\n"; echo "
\n"; } } echo "
\n"; } ###################### # ADD=30 campaign not allowed ###################### if ($ADD==30) { echo "
\n"; echo ""; echo "You do not have permission to view campaign $campaign_id\n"; } ###################### # ADD=32 display all campaign statuses ###################### if ($ADD==32) { echo "
\n"; echo ""; echo "
CUSTOM CAMPAIGN STATUSES LISTINGS:\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_to_mysqli($stmt, $link); $campaigns_to_print = mysqli_num_rows($rslt); $o=0; while ($campaigns_to_print > $o) { $row=mysqli_fetch_row($rslt); $campaigns_id_list[$o] = $row[0]; $campaigns_name_list[$o] = $row[1]; $o++; } $o=0; while ($campaigns_to_print > $o) { if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
CAMPAIGNNAMESTATUSESMODIFY
$campaigns_id_list[$o] $campaigns_name_list[$o] "; $stmt="SELECT status from vicidial_campaign_statuses where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL order by status;"; $rslt=mysql_to_mysqli($stmt, $link); $campstatus_to_print = mysqli_num_rows($rslt); $p=0; while ( ($campstatus_to_print > $p) and ($p < 10) ) { $row=mysqli_fetch_row($rslt); echo "$row[0] "; $p++; } if ($p<1) {echo "NONE";} echo "MODIFY STATUSES
\n"; } ###################### # ADD=33 display all campaign hotkeys ###################### if ($ADD==33) { echo "
\n"; echo ""; echo "
CAMPAIGN HOTKEYS LISTINGS:\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_to_mysqli($stmt, $link); $campaigns_to_print = mysqli_num_rows($rslt); $o=0; while ($campaigns_to_print > $o) { $row=mysqli_fetch_row($rslt); $campaigns_id_list[$o] = $row[0]; $campaigns_name_list[$o] = $row[1]; $o++; } $o=0; while ($campaigns_to_print > $o) { if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
CAMPAIGNNAMEHOTKEYSMODIFY
$campaigns_id_list[$o] $campaigns_name_list[$o] "; $stmt="SELECT status from vicidial_campaign_hotkeys where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL order by hotkey;"; $rslt=mysql_to_mysqli($stmt, $link); $campstatus_to_print = mysqli_num_rows($rslt); $p=0; while ( ($campstatus_to_print > $p) and ($p < 10) ) { $row=mysqli_fetch_row($rslt); echo "$row[0] "; $p++; } if ($p<1) {echo "NONE";} echo "MODIFY HOTKEYS
\n"; } ###################### # ADD=35 display all campaign lead recycle entries ###################### if ($ADD==35) { echo "
\n"; echo ""; echo "
CAMPAIGN LEAD RECYCLE LISTINGS:\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_to_mysqli($stmt, $link); $campaigns_to_print = mysqli_num_rows($rslt); $o=0; while ($campaigns_to_print > $o) { $row=mysqli_fetch_row($rslt); $campaigns_id_list[$o] = $row[0]; $campaigns_name_list[$o] = $row[1]; $o++; } $o=0; while ($campaigns_to_print > $o) { if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
CAMPAIGNNAMELEAD RECYCLESMODIFY
$campaigns_id_list[$o] $campaigns_name_list[$o] "; $stmt="SELECT status from vicidial_lead_recycle where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL order by status;"; $rslt=mysql_to_mysqli($stmt, $link); $campstatus_to_print = mysqli_num_rows($rslt); $p=0; while ( ($campstatus_to_print > $p) and ($p < 10) ) { $row=mysqli_fetch_row($rslt); echo "$row[0] "; $p++; } if ($p<1) {echo "NONE";} echo "MODIFY LEAD RECYCLES
\n"; } ###################### # ADD=36 display all campaign auto-alt dial entries ###################### if ($ADD==36) { echo "
\n"; echo ""; echo "
CAMPAIGN LEAD AUTO-ALT DIAL LISTINGS:\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_to_mysqli($stmt, $link); $campaigns_to_print = mysqli_num_rows($rslt); $o=0; while ($campaigns_to_print > $o) { $row=mysqli_fetch_row($rslt); $campaigns_id_list[$o] = $row[0]; $campaigns_name_list[$o] = $row[1]; $o++; } $o=0; while ($campaigns_to_print > $o) { if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
CAMPAIGNNAMEAUTO-ALT DIALMODIFY
$campaigns_id_list[$o] $campaigns_name_list[$o] "; $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $campstatus_to_print = mysqli_num_rows($rslt); $p=0; while ( ($campstatus_to_print > $p) and ($p < 10) ) { $row=mysqli_fetch_row($rslt); echo "$row[0] "; $p++; } if (strlen($row[0])<3) {echo "NONE";} echo "MODIFY AUTO-ALT DIAL
\n"; } ###################### # ADD=37 display all campaign agent pause codes ###################### if ($ADD==37) { echo "
\n"; echo ""; echo "
CAMPAIGN AGENT PAUSE CODE LISTINGS:\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_to_mysqli($stmt, $link); $campaigns_to_print = mysqli_num_rows($rslt); $o=0; while ($campaigns_to_print > $o) { $row=mysqli_fetch_row($rslt); $campaigns_id_list[$o] = $row[0]; $campaigns_name_list[$o] = $row[1]; $o++; } $o=0; while ($campaigns_to_print > $o) { if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
CAMPAIGNNAMEPAUSE CODESMODIFY
$campaigns_id_list[$o] $campaigns_name_list[$o] "; $stmt="SELECT pause_code from vicidial_pause_codes where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL order by pause_code;"; $rslt=mysql_to_mysqli($stmt, $link); $campstatus_to_print = mysqli_num_rows($rslt); $p=0; while ( ($campstatus_to_print > $p) and ($p < 10) ) { $row=mysqli_fetch_row($rslt); echo "$row[0] "; $p++; } if ($p<1) {echo "NONE";} echo "MODIFY PAUSE CODES
\n"; } ###################### # ADD=39 display all campaign list mixes ###################### if ($ADD==39) { echo "
\n"; echo ""; echo "
CAMPAIGN LIST MIX LISTINGS:\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_to_mysqli($stmt, $link); $campaigns_to_print = mysqli_num_rows($rslt); $o=0; while ($campaigns_to_print > $o) { $row=mysqli_fetch_row($rslt); $campaigns_id_list[$o] = $row[0]; $campaigns_name_list[$o] = $row[1]; $o++; } $o=0; while ($campaigns_to_print > $o) { if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
CAMPAIGNNAMELIST MIXMODIFY
$campaigns_id_list[$o] $campaigns_name_list[$o] "; $stmt="SELECT vcl_id from vicidial_campaigns_list_mix where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL order by status,vcl_id;"; $rslt=mysql_to_mysqli($stmt, $link); $campstatus_to_print = mysqli_num_rows($rslt); $p=0; while ( ($campstatus_to_print > $p) and ($p < 10) ) { $row=mysqli_fetch_row($rslt); echo "$row[0] "; $p++; } if ($p<1) {echo "NONE";} echo "MODIFY LIST MIX
\n"; } ###################### # ADD=301 display all campaign presets ###################### if ($ADD==301) { echo "
\n"; echo ""; echo "
CAMPAIGN PRESET LISTINGS:\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $stmt="SELECT campaign_id,campaign_name,enable_xfer_presets from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_to_mysqli($stmt, $link); $campaigns_to_print = mysqli_num_rows($rslt); $o=0; while ($campaigns_to_print > $o) { $row=mysqli_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 (preg_match('/1$|3$|5$|7$|9$/i', $k)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo "\n"; $k++; } $o++; } echo "
CAMPAIGNNAMEPRESETSMODIFY
$campaigns_id_list[$o] $campaigns_name_list[$o] "; $stmt="SELECT preset_name from vicidial_xfer_presets where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL order by preset_name;"; $rslt=mysql_to_mysqli($stmt, $link); $campstatus_to_print = mysqli_num_rows($rslt); $p=0; while ( ($campstatus_to_print > $p) and ($p < 10) ) { $row=mysqli_fetch_row($rslt); echo "$row[0] "; $p++; } if ($p<1) {echo "NONE";} echo "MODIFY PRESETS
\n"; } ###################### # ADD=302 display campaign areacode cid counts ###################### if ($ADD==302) { echo "
\n"; echo ""; echo "
CAMPAIGN AREACODE CID LISTINGS:\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $stmt="SELECT campaign_id,campaign_name,use_custom_cid from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_to_mysqli($stmt, $link); $campaigns_to_print = mysqli_num_rows($rslt); $o=0; while ($campaigns_to_print > $o) { $row=mysqli_fetch_row($rslt); $campaigns_id_list[$o] = $row[0]; $campaigns_name_list[$o] = $row[1]; $use_custom_cid_list[$o] = $row[2]; $o++; } $o=0; $k=0; while ($campaigns_to_print > $o) { if (preg_match('/1$|3$|5$|7$|9$/i', $k)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo "\n"; $k++; $o++; } echo "
CAMPAIGNNAMECUSTOM CIDAC-CIDSMODIFY
$campaigns_id_list[$o] $campaigns_name_list[$o] $use_custom_cid_list[$o] "; $stmt="SELECT count(*) from vicidial_campaign_cid_areacodes where campaign_id='$campaigns_id_list[$o]' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $campstatus_to_print = mysqli_num_rows($rslt); $p=0; while ( ($campstatus_to_print > $p) and ($p < 10) ) { $row=mysqli_fetch_row($rslt); echo "$row[0] "; $p++; } echo "MODIFY AC-CIDS
\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 "
\n"; echo ""; $stmt="SELECT vicidial_lists.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,inventory_report,IFNULL(audit_comments,0),expiration_date,DATE_FORMAT(expiration_date,'%Y%m%d') from vicidial_lists left outer join vicidial_lists_custom on vicidial_lists.list_id=vicidial_lists_custom.list_id where vicidial_lists.list_id='$list_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysqli_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]; $inventory_report = $row[20]; $audit_comments = $row[21]; $expiration_date = $row[22]; $expiration_dateINT = $row[23]; # 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,completed from vicidial_statuses order by status;"; $rslt=mysql_to_mysqli($stmt, $link); $statuses_to_print = mysqli_num_rows($rslt); $o=0; while ($statuses_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $statuses_list["$rowx[0]"] = "$rowx[1]"; $statuses_complete_list["$rowx[0]"] = "$rowx[11]"; $o++; } $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed from vicidial_campaign_statuses where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by status;"; $rslt=mysql_to_mysqli($stmt, $link); $Cstatuses_to_print = mysqli_num_rows($rslt); $o=0; while ($Cstatuses_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $statuses_list["$rowx[0]"] = "$rowx[1]"; $statuses_complete_list["$rowx[0]"] = "$rowx[12]"; $o++; } # end grab status names ##### get scripts listings for pulldown $Lscripts_list = "\n"; $stmt="SELECT script_id,script_name from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_to_mysqli($stmt, $link); $scripts_to_print = mysqli_num_rows($rslt); $o=0; while ($scripts_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $Lscripts_list .= "\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 $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_to_mysqli($stmt, $link); $Dgroups_to_print = mysqli_num_rows($rslt); $Dgroups_menu=''; $Dgroups_selected=0; $o=0; while ($Dgroups_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $Dgroups_menu .= "\n"; $o++; } if ($Dgroups_selected < 1) {$Dgroups_menu .= "\n";} else {$Dgroups_menu .= "\n";} echo "
MODIFY A LISTS RECORD: $list_id
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if($audit_comments=='1') { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSenable_second_webform > 0) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
List ID: $list_id$NWB#lists-list_id$NWE
List Name: $NWB#lists-list_name$NWE
List Description: $NWB#lists-list_description$NWE
Campaign: $NWB#lists-campaign_id$NWE
Active: $NWB#lists-active$NWE \n"; if ( ($expiration_dateINT < $EXPtestdate) and ($active == 'Y') ) {echo "     LIST EXPIRED AND SET TO ACTIVE";} echo "
Reset Lead-Called-Status for this list: $NWB#lists-reset_list$NWE
Reset Times: $NWB#lists-reset_time$NWE
Expiration Date: \n"; echo " $NWB#lists-expiration_date$NWE \n"; if ($expiration_dateINT < $EXPtestdate) { if ($active == 'Y') {echo "     LIST EXPIRED AND SET TO ACTIVE";} else {echo "     LIST EXPIRED";} } echo "
Audit Comments: $NWB#lists-audit_comments$NWE
Audit Comments: $NWB#lists-audit_comments$NWE
List Change Date: $list_changedate   $NWB#lists-list_changedate$NWE
List Last Call Date: $list_lastcalldate   $NWB#lists-list_lastcalldate$NWE
Agent Script Override: $NWB#lists-agent_script_override$NWE
Campaign CID Override: $NWB#lists-campaign_cid_override$NWE
Answering Machine Message Override: audio chooser $NWB#lists-am_message_exten_override$NWE
Drop Inbound Group Override: $NWB#lists-drop_inbound_group_override$NWE
Web Form: $NWB#lists-web_form_address$NWE
Web Form Two: $NWB#lists-web_form_address$NWE
Transfer-Conf Number 1 Override: $NWB#lists-xferconf_a_dtmf$NWE
Transfer-Conf Number 2 Override: $NWB#lists-xferconf_a_dtmf$NWE
Transfer-Conf Number 3 Override: $NWB#lists-xferconf_a_dtmf$NWE
Transfer-Conf Number 4 Override: $NWB#lists-xferconf_a_dtmf$NWE
Transfer-Conf Number 5 Override: $NWB#lists-xferconf_a_dtmf$NWE
Inventory Report: $NWB#lists-inventory_report$NWE
Time Zone Setting: $NWB#lists-time_zone_setting$NWE
\n"; echo "
\n"; echo "
STATUSES WITHIN THIS LIST:
\n"; if ($SSexpanded_list_stats > 0) { echo "\n"; $dialable_total=0; $complete_total=0; $fSQL = ''; $stmt="SELECT dial_statuses,local_call_time,lead_filter_id,drop_lockout_time,call_count_limit from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $dial_statuses = $row[0]; $local_call_time = $row[1]; $lead_filter_id = $row[2]; $drop_lockout_time = $row[3]; $call_count_limit = $row[4]; $stmt="SELECT lead_filter_sql from vicidial_lead_filters where lead_filter_id='$lead_filter_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $filters_to_print = mysqli_num_rows($rslt); if ($filters_to_print > 0) { $rowx=mysqli_fetch_row($rslt); $filterSQL = $rowx[0]; $filterSQL = preg_replace("/\\\\/","",$filterSQL); $filterSQL = preg_replace('/^and|and$|^or|or$/i', '',$filterSQL); if (strlen($filterSQL)>4) {$fSQL = "and ($filterSQL)";} else {$fSQL = '';} } echo "\n"; } else { echo "
STATUSSTATUS NAMECALLEDNOT CALLEDDIALABLEPENETRATION
\n"; echo "\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_to_mysqli($stmt, $link); $statuses_to_print = mysqli_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=mysqli_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 (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} if ($dispo == 'CBHOLD') { $CLB=""; $CLE=""; } else { $CLB=''; $CLE=''; } if ($SSexpanded_list_stats > 0) { ### call function to calculate dialable leads $single_status=1; $dial_statuses=" $dispo -"; $camp_lists=$list_id; if ($statuses_complete_list[$dispo] == 'Y') {$Xdialable_count=0;} else {$Xdialable_count = dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$fSQL);} $dialable_total = ($dialable_total + $Xdialable_count); ### get number of complete calls of this status for penetration calculations $Xcomplete_count = complete_leads($DB,$link,$dial_statuses,$camp_lists,$call_count_limit,$single_status,$campaign_id); $complete_total = ($complete_total + $Xcomplete_count); $dispo_total = ($lead_list['Y'][$dispo] + $lead_list['N'][$dispo]); if ( ($Xcomplete_count < 1) or ($dispo_total < 1) ) {$complete_pct = "0";} else { $complete_pct = intval(($Xcomplete_count / $dispo_total) * 100); } echo "\n"; } else { echo "\n"; } $o++; } } if ($SSexpanded_list_stats > 0) { if ( ($complete_total < 1) or ($lead_list[count] < 1) ) {$total_complete_pct = "0";} else {$total_complete_pct = intval(($complete_total / $lead_list[count]) * 100);} echo "\n"; echo "\n"; } else { echo "\n"; echo "\n"; } echo "
STATUSSTATUS NAMECALLEDNOT CALLED
$CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]." $Xdialable_count $complete_pct%  
$CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]    
TOTAL$lead_list[count]$dialable_total $total_complete_pct%  
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; unset($lead_list); echo "
\n"; echo "
TIME ZONES WITHIN THIS LIST:
\n"; echo "\n"; echo "\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_to_mysqli($stmt, $link); $statuses_to_print = mysqli_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=mysqli_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 j M Y H:i", time() + $LOCALzone); if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} else {$DISPtzone = "$tzone";} if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; } } echo "\n"; echo "\n"; echo "
GMT OFFSET NOW (local time)CALLEDNOT CALLED
".$DISPtzone."     ($LOCALdate)".$lead_list['Y'][$tzone]."".$lead_list['N'][$tzone]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; unset($lead_list); echo "
\n"; echo "
OWNERS WITHIN THIS LIST:
\n"; if ($SSuser_territories_active > 0) { ### if territories are active in the system then allow for selected-territory called-since-last-reset resetting echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\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_to_mysqli($stmt, $link); $owners_to_print = mysqli_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=mysqli_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 (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} $CLB=''; $CLE=''; echo "\n"; $o++; } } echo "\n"; echo "\n"; echo "\n"; echo "\n"; } else { echo "
OWNERCALLEDNOT CALLEDRESET
$CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]
\n"; echo "\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_to_mysqli($stmt, $link); $owners_to_print = mysqli_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=mysqli_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 (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} $CLB=''; $CLE=''; echo "\n"; $o++; } } echo "\n"; echo "\n"; } echo "
OWNERCALLEDNOT CALLED
$CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; unset($lead_list); echo "
\n"; echo "
RANKS WITHIN THIS LIST:
\n"; echo "\n"; echo "\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_to_mysqli($stmt, $link); $ranks_to_print = mysqli_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=mysqli_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 (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} $CLB=''; $CLE=''; echo "\n"; $o++; } } echo "\n"; echo "\n"; echo "
RANKCALLEDNOT CALLED
$CLB$rank$CLE".$lead_list['Y'][$rank]."".$lead_list['N'][$rank]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; unset($lead_list); if ($SScountry_code_list_stats > 0) { echo "
\n"; echo "
COUNTRY CODES WITHIN THIS LIST:
\n"; echo "\n"; echo "\n"; $leads_in_list = 0; $leads_in_list_N = 0; $leads_in_list_Y = 0; $stmt="SELECT country_code,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by country_code,called_since_last_reset order by country_code,called_since_last_reset;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $ranks_to_print = mysqli_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=mysqli_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 (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} $CLB=''; $CLE=''; echo "\n"; $o++; } } echo "\n"; echo "\n"; echo "
CODECALLEDNOT CALLED
$CLB$rank$CLE".$lead_list['Y'][$rank]."".$lead_list['N'][$rank]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\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_to_mysqli($stmt, $link); $status_called_to_print = mysqli_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=mysqli_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 "
\n"; echo "
CALLED COUNTS WITHIN THIS LIST:
\n"; echo "\n"; echo ""; $first = $all_called_first; while ($first <= $all_called_last) { if (preg_match('/1$|3$|5$|7$|9$/i', $first)) {$AB='bgcolor="#AFEEEE"';} else{$AB='bgcolor="#E0FFFF"';} if ($first >= 100) {$Fplus='+';} else {$Fplus='';} echo ""; $first++; } echo "\n"; $sts=0; $statuses_called_to_print = count($status); while ($statuses_called_to_print > $sts) { $Pstatus = $status[$sts]; if (preg_match("/1$|3$|5$|7$|9$/i", $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 ""; $first = $all_called_first; while ($first <= $all_called_last) { if (preg_match("/1$|3$|5$|7$|9$/i", $sts)) { if (preg_match('/1$|3$|5$|7$|9$/i', $first)) {$AB='bgcolor="#9BB9FB"';} else{$AB='bgcolor="#B9CBFD"';} } else { if (preg_match("/0$|2$|4$|6$|8$/i", $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 ""; } $o++; } if (!$called_printed) {echo "";} $first++; } echo "\n\n"; $sts++; } echo ""; $first = $all_called_first; while ($first <= $all_called_last) { if (preg_match('/1$|3$|5$|7$|9$/i', $first)) {$AB='bgcolor="#AFEEEE"';} else{$AB='bgcolor="#E0FFFF"';} echo ""; $first++; } echo "\n"; echo "
STATUSSTATUS NAME$first$FplusSUBTOTAL
$Pstatus$statuses_list[$Pstatus] $count_count[$o]  $leads_in_sts[$sts]
TOTAL$all_called_count[$first]$leads_in_list

\n"; echo "
\n"; if ($SScustom_fields_enabled > 0) { $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id';"; $rslt=mysql_to_mysqli($stmt, $link); $rowx=mysqli_fetch_row($rslt); echo "

Custom fields defined for this list: $rowx[0]
\n"; } echo "

Click here to see all CallBack Holds in this list
\n"; echo "

Click here to download this list

\n"; if ($LOGdelete_lists > 0) { echo "

DELETE THIS LIST\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this list
\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 "
\n"; echo ""; $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,na_call_url,on_hook_cid,group_calldate,action_xfer_cid,drop_callmenu,after_hours_callmenu,user_group,max_calls_method,max_calls_count,max_calls_action,dial_ingroup_cid,group_handling from vicidial_inbound_groups where group_id='$group_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $na_call_url = $row[102]; $on_hook_cid = $row[103]; $group_calldate = $row[104]; $action_xfer_cid = $row[105]; $drop_callmenu = $row[106]; $after_hours_callmenu = $row[107]; $user_group = $row[108]; $max_calls_method = $row[109]; $max_calls_count = $row[110]; $max_calls_action = $row[111]; $dial_ingroup_cid = $row[112]; $group_handling = $row[113]; ##### get callmenu listings for dynamic pulldown $stmt="SELECT menu_id,menu_name from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id;"; $rslt=mysql_to_mysqli($stmt, $link); $Xmenus_to_print = mysqli_num_rows($rslt); $o=0; $Xmenuslist=''; $Wmenuslist=''; while ($Xmenus_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $Xmenuslist .= "\n"; $Wmenuslist .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; $o++; } if ($Xmenus_selected < 1) {$Xmenuslist .= "\n";} if ($Wmenus_selected < 1) {$Wmenuslist .= "\n";} ##### get in-groups listings for dynamic pulldown $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') $LOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_to_mysqli($stmt, $link); $Xgroups_to_print = mysqli_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=mysqli_fetch_row($rslt); $Xgroups_menu .= "\n"; $Dgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; if ($group_id!=$rowx[0]) { $Agroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; $Tgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; $Wgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; $Hgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; } $o++; } if ($Xgroups_selected < 1) {$Xgroups_menu .= "\n";} else {$Xgroups_menu .= "\n";} if ($Dgroups_selected < 1) {$Dgroups_menu .= "\n";} else {$Dgroups_menu .= "\n";} if ($Agroups_selected < 1) {$Agroups_menu .= "\n";} else {$Agroups_menu .= "\n";} if ($Tgroups_selected < 1) {$Tgroups_menu .= "\n";} else {$Tgroups_menu .= "\n";} if ($Wgroups_selected < 1) {$Wgroups_menu .= "\n";} else {$Wgroups_menu .= "\n";} if ($Hgroups_selected < 1) {$Hgroups_menu .= "\n";} else {$Hgroups_menu .= "\n";} echo "
MODIFY A GROUPS RECORD: $row[0]
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSenable_second_webform > 0) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} if ($SScustom_fields_enabled > 0) {$cfwHTML = '';} echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\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' $LOGadmin_viewable_groupsSQL order by group_alias_id;"; $rslt=mysql_to_mysqli($stmt, $link); $group_alias_to_print = mysqli_num_rows($rslt); $group_alias_menu=''; $group_alias_selected=0; $o=0; while ($group_alias_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $group_alias_menu .= "\n"; $o++; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSqc_features_active > 0) { echo "\n"; echo "\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_to_mysqli($stmt, $link); $statuses_to_print = mysqli_num_rows($rslt); $qc_statuses_list=''; $o=0; while ($statuses_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $qc_statuses_list .= " $o) { $rowx=mysqli_fetch_row($rslt); if (!preg_match("/\"$rowx[0]\"/",$qc_statuses_list)) { $qc_statuses_list .= " $o) { $rowx=mysqli_fetch_row($rslt); $QCscripts_list .= "\n"; $scriptname_list["$rowx[0]"] = "$rowx[1]"; $o++; } ##### get shifts listings for pulldown $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_to_mysqli($stmt, $link); $shifts_to_print = mysqli_num_rows($rslt); $QCshifts_list=""; $o=0; while ($shifts_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $QCshifts_list .= "\n"; $shiftname_list["$rowx[0]"] = "$rowx[1]"; $o++; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "
Group ID: $row[0]$NWB#inbound_groups-group_id$NWE
Group Name: $NWB#inbound_groups-group_name$NWE
Group Color: $NWB#inbound_groups-group_color$NWE
Active: $NWB#inbound_groups-active$NWE
In-Group Calldate: $group_calldate$NWB#inbound_groups-group_calldate$NWE
\n"; horizontal_bar_chart($group_id,'8','in-group',$link,'total_calls','call count',1,'',''); echo "
Admin User Group: $NWB#inbound_groups-user_group$NWE
Web Form: $NWB#inbound_groups-web_form_address$NWE
Web Form Two: $NWB#inbound_groups-web_form_address$NWE
Next Agent Call: $NWB#inbound_groups-next_agent_call$NWE
Queue Priority: $NWB#inbound_groups-queue_priority$NWE
On-Hook Ring Time: $NWB#inbound_groups-on_hook_ring_time$NWE
On-Hook CID: $NWB#inbound_groups-on_hook_cid$NWE
Fronter Display: $NWB#inbound_groups-fronter_display$NWE
Script: $NWB#inbound_groups-ingroup_script$NWE
Ignore List Script Override: $NWB#inbound_groups-ignore_list_script_override$NWE
Get Call Launch: $NWB#inbound_groups-get_call_launch$NWE
Transfer-Conf DTMF 1: $NWB#inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf Number 1: $NWB#inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf DTMF 2: $NWB#inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf Number 2: $NWB#inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf Number 3: $NWB#inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf Number 4: $NWB#inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf Number 5: $NWB#inbound_groups-xferconf_a_dtmf$NWE
Timer Action: $NWB#inbound_groups-timer_action$NWE
Timer Action Message: $NWB#inbound_groups-timer_action_message$NWE
Timer Action Seconds: $NWB#inbound_groups-timer_action_seconds$NWE
Timer Action Destination: $NWB#inbound_groups-timer_action_destination$NWE
Drop Call Seconds: $NWB#inbound_groups-drop_call_seconds$NWE
Drop Action: $NWB#inbound_groups-drop_action$NWE
Drop Exten: $NWB#inbound_groups-drop_exten$NWE
Voicemail: voicemail chooser$NWB#inbound_groups-voicemail_ext$NWE
Drop Transfer Group: $NWB#inbound_groups-drop_inbound_group$NWE
Drop Call Menu:$NWB#inbound_groups-drop_callmenu$NWE
Call Time: $NWB#inbound_groups-call_time_id$NWE
\n"; $stmt="SELECT ct_holidays from vicidial_call_times where call_time_id='$call_time_id';"; $rslt=mysql_to_mysqli($stmt, $link); $call_times_to_print = mysqli_num_rows($rslt); if ($call_times_to_print > 0) { $rowx=mysqli_fetch_row($rslt); $ct_holidays = $rowx[0]; $holiday_rules = explode('|',$ct_holidays); $ct_hrs = ((count($holiday_rules)) - 2); if ($ct_hrs < 0) {$ct_hrs=0;} echo "Holidays defined for this call time: $ct_hrs\n"; } else {echo "Call time not found!: $call_time_id\n";} echo "
Action Transfer CID: $NWB#inbound_groups-action_xfer_cid$NWE
After Hours Action: $NWB#inbound_groups-after_hours_action$NWE
After Hours Message Filename: audio chooser $NWB#inbound_groups-after_hours_message_filename$NWE
After Hours Extension: $NWB#inbound_groups-after_hours_exten$NWE
After Hours Voicemail: voicemail chooser$NWB#inbound_groups-after_hours_voicemail$NWE
After Hours Transfer Group: $NWB#inbound_groups-afterhours_xfer_group$NWE
After Hours Call Menu:$NWB#inbound_groups-after_hours_callmenu$NWE
No Agents No Queueing: $NWB#inbound_groups-no_agent_no_queue$NWE
No Agent No Queue Action: $NWB#inbound_groups-no_agent_no_queue$NWE\n"; echo "
"; echo "\n"; if ($no_agent_action=='CALLMENU') { echo ""; echo "Call Menu:"; echo ""; echo " \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 ""; echo "In-Group:"; echo ""; echo " "; echo "   Handle Method: \n"; echo "
Search Method: \n"; echo "   List ID: "; echo "
Campaign ID: \n"; echo "   Phone Code: "; } if ($no_agent_action=='DID') { $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$no_agent_action_value';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $did_id = $row[0]; echo ""; echo "DID:"; echo ""; echo " \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: audio chooser\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:   Context: \n"; } if ( ($no_agent_action=='VOICEMAIL') or ($no_agent_action=='VMAIL_NO_INST') ) { echo "Voicemail Box: voicemail chooser\n"; } echo "

 
Max Calls Method: $NWB#inbound_groups-max_calls_method$NWE
Max Calls Count: $NWB#inbound_groups-max_calls_count$NWE
Max Calls Action: $NWB#inbound_groups-max_calls_action$NWE
Welcome Message Filename: audio chooser $NWB#inbound_groups-welcome_message_filename$NWE
Play Welcome Message: $NWB#inbound_groups-play_welcome_message$NWE
Music On Hold Context: moh chooser $NWB#inbound_groups-moh_context$NWE
On Hold Prompt Filename: audio chooser $NWB#inbound_groups-onhold_prompt_filename$NWE
On Hold Prompt Interval: $NWB#inbound_groups-prompt_interval$NWE
On Hold Prompt No Block: $NWB#inbound_groups-onhold_prompt_no_block$NWE
On Hold Prompt Seconds: $NWB#inbound_groups-onhold_prompt_seconds$NWE
Play Place in Line: $NWB#inbound_groups-play_place_in_line$NWE
Play Estimated Hold Time: $NWB#inbound_groups-play_estimate_hold_time$NWE
Calculate Estimated Hold Seconds: $NWB#inbound_groups-calculate_estimated_hold_seconds$NWE
Estimated Hold Time Minimum Filename: audio chooser $NWB#inbound_groups-eht_minimum_prompt_filename$NWE
Estimated Hold Time Minimum Prompt No Block: $NWB#inbound_groups-eht_minimum_prompt_no_block$NWE
Estimated Hold Time Minimum Prompt Seconds: $NWB#inbound_groups-eht_minimum_prompt_seconds$NWE
Wait Time Option: $NWB#inbound_groups-wait_time_option$NWE
Wait Time Second Option: $NWB#inbound_groups-wait_time_second_option$NWE
Wait Time Third Option: $NWB#inbound_groups-wait_time_third_option$NWE
Wait Time Option Seconds: $NWB#inbound_groups-wait_time_option_seconds$NWE
Wait Time Option Extension: $NWB#inbound_groups-wait_time_option_exten$NWE
Wait Time Option Callmenu: $NWB#inbound_groups-wait_time_option_callmenu$NWE
Wait Time Option Voicemail: voicemail chooser $NWB#inbound_groups-wait_time_option_voicemail$NWE
Wait Time Option Transfer In-Group: $NWB#inbound_groups-wait_time_option_xfer_group$NWE
Wait Time Option Press Filename: audio chooser $NWB#inbound_groups-wait_time_option_press_filename$NWE
Wait Time Option Press No Block: $NWB#inbound_groups-wait_time_option_no_block$NWE
Wait Time Option Press Filename Seconds: $NWB#inbound_groups-wait_time_option_prompt_seconds$NWE
Wait Time Option After Press Filename: audio chooser $NWB#inbound_groups-wait_time_option_callback_filename$NWE
Wait Time Option Callback List ID: $NWB#inbound_groups-wait_time_option_callback_list_id$NWE
Wait Hold Option Priority: $NWB#inbound_groups-wait_hold_option_priority$NWE
Estimated Hold Time Option: $NWB#inbound_groups-hold_time_option$NWE
Hold Time Second Option: $NWB#inbound_groups-hold_time_second_option$NWE
Hold Time Third Option: $NWB#inbound_groups-hold_time_third_option$NWE
Hold Time Option Seconds: $NWB#inbound_groups-hold_time_option_seconds$NWE
Hold Time Option Minimum: $NWB#inbound_groups-hold_time_option_minimum$NWE
Hold Time Option Extension: $NWB#inbound_groups-hold_time_option_exten$NWE
Hold Time Option Callmenu: $NWB#inbound_groups-hold_time_option_callmenu$NWE
Hold Time Option Voicemail: voicemail chooser $NWB#inbound_groups-hold_time_option_voicemail$NWE
Hold Time Option Transfer In-Group: $NWB#inbound_groups-hold_time_option_xfer_group$NWE
Hold Time Option Press Filename: audio chooser $NWB#inbound_groups-hold_time_option_press_filename$NWE
Hold Time Option Press No Block: $NWB#inbound_groups-hold_time_option_no_block$NWE
Hold Time Option Press Filename Seconds: $NWB#inbound_groups-hold_time_option_prompt_seconds$NWE
Hold Time Option After Press Filename: audio chooser $NWB#inbound_groups-hold_time_option_callback_filename$NWE
Hold Time Option Callback List ID: $NWB#inbound_groups-hold_time_option_callback_list_id$NWE
Agent Alert Filename: audio chooser $NWB#inbound_groups-agent_alert_exten$NWE
Agent Alert Delay: $NWB#inbound_groups-agent_alert_delay$NWE
Default Transfer Group: $NWB#inbound_groups-default_xfer_group$NWE
Default Group Alias: $NWB#inbound_groups-default_group_alias$NWE
Dial In-Group CID: $NWB#inbound_groups-dial_ingroup_cid$NWE
Hold Recall Transfer In-Group: $NWB#inbound_groups-hold_recall_xfer_group$NWE
No Delay Call Route: $NWB#inbound_groups-no_delay_call_route$NWE
In-Group Recording Override: $NWB#inbound_groups-ingroup_recording_override$NWE
In-Group Recording Filename: $NWB#inbound_groups-ingroup_rec_filename$NWE
Stats Percent of Calls Answered Within X seconds 1: $NWB#inbound_groups-answer_sec_pct_rt_stat_one$NWE
Stats Percent of Calls Answered Within X seconds 2: $NWB#inbound_groups-answer_sec_pct_rt_stat_one$NWE
Start Call URL: $NWB#inbound_groups-start_call_url$NWE
Dispo Call URL: $NWB#inbound_groups-dispo_call_url$NWE
Add Lead URL: $NWB#inbound_groups-add_lead_url$NWE
No Agent Call URL: $NWB#inbound_groups-na_call_url$NWE
Extension Append CID: $NWB#inbound_groups-extension_appended_cidname$NWE
Uniqueid Status Display: $NWB#inbound_groups-uniqueid_status_display$NWE
Uniqueid Status Prefix: $NWB#inbound_groups-uniqueid_status_prefix$NWE
 
Inbound Group QC Settings:
QC Enabled: $NWB#inbound_groups-qc_enabled$NWE
QC Statuses:
$NWB#inbound_groups-qc_statuses$NWE
$qc_statuses_list
QC WebForm: $NWB#inbound_groups-qc_web_form_address$NWE
QC Script: $NWB#inbound_groups-qc_script$NWE
QC Shift: $NWB#inbound_groups-qc_shift_id$NWE
QC Get Record Launch: $NWB#inbound_groups-qc_get_record_launch$NWE
QC Show Recording: $NWB#inbound_groups-qc_show_recording$NWE
\n"; echo "


\n"; ### list of agent rank or skill-level for this inbound group echo "
\n"; echo "
AGENT RANKS FOR THIS INBOUND GROUP:
\n"; echo "\n"; echo "\n"; $stmt="SELECT user,full_name,closer_campaigns,user_group from vicidial_users where active='Y' $LOGadmin_viewable_groupsSQL order by user;"; $rsltx=mysql_to_mysqli($stmt, $link); $users_to_print = mysqli_num_rows($rsltx); $o=0; while ($users_to_print > $o) { $rowx=mysqli_fetch_row($rsltx); $o++; $ARIG_user[$o] = $rowx[0]; $ARIG_name[$o] = $rowx[1]; $ARIG_close[$o] = $rowx[2]; $ARIG_group[$o] = $rowx[3]; $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,group_grade from vicidial_inbound_group_agents where group_id='$group_id' and user='$ARIG_user[$o]';"; $rsltx=mysql_to_mysqli($stmt, $link); $viga_to_print = mysqli_num_rows($rsltx); if ($viga_to_print > 0) { $rowx=mysqli_fetch_row($rsltx); $ARIG_rank[$o] = $rowx[0]; $ARIG_calls[$o] = $rowx[1]; $ARIG_grade[$o] = $rowx[2]; } 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',group_grade='1';"; $rslt=mysql_to_mysqli($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'; $ARIG_grade[$o] = '1'; } } if (strlen($ARIG_changenotes) > 10) { ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtDlog|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } if ($stage=='SUBMIT') { $o=0; while ($users_to_print > $o) { $o++; $ARIG_checked=''; $ARIG_ranked=''; $ARIG_graded=''; $checkbox_field="CHECK_$ARIG_user[$o]$US$group_id"; $rank_field="RANK_$ARIG_user[$o]$US$group_id"; $grade_field="GRADE_$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"];} if (isset($_GET["$grade_field"])) {$ARIG_graded=$_GET["$grade_field"];} elseif (isset($_POST["$grade_field"])) {$ARIG_graded=$_POST["$grade_field"];} $ARIG_checked = preg_replace('/[^A-Z]/','',$ARIG_checked); $ARIG_ranked = preg_replace('/[^-0-9]/','',$ARIG_ranked); $ARIG_graded = preg_replace('/[^-0-9]/','',$ARIG_graded); $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_to_mysqli($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_to_mysqli($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_to_mysqli($stmtC, $link); if ($DB > 0) {echo "|$stmtC|";} $ARIG_updated++; $ARIG_changenotes .= "changed rank from $ARIG_rank[$o] to $ARIG_ranked|"; } if ( ($ARIG_graded < $ARIG_grade[$o]) or ($ARIG_graded > $ARIG_grade[$o]) ) { $stmtC="UPDATE vicidial_inbound_group_agents set group_grade='$ARIG_graded' where user='$ARIG_user[$o]' and group_id='$group_id';"; $rslt=mysql_to_mysqli($stmtC, $link); if ($DB > 0) {echo "|$stmtC|";} $ARIG_updated++; $ARIG_changenotes .= "changed grade from $ARIG_grade[$o] to $ARIG_graded|"; } if ($ARIG_updated > 0) { ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|$stmtB|$stmtC|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name,closer_campaigns,viga.group_grade from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user $LOGadmin_viewable_groupsSQL order by vu.user;"; $rsltx=mysql_to_mysqli($stmt, $link); $users_to_print = mysqli_num_rows($rsltx); $o=0; while ($users_to_print > $o) { $rowx=mysqli_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_grade[$o] = $rowx[5]; $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 (preg_match('/1$|3$|5$|7$|9$/i', $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"; $grade_field="GRADE_$ARIG_user[$o]$US$group_id"; $checkbox_list .= "|$checkbox_field"; $checkbox_count++; $users_output .= "\n"; $users_output .= "\n"; $users_output .= "\n"; $users_output .= "\n"; echo "$users_output"; echo "\n"; echo "
USERGROUPSELECTED     RANK     GRADE     CALLS TODAY
$ARIG_user[$o] - $ARIG_name[$o]$ARIG_group[$o]     select all  

\n"; echo "
Click here to see a report for this inbound group

\n"; echo "Click here to see agents logged in to this inbound group

\n"; echo "
\n"; echo "DIDS USING THIS IN-GROUP:
\n"; echo "\n"; $stmt="SELECT did_id,did_pattern,did_description from vicidial_inbound_dids where group_id='$group_id' and did_route='IN_GROUP' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $dids_to_print = mysqli_num_rows($rslt); $o=0; while ($dids_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[1] $row[2]

\n"; echo "CALL MENUS USING THIS IN-GROUP:
\n"; echo "\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' $vmLOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $cms_to_print = mysqli_num_rows($rslt); $o=0; while ($cms_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[0] $row[1]

\n"; echo "CAMPAIGNS ALLOWING THIS IN-GROUP:
\n"; echo "\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $campin_to_print = mysqli_num_rows($rslt); $o=0; while ($campin_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[0] $row[1]
\n"; if ($LOGdelete_ingroups > 0) { # echo "

EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

\n"; echo "

DELETE THIS IN-GROUP\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this In-Group
\n"; } } else { echo "You do not have permission to view this page\n"; exit; } } ###################### # ADD=3811 modify in-group info in the system ###################### if ($ADD==3811) { if ( ($LOGmodify_ingroups==1) and ($SSallow_emails>0) ) { if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) ) { $modify_url = "$PHP_SELF?ADD=3811&group_id=$group_id"; $modify_footer_refresh=1; } echo "
\n"; echo ""; $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,na_call_url,on_hook_cid,group_calldate,action_xfer_cid,drop_callmenu,after_hours_callmenu,user_group,max_calls_method,max_calls_count,max_calls_action,dial_ingroup_cid,group_handling from vicidial_inbound_groups where group_id='$group_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $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]; $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]; $na_call_url = $row[102]; $group_calldate = $row[104]; $action_xfer_cid = $row[105]; $drop_callmenu = $row[106]; $after_hours_callmenu = $row[107]; $user_group = $row[108]; $max_calls_method = $row[109]; $max_calls_count = $row[110]; $max_calls_action = $row[111]; $dial_ingroup_cid = $row[112]; $group_handling = $row[113]; ##### get callmenu listings for dynamic pulldown $stmt="SELECT menu_id,menu_name from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id;"; $rslt=mysql_to_mysqli($stmt, $link); $Xmenus_to_print = mysqli_num_rows($rslt); $o=0; $Xmenuslist=''; $Wmenuslist=''; while ($Xmenus_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $Xmenuslist .= "\n"; $Wmenuslist .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; $o++; } if ($Xmenus_selected < 1) {$Xmenuslist .= "\n";} if ($Wmenus_selected < 1) {$Wmenuslist .= "\n";} ##### get in-groups listings for dynamic pulldown $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') $LOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_to_mysqli($stmt, $link); $Xgroups_to_print = mysqli_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=mysqli_fetch_row($rslt); $Xgroups_menu .= "\n"; $Dgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; if ($group_id!=$rowx[0]) { $Agroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; $Tgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; $Wgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; $Hgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; } $o++; } if ($Xgroups_selected < 1) {$Xgroups_menu .= "\n";} else {$Xgroups_menu .= "\n";} if ($Dgroups_selected < 1) {$Dgroups_menu .= "\n";} else {$Dgroups_menu .= "\n";} if ($Agroups_selected < 1) {$Agroups_menu .= "\n";} else {$Agroups_menu .= "\n";} if ($Tgroups_selected < 1) {$Tgroups_menu .= "\n";} else {$Tgroups_menu .= "\n";} if ($Wgroups_selected < 1) {$Wgroups_menu .= "\n";} else {$Wgroups_menu .= "\n";} if ($Hgroups_selected < 1) {$Hgroups_menu .= "\n";} else {$Hgroups_menu .= "\n";} echo "
MODIFY AN EMAIL GROUPS RECORD: $row[0]
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSenable_second_webform > 0) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; /* Commenting this out because it is handled by the Email Account section and is redundant here echo "\n"; echo "\n"; echo "\n"; echo "\n"; */ echo "\n"; echo "\n"; # echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSqc_features_active > 0) { echo "\n"; echo "\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_to_mysqli($stmt, $link); $statuses_to_print = mysqli_num_rows($rslt); $qc_statuses_list=''; $o=0; while ($statuses_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $qc_statuses_list .= " $o) { $rowx=mysqli_fetch_row($rslt); if (!preg_match("/\"$rowx[0]\"/",$qc_statuses_list)) { $qc_statuses_list .= " $o) { $rowx=mysqli_fetch_row($rslt); $QCscripts_list .= "\n"; $scriptname_list["$rowx[0]"] = "$rowx[1]"; $o++; } ##### get shifts listings for pulldown $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_to_mysqli($stmt, $link); $shifts_to_print = mysqli_num_rows($rslt); $QCshifts_list=""; $o=0; while ($shifts_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $QCshifts_list .= "\n"; $shiftname_list["$rowx[0]"] = "$rowx[1]"; $o++; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "
Group ID: $row[0]$NWB#inbound_groups-group_id$NWE
Group Name: $NWB#inbound_groups-group_name$NWE
Group Color: $NWB#inbound_groups-group_color$NWE
Active: $NWB#inbound_groups-active$NWE
In-Group Email Date: $group_calldate$NWB#inbound_groups-group_emaildate$NWE
\n"; horizontal_bar_chart($group_id,'8','in-group',$link,'total_calls','call count',1); echo "
Admin User Group: $NWB#inbound_groups-user_group$NWE
Web Form: $NWB#inbound_groups-web_form_address$NWE
Web Form Two: $NWB#inbound_groups-web_form_address$NWE
Next Agent Email: $NWB#inbound_groups-next_agent_email$NWE
Queue Priority: $NWB#inbound_groups-queue_priority$NWE
Fronter Display: $NWB#inbound_groups-fronter_display$NWE
In-Group Call Handle Method: $NWB#inbound_dids-call_handle_method$NWE
In-Group Agent Search Method: $NWB#inbound_dids-agent_search_method$NWE
In-Group List ID: $NWB#inbound_dids-list_id$NWE
In-Group Campaign ID: $NWB#inbound_dids-campaign_id$NWE
Start Email URL: $NWB#inbound_groups-start_email_url$NWE
Dispo Email URL: $NWB#inbound_groups-dispo_email_url$NWE
Add Lead URL: $NWB#inbound_groups-add_lead_url$NWE
No Agent Email URL: $NWB#inbound_groups-na_email_url$NWE
Extension Append CID: $NWB#inbound_groups-extension_appended_cidname$NWE
Uniqueid Status Display: $NWB#inbound_groups-uniqueid_status_display$NWE
Uniqueid Status Prefix: $NWB#inbound_groups-uniqueid_status_prefix$NWE
 
Inbound Group QC Settings:
QC Enabled: $NWB#inbound_groups-qc_enabled$NWE
QC Statuses:
$NWB#inbound_groups-qc_statuses$NWE
$qc_statuses_list
QC WebForm: $NWB#inbound_groups-qc_web_form_address$NWE
QC Script: $NWB#inbound_groups-qc_script$NWE
QC Shift: $NWB#inbound_groups-qc_shift_id$NWE
QC Get Record Launch: $NWB#inbound_groups-qc_get_record_launch$NWE
QC Show Recording: $NWB#inbound_groups-qc_show_recording$NWE
\n"; echo "


\n"; ### list of agent rank or skill-level for this inbound group echo "
\n"; echo "
AGENT RANKS FOR THIS INBOUND GROUP:
\n"; echo "\n"; echo "\n"; $stmt="SELECT user,full_name,closer_campaigns,user_group from vicidial_users where active='Y' $LOGadmin_viewable_groupsSQL order by user;"; $rsltx=mysql_to_mysqli($stmt, $link); $users_to_print = mysqli_num_rows($rsltx); $o=0; while ($users_to_print > $o) { $rowx=mysqli_fetch_row($rsltx); $o++; $ARIG_user[$o] = $rowx[0]; $ARIG_name[$o] = $rowx[1]; $ARIG_close[$o] = $rowx[2]; $ARIG_group[$o] = $rowx[3]; $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,group_grade from vicidial_inbound_group_agents where group_id='$group_id' and user='$ARIG_user[$o]';"; $rsltx=mysql_to_mysqli($stmt, $link); $viga_to_print = mysqli_num_rows($rsltx); if ($viga_to_print > 0) { $rowx=mysqli_fetch_row($rsltx); $ARIG_rank[$o] = $rowx[0]; $ARIG_calls[$o] = $rowx[1]; $ARIG_grade[$o] = $rowx[2]; } 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',group_grade='1';"; $rslt=mysql_to_mysqli($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'; $ARIG_grade[$o] = '1'; } } if (strlen($ARIG_changenotes) > 10) { ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtDlog|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } if ($stage=='SUBMIT') { $o=0; while ($users_to_print > $o) { $o++; $ARIG_checked=''; $ARIG_ranked=''; $ARIG_graded=''; $checkbox_field="CHECK_$ARIG_user[$o]$US$group_id"; $rank_field="RANK_$ARIG_user[$o]$US$group_id"; $grade_field="GRADE_$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"];} if (isset($_GET["$grade_field"])) {$ARIG_graded=$_GET["$grade_field"];} elseif (isset($_POST["$grade_field"])) {$ARIG_graded=$_POST["$grade_field"];} $ARIG_checked = preg_replace('/[^A-Z]/','',$ARIG_checked); $ARIG_ranked = preg_replace('/[^-0-9]/','',$ARIG_ranked); $ARIG_graded = preg_replace('/[^-0-9]/','',$ARIG_graded); $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_to_mysqli($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_to_mysqli($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_to_mysqli($stmtC, $link); if ($DB > 0) {echo "|$stmtC|";} $ARIG_updated++; $ARIG_changenotes .= "changed rank from $ARIG_rank[$o] to $ARIG_ranked|"; } if ( ($ARIG_graded < $ARIG_grade[$o]) or ($ARIG_graded > $ARIG_grade[$o]) ) { $stmtC="UPDATE vicidial_inbound_group_agents set group_grade='$ARIG_graded' where user='$ARIG_user[$o]' and group_id='$group_id';"; $rslt=mysql_to_mysqli($stmtC, $link); if ($DB > 0) {echo "|$stmtC|";} $ARIG_updated++; $ARIG_changenotes .= "changed grade from $ARIG_grade[$o] to $ARIG_graded|"; } if ($ARIG_updated > 0) { ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmtA|$stmtB|$stmtC|"; $SQL_log = preg_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_to_mysqli($stmt, $link); } } $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name,closer_campaigns,viga.group_grade from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user $LOGadmin_viewable_groupsSQL order by vu.user;"; $rsltx=mysql_to_mysqli($stmt, $link); $users_to_print = mysqli_num_rows($rsltx); $o=0; while ($users_to_print > $o) { $rowx=mysqli_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_grade[$o] = $rowx[5]; $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 (preg_match('/1$|3$|5$|7$|9$/i', $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"; $grade_field="GRADE_$ARIG_user[$o]$US$group_id"; $checkbox_list .= "|$checkbox_field"; $checkbox_count++; $users_output .= "\n"; $users_output .= "\n"; $users_output .= "\n"; $users_output .= "\n"; echo "$users_output"; echo "\n"; echo "
USERGROUPSELECTED     RANK     GRADE     CALLS TODAY
$ARIG_user[$o] - $ARIG_name[$o]$ARIG_group[$o]     select all  

\n"; echo "
Click here to see a report for this inbound group

\n"; echo "Click here to see agents logged in to this inbound group

\n"; echo "
\n"; echo "EMAIL ACCOUNTS USING THIS IN-GROUP:
\n"; echo "\n"; $stmt="SELECT email_account_id, email_account_name from vicidial_email_accounts where group_id='$group_id';"; $rslt=mysql_to_mysqli($stmt, $link); $emails_to_print = mysqli_num_rows($rslt); $o=0; while ($emails_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[0] $row[1]

\n"; echo "CAMPAIGNS ALLOWING THIS IN-GROUP:
\n"; echo "\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $campin_to_print = mysqli_num_rows($rslt); $o=0; while ($campin_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[0] $row[1]
\n"; if ($LOGdelete_ingroups > 0) { # echo "

EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

\n"; echo "

DELETE THIS IN-GROUP\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this In-Group
\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 "
\n"; echo ""; $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,custom_one,custom_two,custom_three,custom_four,custom_five,user_group from vicidial_inbound_dids where $didSQL $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $custom_one = $row[41]; $custom_two = $row[42]; $custom_three = $row[43]; $custom_four = $row[44]; $custom_five = $row[45]; $user_group = $row[46]; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_to_mysqli($stmt, $link); $campaigns_to_print = mysqli_num_rows($rslt); $campaigns_list=''; $o=0; while ($campaigns_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $campaigns_list .= "\n"; $o++; } ##### get in-groups listings for dynamic pulldown $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_to_mysqli($stmt, $link); $Xgroups_to_print = mysqli_num_rows($rslt); $Xgroups_menu=''; $Xgroups_selected=0; $FXgroups_menu=''; $FXgroups_selected=0; $o=0; while ($Xgroups_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $Xgroups_menu .= "\n"; $FXgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; $o++; } if ($Xgroups_selected < 1) {$Xgroups_menu .= "\n";} else {$Xgroups_menu .= "\n";} if ($FXgroups_selected < 1) {$FXgroups_menu .= "\n";} else {$FXgroups_menu .= "\n";} ##### get in-groups listings for dynamic pulldown $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') $LOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_to_mysqli($stmt, $link); $Dgroups_to_print = mysqli_num_rows($rslt); $Dgroups_menu=''; $Dgroups_selected=0; $FDgroups_menu=''; $FDgroups_selected=0; $o=0; while ($Dgroups_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $Dgroups_menu .= "\n"; $FDgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; $o++; } if ($Dgroups_selected < 1) {$Dgroups_menu .= "\n";} else {$Dgroups_menu .= "\n";} if ($FDgroups_selected < 1) {$FDgroups_menu .= "\n";} else {$FDgroups_menu .= "\n";} echo "
MODIFY A DID RECORD: $row[0]
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; # echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $stmt="SELECT menu_id,menu_name,menu_prompt from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id;"; $rslt=mysql_to_mysqli($stmt, $link); $menus_to_print = mysqli_num_rows($rslt); $menu_list=''; $i=0; while ($i < $menus_to_print) { $row=mysqli_fetch_row($rslt); $menu_list .= ""; $i++; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $stmt="SELECT filter_phone_group_id,filter_phone_group_name from vicidial_filter_phone_groups $whereLOGadmin_viewable_groupsSQL order by filter_phone_group_id;"; $rslt=mysql_to_mysqli($stmt, $link); $Fgroups_to_print = mysqli_num_rows($rslt); $Fgroups_list=''; $i=0; while ($i < $Fgroups_to_print) { $row=mysqli_fetch_row($rslt); $Fgroups_list .= ""; $i++; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
DID Extension: $NWB#inbound_dids-did_pattern$NWE
DID Extension: $did_pattern $NWB#inbound_dids-did_pattern$NWE
DID Description: $NWB#inbound_dids-did_description$NWE
Active: $NWB#inbound_dids-did_active$NWE
Admin User Group: $NWB#inbound_dids-user_group$NWE
DID Route: $NWB#inbound_dids-did_route$NWE
Record Call: $NWB#inbound_dids-record_call$NWE
Extension: $NWB#inbound_dids-extension$NWE
Extension Context: $NWB#inbound_dids-exten_context$NWE
Voicemail Box: voicemail chooser$NWB#inbound_dids-voicemail_ext$NWE
Phone Extension: $NWB#inbound_dids-phone$NWE
Server IP: $NWB#inbound_dids-server_ip$NWE
Call Menu: $NWB#inbound_dids-menu_id$NWE
User Agent: $NWB#inbound_dids-user$NWE
User Unavailable Action: $NWB#inbound_dids-user_unavailable_action$NWE
User Route Settings In-Group: $NWB#inbound_dids-user_route_settings_ingroup$NWE
In-Group ID: $NWB#inbound_dids-group_id$NWE
In-Group Call Handle Method: $NWB#inbound_dids-call_handle_method$NWE
In-Group Agent Search Method: $NWB#inbound_dids-agent_search_method$NWE
In-Group List ID: $NWB#inbound_dids-list_id$NWE
In-Group Campaign ID: $NWB#inbound_dids-campaign_id$NWE
In-Group Phone Code: $NWB#inbound_dids-phone_code$NWE
Clean CID Number: $NWB#inbound_dids-filter_clean_cid_number$NWE
Filter Inbound Number: $NWB#inbound_dids-filter_inbound_number$NWE
Filter Phone Group ID: $NWB#inbound_dids-filter_phone_group_id$NWE
Filter URL: $NWB#inbound_dids-filter_url$NWE
Filter Action: $NWB#inbound_dids-filter_action$NWE
Filter Extension: $NWB#inbound_dids-extension$NWE
Filter Extension Context: $NWB#inbound_dids-exten_context$NWE
Filter Voicemail Box: voicemail chooser$NWB#inbound_dids-voicemail_ext$NWE
Filter Phone Extension: $NWB#inbound_dids-phone$NWE
Filter Server IP: $NWB#inbound_dids-server_ip$NWE
Filter Call Menu: $NWB#inbound_dids-menu_id$NWE
Filter User Agent: $NWB#inbound_dids-user$NWE
Filter User Unavailable Action: $NWB#inbound_dids-user_unavailable_action$NWE
Filter User Route Settings In-Group: $NWB#inbound_dids-user_route_settings_ingroup$NWE
Filter In-Group ID: $NWB#inbound_dids-group_id$NWE
Filter In-Group Call Handle Method: $NWB#inbound_dids-call_handle_method$NWE
Filter In-Group Agent Search Method: $NWB#inbound_dids-agent_search_method$NWE
Filter In-Group List ID: $NWB#inbound_dids-list_id$NWE
Filter In-Group Campaign ID: $NWB#inbound_dids-campaign_id$NWE
Filter In-Group Phone Code: $NWB#inbound_dids-phone_code$NWE
Custom 1: $NWB#inbound_dids-custom_one$NWE
Custom 2: $NWB#inbound_dids-custom_one$NWE
Custom 3: $NWB#inbound_dids-custom_one$NWE
Custom 4: $NWB#inbound_dids-custom_one$NWE
Custom 5: $NWB#inbound_dids-custom_one$NWE
\n"; echo "

\n"; echo "
Click here to see a traffic report for this DID

\n"; echo "
Click here to see a list of recordings and calls for this DID
\n"; if ($SSdid_ra_extensions_enabled > 0) { echo "

SEE DID REMOTE AGENT EXTENSION OVERRIDES FOR THIS DID\n"; } if ($LOGdelete_dids > 0) { echo "

DELETE THIS DID\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this DID\n"; } } else { echo "You do not have permission to view this page\n"; exit; } } ###################### # ADD=1320 display did remote agent extension override summary ###################### if ($ADD==1320) { echo "
\n"; echo ""; echo "
REMOTE AGENT EXTENSION OVERRIDE LISTINGS:\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $stmt="SELECT did_id,did_pattern,did_description from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_id;"; $rslt=mysql_to_mysqli($stmt, $link); $dids_to_print = mysqli_num_rows($rslt); $o=0; while ($dids_to_print > $o) { $row=mysqli_fetch_row($rslt); $dids_id_list[$o] = $row[0]; $did_pattern_list[$o] = $row[1]; $did_description_list[$o] = $row[2]; $o++; } $o=0; $k=0; while ($dids_to_print > $o) { if (preg_match('/1$|3$|5$|7$|9$/i', $k)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo "\n"; $k++; $o++; } echo "
DIDNAMERA-EXTENSMODIFY
$did_pattern_list[$o] $did_description_list[$o] "; $stmt="SELECT count(*) from vicidial_did_ra_extensions where did_id='$dids_id_list[$o]';"; $rslt=mysql_to_mysqli($stmt, $link); $didstatus_to_print = mysqli_num_rows($rslt); $p=0; while ( ($didstatus_to_print > $p) and ($p < 10) ) { $row=mysqli_fetch_row($rslt); echo "$row[0] "; $p++; } echo "MODIFY RA-EXTENS
\n"; } ###################### # ADD=3321 modify did remote agent extension override entries in the system ###################### if ($ADD==3321) { if ( ($LOGmodify_dids==1) and ($SSdid_ra_extensions_enabled > 0) ) { echo ""; ##### BEGIN Add/Delete/Modify DID Remote Agent Extensions section ##### if ($stage == 'ADD') { if ($add_copy_disabled > 0) { echo "
You do not have permission to add records on this system -system_settings-\n"; } else { $stmt="SELECT count(*) from vicidial_did_ra_extensions where did_id='$did_id' and user_start='$user_start' and extension='$extension';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] > 0) {echo "
DID REMOTE AGENT EXTENSION OVERRIDE NOT ADDED - there is already an entry for this DID with this RA EXTENSION
\n";} else { if ( (strlen($did_id) < 1) or (strlen($user_start) < 2) or (strlen($extension) < 4) ) { echo "
DID REMOTE AGENT EXTENSION OVERRIDE NOT ADDED - Please go back and look at the data you entered
\n"; } else { echo "
DID REMOTE AGENT EXTENSION OVERRIDE ADDED: $did_id - $user_start - $extension
\n"; $stmt="INSERT INTO vicidial_did_ra_extensions(did_id,user_start,extension,description,active) values('$did_id','$user_start','$extension','$description','Y');"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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='DID_RA-EXTEN', event_type='ADD', record_id='$did_id', event_code='ADMIN ADD DID RA EXTEN', event_sql=\"$SQL_log\", event_notes='DID: $user_start - $extension';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); } } } } if ($stage == 'DELETE') { $stmt="SELECT count(*) from vicidial_did_ra_extensions where did_id='$did_id' and user_start='$user_start' and extension='$extension';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if ($row[0] < 1) {echo "
DID REMOTE AGENT EXTENSION OVERRIDE NOT DELETED - this entry does not exist
\n";} else { if ( (strlen($did_id) < 1) or (strlen($user_start) < 2) or (strlen($extension) < 4) ) { echo "
DID REMOTE AGENT EXTENSION OVERRIDE NOT DELETED - Please go back and look at the data you entered
\n"; } else { echo "
DID REMOTE AGENT EXTENSION OVERRIDE DELETED: $did_id - $user_start - $extension
\n"; $stmt="DELETE FROM vicidial_did_ra_extensions where did_id='$did_id' and user_start='$user_start' and extension='$extension';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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='DID_RA-EXTEN', event_type='DELETE', record_id='$did_id', event_code='ADMIN DELETE DID RA EXTEN', event_sql=\"$SQL_log\", event_notes='DID: $user_start - $extension';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); } } } if ($stage == 'MODIFY') { $stmt="SELECT user_start,extension,active,description,call_count_today from vicidial_did_ra_extensions where did_id='$did_id' order by user_start,extension;"; $rslt=mysql_to_mysqli($stmt, $link); $raextens_to_print = mysqli_num_rows($rslt); $o=0; while ($raextens_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $Xuser_start[$o] = $rowx[0]; $Xextension[$o] = $rowx[1]; $Xactive[$o] = $rowx[2]; $Xdescription[$o] = $rowx[3]; $Xcall_count_today[$o] = $rowx[4]; $o++; } $o=0; while ($raextens_to_print > $o) { $Factive_value=''; $Fdescription_value=''; $Factive = "active_$Xuser_start[$o]_$Xextension[$o]"; $Fdescription = "description_$Xuser_start[$o]_$Xextension[$o]"; if (isset($_GET[$Factive])) {$Factive_value=$_GET[$Factive];} elseif (isset($_POST[$Factive])) {$Factive_value=$_POST[$Factive];} if (isset($_GET[$Fdescription])) {$Fdescription_value=$_GET[$Fdescription];} elseif (isset($_POST[$Fdescription])) {$Fdescription_value=$_POST[$Fdescription];} $Fdescription_value = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$Fdescription_value); $Factive_value = preg_replace('/[^A-Z]/','',$Factive_value); # echo "$did_id - $Xuser_start[$o] - $Xextension[$o] - $Factive($Factive_value|$Xactive[$o]) - $Fdescription($Fdescription_value|$Xdescription[$o])
"; if ( ($Factive_value == $Xactive[$o]) and ($Fdescription_value == $Xdescription[$o]) ) { # echo "
DID REMOTE AGENT EXTENSION OVERRIDE NOT MODIFIED - Please go back and look at the data you entered
\n"; } else { echo "DID REMOTE AGENT EXTENSION OVERRIDE MODIFIED: $Xuser_start[$o] - $Xextension[$o]
\n"; $stmt="UPDATE vicidial_did_ra_extensions SET active='$Factive_value',description='$Fdescription_value' WHERE did_id='$did_id' and user_start='$Xuser_start[$o]' and extension='$Xextension[$o]';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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='DID_RA-EXTEN', event_type='MODIFY', record_id='$did_id', event_code='ADMIN MODIFY DID RA EXTEN', event_sql=\"$SQL_log\", event_notes='DID: $user_start - $extension';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); } $o++; } } ##### END Add/Delete/Modify DID Remote Agent Extensions section ##### if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) ) { $modify_url = "$PHP_SELF?ADD=3321&did_id=$did_id"; $modify_footer_refresh=1; } echo "
\n"; echo ""; echo "

REMOTE AGENT EXTENSION OVERRIDES FOR THIS DID:   $NWB#did_ra_extensions$NWE
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; $stmt="SELECT user_start,extension,active,description,call_count_today from vicidial_did_ra_extensions where did_id='$did_id' order by user_start,extension;"; $rslt=mysql_to_mysqli($stmt, $link); $raextens_to_print = mysqli_num_rows($rslt); $o=0; while ($raextens_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $Xuser_start[$o] = $rowx[0]; $Xextension[$o] = $rowx[1]; $Xactive[$o] = $rowx[2]; $Xdescription[$o] = $rowx[3]; $Xcall_count_today[$o] = $rowx[4]; $o++; } $o=0; while ($raextens_to_print > $o) { $ct = ($o + 1); if ($ct == '1') { $bgcolor='bgcolor="#9BB9FB"'; $bgac = $Xuser_start[$o]; } else { if ($Xuser_start[$o] != $bgac) { if (preg_match("/1$|3$|5$|7$|9$/i", $bgct)) {$bgcolor='bgcolor="#9BB9FB"';} else {$bgcolor='bgcolor="#B9CBFD"';} $bgct++; $bgac = $Xuser_start[$o]; } } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $o++; } echo "
#USER STARTEXTENSIONDESCRIPTIONACTIVECALLSDELETE
  $ct   $Xuser_start[$o]   $Xextension[$o]\n"; if ($Xactive[$o] == 'Y') { echo ""; } else { echo ""; } echo "   $Xcall_count_today[$o]   DELETE
\n"; echo "

\n"; echo "
ADD NEW REMOTE AGENT EXTENSION OVERRIDE
\n"; echo "\n"; echo "\n"; echo "\n"; echo "User Start: \n"; echo "Extension:
\n"; echo "Description: \n"; echo "
\n"; echo "

\n"; echo "

MODIFY THIS DID\n"; if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this DID
\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 "
\n"; echo ""; $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,dtmf_field,user_group,qualify_sql from vicidial_call_menu where menu_id='$menu_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $dtmf_field = $row[12]; $user_group = $row[13]; $qualify_sql = $row[14]; echo "
MODIFY A CALL MENU RECORD: $menu_id
\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\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_to_mysqli($stmtA, $link); $menus_to_print = mysqli_num_rows($rslt); while ($menus_to_print > $j) { $row=mysqli_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 * 80) + 550); $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 = ""; if (preg_match("/1$|3$|5$|7$|9$/i", $j)) {$bgcolor='bgcolor="#CCFFFF"';} else {$bgcolor='bgcolor="#99FFCC"';} echo "\n"; $j++; } while ($j <= 20) { $choose_height = (($j * 80) + 550); $dtmf_list = ""; if (preg_match("/1$|3$|5$|7$|9$/i", $j)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; $j++; } if ($SSallow_custom_dialplan > 0) { echo "\n"; } else { echo "\n"; } if ($SScall_menu_qualify_enabled > 0) { echo "\n"; } else {echo "\n";} echo "\n"; echo "
Menu ID: $menu_id $NWB#call_menu-menu_id$NWE
Menu Name: $NWB#call_menu-menu_name$NWE
Admin User Group: $NWB#call_menu-user_group$NWE
Menu Prompt: audio chooser $NWB#call_menu-menu_prompt$NWE
Menu Timeout: $NWB#call_menu-menu_timeout$NWE
Menu Timeout Prompt: audio chooser $NWB#call_menu-menu_timeout_prompt$NWE
Menu Invalid Prompt: audio chooser $NWB#call_menu-menu_invalid_prompt$NWE
Menu Repeat: $NWB#call_menu-menu_repeat$NWE
Menu Time Check: $NWB#call_menu-menu_time_check$NWE
Call Time: $NWB#call_menu-call_time_id$NWE "; $stmt="SELECT ct_holidays from vicidial_call_times where call_time_id='$call_time_id';"; $rslt=mysql_to_mysqli($stmt, $link); $call_times_to_print = mysqli_num_rows($rslt); if ($call_times_to_print > 0) { $rowx=mysqli_fetch_row($rslt); $ct_holidays = $rowx[0]; $holiday_rules = explode('|',$ct_holidays); $ct_hrs = ((count($holiday_rules)) - 2); if ($ct_hrs < 0) {$ct_hrs=0;} echo "   Holidays defined for this call time: $ct_hrs\n"; } else {echo "Call time not found!\n";} echo "
Track Calls in Real-Time Report: $NWB#call_menu-track_in_vdac$NWE
Tracking Group: $NWB#call_menu-tracking_group$NWE
Log Key Press: $NWB#call_menu-dtmf_log$NWE     Log Field: \n"; echo "$NWB#call_menu-dtmf_field$NWE
Call Menu Options:
Option: $dtmf_list   Description: Route: $NWB#call_menu-option_value$NWE
\n"; if ($option_route=='CALLMENU') { echo ""; echo "Call Menu:"; echo ""; echo " \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 ""; echo "In-Group:"; echo ""; echo " "; echo " "; echo "   Handle Method: $NWB#call_menu-ingroup_settings$NWE\n"; echo "
Search Method: \n"; echo "   List ID: "; echo "
Campaign ID: \n"; echo "   Phone Code: "; echo "
  VID Enter Filename: audio chooser"; echo "
  VID ID Number Filename: audio chooser"; echo "
  VID Confirm Filename: audio chooser"; echo "   VID Digits: "; } if ($option_route=='DID') { $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$option_route_value' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $did_id = $row[0]; echo ""; echo "DID:"; echo ""; echo " \n"; } if ($option_route=='HANGUP') { echo "Audio File: audio chooser\n"; } if ($option_route=='EXTENSION') { echo "Extension:   Context: \n"; } if ($option_route=='PHONE') { echo "Phone: \n"; } if ( ($option_route=='VOICEMAIL') or ($option_route=='VMAIL_NO_INST') ) { echo "Voicemail Box: voicemail chooser\n"; } if ($option_route=='AGI') { echo "AGI: \n"; } echo "

 
Option: $dtmf_list   Description: Route: $NWB#call_menu-option_value$NWE
\n"; echo "
 
Custom Dialplan Entry:
$NWB#call_menu-custom_dialplan_entry$NWE
Custom Dialplan Entry: Disabled $NWB#call_menu-custom_dialplan_entry$NWE
Qualify SQL:
$NWB#call_menu-qualify_sql$NWE
\n"; echo "

\n"; echo "DIDS USING THIS CALL MENU:
\n"; echo "\n"; $stmt="SELECT did_id,did_pattern,did_description from vicidial_inbound_dids where menu_id='$menu_id' and did_route='CALLMENU' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $dids_to_print = mysqli_num_rows($rslt); $o=0; while ($dids_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[1] $row[2]

\n"; echo "CALL MENUS USING THIS CALL MENU:
\n"; echo "\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_to_mysqli($stmt, $link); $cms_to_print = mysqli_num_rows($rslt); $o=0; while ($cms_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[0] $row[1]
\n"; if ($LOGdelete_dids > 0) { echo "

DELETE THIS CALL MENU\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this CALL MENU
\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 "
\n"; echo ""; $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_to_mysqli($stmt, $link); $row=mysqli_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 user_group of start_user $stmt="SELECT user_group from vicidial_users where user='$user_start' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_to_mysqli($stmt, $link); $vu_to_print = mysqli_num_rows($rsltx); if ($vu_to_print > 0) { $rowx=mysqli_fetch_row($rsltx); $user_group = $rowx[0]; ##### 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_to_mysqli($stmt, $link); $extengrp_to_print = mysqli_num_rows($rsltx); $extengrp_list=''; $o=0; while ($extengrp_to_print > $o) { $rowx=mysqli_fetch_row($rsltx); $extengrp_list .= "\n"; $o++; } echo "
MODIFY A REMOTE AGENTS ENTRY: $row[0]
\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
User ID Start: (numbers only, incremented, must be an existing vicidial user)$NWB#remote_agents-user_start$NWE
Number of Lines: (numbers only)$NWB#remote_agents-number_of_lines$NWE
Server IP: $NWB#remote_agents-server_ip$NWE
External Extension: (dial plan number dialed to reach agents)$NWB#remote_agents-conf_exten$NWE
Extension Group: $NWB#remote_agents-extension_group$NWE
Status: $NWB#remote_agents-status$NWE
Campaign: $NWB#remote_agents-campaign_id$NWE
On-Hook Agent: $NWB#remote_agents-on_hook_agent$NWE
On-Hook Ring Time: $NWB#remote_agents-on_hook_ring_time$NWE
\n"; horizontal_bar_chart($user_start,'8','remote-agent',$link,'ra_total_calls','call count',1,'',''); echo "
Inbound Groups: \n"; echo "$groups_list"; echo "$NWB#remote_agents-closer_campaigns$NWE
\n"; echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; ##### get count of did ra extens $stmt="SELECT count(*) from vicidial_did_ra_extensions where user_start='$user_start';"; $rsltx=mysql_to_mysqli($stmt, $link); $didraext_to_print = mysqli_num_rows($rsltx); $didraext_count='0'; if ($didraext_to_print > 0) { $rowx=mysqli_fetch_row($rsltx); $didraext_count = $rowx[0]; } if ($SSdid_ra_extensions_enabled > 0) { echo "

THERE ARE $didraext_count DID REMOTE AGENT EXTENSION OVERRIDES FOR THIS REMOTE AGENT\n"; } if ($LOGdelete_remote_agents > 0) { echo "

DELETE THIS REMOTE AGENT\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this remote agent
\n"; } } else { echo "User Start for this remote agent does not exist: $user_start\n"; exit; } } 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 "
\n"; echo ""; $stmt="SELECT filter_phone_group_id,filter_phone_group_name,filter_phone_group_description,user_group from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $filter_phone_group_id = $row[0]; $filter_phone_group_name = $row[1]; $filter_phone_group_description = $row[2]; $user_group = $row[3]; echo "
Modify Filter Phone Group: $filter_phone_group_id\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Filter Phone Group ID: $filter_phone_group_id $NWB#filter_phone_groups-user_start$NWE
Filter Phone Group Name: $NWB#filter_phone_groups-filter_phone_group_name$NWE
Filter Phone Group Description: $NWB#filter_phone_groups-filter_phone_group_description$NWE
Admin User Group: $NWB#filter_phone_groups-user_group$NWE
\n"; $stmt="SELECT count(*) from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); echo "

Numbers in this Filter Phone Group: $row[0]"; if ($LOGdelete_dids > 0) { echo "

DELETE THIS FILTER PHONE GROUP\n"; } if ($LOGuser_level >= 9) { echo "

Click here to download the numbers in this filter phone group
\n"; echo "

Click here to see Admin changes to this filter phone group\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 "
\n"; echo ""; $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_to_mysqli($stmt, $link); $row=mysqli_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 "
MODIFY AN EXTENSION GROUP ENTRY: $row[0]\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Extension Group: (no spaces)$NWB#extension_groups-extension_group_id$NWE
Extension: (numbers only)$NWB#extension_groups-extension$NWE
Rank: $NWB#extension_groups-rank$NWE
Campaigns Groups: (pipe-delimited list)$NWB#extension_groups-extension$NWE
Call Count Today: $call_count_today
Last Call Time: $last_call_time
Last Call ID: $last_callerid
\n"; if ($LOGdelete_remote_agents > 0) { echo "

DELETE THIS EXTENSION GROUP ENTRY\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this extension group entry
\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 ( ($LOGmodify_same_user_level < 1) and ($user_group=="$LOGuser_group") ) { echo "You are not allowed to edit your own user group\n"; exit; } else { 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 "
\n"; echo ""; $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,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $admin_viewable_groups = $row[22]; $admin_viewable_call_times = $row[23]; echo ""; echo "
MODIFY A USERS GROUP ENTRY\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if (strlen($SSwebphone_url) > 5) { echo "\n"; echo "\n"; echo "\n"; } else { echo " "; echo " "; echo " "; } if ($SSqc_features_active > 0) { echo "\n"; echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "
Group: (no spaces or punctuation)$NWB#user_groups-user_group$NWE
Description: (description of group)$NWB#user_groups-group_name$NWE
Force Timeclock Login: $NWB#user_groups-forced_timeclock_login$NWE
Shift Enforcement: $NWB#user_groups-shift_enforcement$NWE
Allowed Campaigns:
$NWB#user_groups-allowed_campaigns$NWE
\n"; echo "$campaigns_list
 "; echo "
Group Shifts:
$NWB#user_groups-group_shifts$NWE
\n"; $stmt="SELECT shift_id,shift_name from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; if ($DB > 0) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $shifts_to_print = mysqli_num_rows($rslt); $o=0; while ($shifts_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $shift_id_value = $rowx[0]; $shift_name_value = $rowx[1]; echo " $shift_id_value - $shift_name_value
\n"; $o++; } echo "
 
Agent Status Viewable Groups:
$NWB#user_groups-agent_status_viewable_groups$NWE
\n"; if ($admin_viewable_groupsALL > 0) { echo "ALL-GROUPS - All user groups in the system
\n"; } echo "CAMPAIGN-AGENTS - All users logged into the same campaign as the agent
\n"; if ($admin_viewable_groupsALL > 0) { echo "NOT-LOGGED-IN-AGENTS - All users in the system, even not logged-in users
\n"; } $stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_to_mysqli($stmt, $link); $view_groups_to_print = mysqli_num_rows($rslt); $o=0; while ($view_groups_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $vgroups_id_value = $rowx[0]; $vgroups_name_value = $rowx[1]; echo " $vgroups_id_value - $vgroups_name_value
\n"; $o++; } echo "
 
Agent Status View Time: $NWB#user_groups-agent_status_view_time$NWE
Agent Call Log View: $NWB#user_groups-agent_call_log_view$NWE
Agent Allow Consultative Xfer: $NWB#user_groups-agent_xfer_options$NWE
Agent Allow Dial Override Xfer: $NWB#user_groups-agent_xfer_options$NWE
Agent Allow Voicemail Message Xfer: $NWB#user_groups-agent_xfer_options$NWE
Agent Allow Blind Xfer: $NWB#user_groups-agent_xfer_options$NWE
Agent Allow Dial With Customer Xfer: $NWB#user_groups-agent_xfer_options$NWE
Agent Allow Park Customer Dial Xfer: $NWB#user_groups-agent_xfer_options$NWE
Agent Fullscreen: $NWB#user_groups-agent_fullscreen$NWE
Allowed Reports: $NWB#user_groups-allowed_reports$NWE
Webphone URL Override: $NWB#user_groups-webphone_url_override$NWE
Webphone System Key Override: $NWB#user_groups-webphone_systemkey_override$NWE
Webphone Dialpad Override: $NWB#user_groups-webphone_dialpad_override$NWE
QC Allowed Campaigns:
$NWB#user_groups-qc_allowed_campaigns$NWE
\n"; echo "$qc_campaigns_list"; echo "
 
QC Allowed Inbound Groups:
$NWB#user_groups-qc_allowed_inbound_groups$NWE
\n"; echo "$qc_groups_list"; echo "
 
Allowed User Groups:
$NWB#user_groups-admin_viewable_groups$NWE
\n"; if ($admin_viewable_groupsALL > 0) { echo "ALL-GROUPS - All user groups in the system
\n"; } $stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_to_mysqli($stmt, $link); $view_groups_to_print = mysqli_num_rows($rslt); $o=0; while ($view_groups_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $vgroups_id_value = $rowx[0]; $vgroups_name_value = $rowx[1]; echo " $vgroups_id_value - $vgroups_name_value
\n"; $o++; } echo "
 
Allowed Call Times:
$NWB#user_groups-admin_viewable_call_times$NWE
\n"; echo "ALL-CALLTIMES - All call times in the system
\n"; $stmt="SELECT call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;"; $rslt=mysql_to_mysqli($stmt, $link); $view_calltimes_to_print = mysqli_num_rows($rslt); $o=0; while ($view_calltimes_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $vcalltimes_id_value = $rowx[0]; $vcalltimes_name_value = $rowx[1]; echo " $vcalltimes_id_value - $vcalltimes_name_value
\n"; $o++; } echo "
 
\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' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_to_mysqli($stmt, $link); $users_to_print = mysqli_num_rows($rsltx); echo "
\n"; echo "
USERS WITHIN THIS USER GROUP: $users_to_print
\n"; echo "\n"; echo "\n"; $o=0; while ($users_to_print > $o) { $rowx=mysqli_fetch_row($rsltx); $o++; if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "
USERFULL NAMELEVELACTIVE
$rowx[0]$rowx[1]$rowx[2]$rowx[3]

\n"; ##### BEGIN add/remove in-group as selected for all active users in this group ##### echo "
\n"; echo "
Add or Remove In-Group Selected For Active Users in This User Group
\n"; echo "\n"; echo "\n"; echo "\n"; ### get in-groups listings for dynamic pulldown $stmt="SELECT group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_to_mysqli($stmt, $link); $Xgroups_to_print = mysqli_num_rows($rslt); $Xgroups_menu=''; $o=0; while ($Xgroups_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $Xgroups_menu .= "\n"; $o++; } echo "   \n"; echo "In-Group:
\n"; echo "
\n"; ##### END add/remove in-group as selected for all active users in this group ##### echo "

Click here to see all CallBack Holds in this user group

\n"; echo "

Click here to see the Timeclock Status for this user group

\n"; if ($LOGdelete_user_groups > 0) { echo "

DELETE THIS USER GROUP\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this user group
\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 "
\n"; echo ""; $stmt="SELECT script_id,script_name,script_comments,script_text,active,user_group from vicidial_scripts where script_id='$script_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $script_name = $row[1]; $script_comments = $row[2]; $script_text = stripslashes($row[3]); $active = $row[4]; $user_group = $row[5]; echo ""; echo "
MODIFY A SCRIPT
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Script ID: $script_id$NWB#scripts-script_name$NWE
Script Name: (title of the script)$NWB#scripts-script_name$NWE
Script Comments: $NWB#scripts-script_comments$NWE
Admin User Group: $NWB#scripts-user_group$NWE
Active: $NWB#scripts-active$NWE
Script Text:

Preview Script
"; # BEGIN Insert Field echo ""; echo "
"; # END Insert Field echo " $NWB#scripts-script_text$NWE
\n"; echo "


\n"; echo " CAMPAIGNS USING THIS SCRIPT:
\n"; echo "\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $camps_to_print = mysqli_num_rows($rslt); $o=0; while ($camps_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[0] $row[1]


\n"; echo " IN-GROUPS USING THIS SCRIPT:
\n"; echo "\n"; $stmt="SELECT group_id,group_name from vicidial_inbound_groups where ingroup_script='$script_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $camps_to_print = mysqli_num_rows($rslt); $o=0; while ($camps_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[0] $row[1]


\n"; echo " LIST OVERRIDES USING THIS SCRIPT:
\n"; echo "\n"; $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $camps_to_print = mysqli_num_rows($rslt); $o=0; while ($camps_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } if ($LOGdelete_scripts > 0) { echo "

DELETE THIS SCRIPT\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this script\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 "
$row[0] $row[1]
\n"; echo ""; $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_comments,lead_filter_sql,user_group from vicidial_lead_filters where lead_filter_id='$lead_filter_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $lead_filter_name = $row[1]; $lead_filter_comments = $row[2]; $lead_filter_sql = stripslashes($row[3]); $user_group = $row[4]; echo ""; echo "
MODIFY A FILTER\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Filter ID: $lead_filter_id$NWB#lead_filters-lead_filter_id$NWE
Filter Name: (short description of the filter)$NWB#lead_filters-lead_filter_name$NWE
Filter Comments: $NWB#lead_filters-lead_filter_comments$NWE
Admin User Group: $NWB#lead_filters-user_group$NWE
Filter SQL: $NWB#lead_filters-lead_filter_sql$NWE
\n"; ##### get campaigns listing for dynamic pulldown $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_to_mysqli($stmt, $link); $campaigns_to_print = mysqli_num_rows($rslt); $campaigns_list=''; $o=0; while ($campaigns_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $campaigns_list .= "\n"; $o++; } echo "

"; echo "
TEST ON CAMPAIGN:
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($LOGdelete_filters > 0) { echo "

DELETE THIS FILTER\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this filter
\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; } ### add-remove state rule 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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $ct_state_call_times = $row[0]; if (preg_match('/\|$/i',$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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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 ADD STATE RULE', event_sql=\"$SQL_log\", event_notes='State Rule Added: $state_rule';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); echo "State Rule Added: $state_rule
\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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $ct_state_call_times = $row[0]; $ct_state_call_times = preg_replace("/\|$state_rule\|/i", '|',$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_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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 REMOVE STATE RULE', event_sql=\"$SQL_log\", event_notes='State Rule Removed: $state_rule';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); echo "State Rule Removed: $state_rule
\n"; } ### add-remove holiday rule if ( ($stage=="ADD") and (strlen($holiday_rule)>0) ) { $stmt="SELECT ct_holidays from vicidial_call_times where call_time_id='$call_time_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $ct_holidays = $row[0]; if (preg_match('/\|$/i',$ct_holidays)) {$ct_holidays = "$ct_holidays$holiday_rule\|";} else {$ct_holidays = "$ct_holidays\|$holiday_rule\|";} $stmt="UPDATE vicidial_call_times set ct_holidays='$ct_holidays' where call_time_id='$call_time_id';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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 ADD HOLIDAY RULE', event_sql=\"$SQL_log\", event_notes='Holiday Rule Added: $holiday_rule';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); echo "Holiday Rule Added: $holiday_rule
\n"; } if ( ($stage=="REMOVE") and (strlen($holiday_rule)>0) ) { $stmt="SELECT ct_holidays from vicidial_call_times where call_time_id='$call_time_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $ct_holidays = $row[0]; $ct_holidays = preg_replace("/\|$holiday_rule\|/i", '|',$ct_holidays); $stmt="UPDATE vicidial_call_times set ct_holidays='$ct_holidays' where call_time_id='$call_time_id';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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 REMOVE HOLIDAY RULE', event_sql=\"$SQL_log\", event_notes='Holiday Rule Removed: $holiday_rule';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); echo "Holiday Rule Removed: $holiday_rule
\n"; } $ADD=311111111; } else { echo "You are not authorized to view this page. Please go back."; } } ###################### # ADD=322111111 modify state call time definition info in the system, ADD/REMOVE ###################### if ($ADD==322111111) { 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; } ### add-remove holiday rule if ( ($stage=="ADD") and (strlen($holiday_rule)>0) ) { $stmt="SELECT ct_holidays from vicidial_state_call_times where state_call_time_id='$call_time_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $ct_holidays = $row[0]; if (preg_match('/\|$/i',$ct_holidays)) {$ct_holidays = "$ct_holidays$holiday_rule\|";} else {$ct_holidays = "$ct_holidays\|$holiday_rule\|";} $stmt="UPDATE vicidial_state_call_times set ct_holidays='$ct_holidays' where state_call_time_id='$call_time_id';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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 ADD HOLIDAY RULE', event_sql=\"$SQL_log\", event_notes='Holiday Rule Added: $holiday_rule';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); echo "Holiday Rule Added: $holiday_rule
\n"; } if ( ($stage=="REMOVE") and (strlen($holiday_rule)>0) ) { $stmt="SELECT ct_holidays from vicidial_state_call_times where state_call_time_id='$call_time_id';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $ct_holidays = $row[0]; $ct_holidays = preg_replace("/\|$holiday_rule\|/i",'|',$ct_holidays); $stmt="UPDATE vicidial_state_call_times set ct_holidays='$ct_holidays' where state_call_time_id='$call_time_id';"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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 REMOVE HOLIDAY RULE', event_sql=\"$SQL_log\", event_notes='Holiday Rule Removed: $holiday_rule';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); echo "Holiday Rule Removed: $holiday_rule
\n"; } $ADD=3111111111; } 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 "
\n"; echo ""; $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,user_group,ct_holidays from vicidial_call_times where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $user_group = $row[28]; $ct_holidays = $row[29]; echo ""; echo "
MODIFY A CALL TIME\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\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 "\n"; echo "\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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); echo "\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) $LOGadmin_viewable_groupsSQL"; } else {$srs_SQL="$whereLOGadmin_viewable_groupsSQL";} $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_to_mysqli($stmt, $link); $sct_to_print = mysqli_num_rows($rslt); $sct_list=''; $o=0; while ($sct_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $sct_list .= "\n"; $o++; } echo "\n"; echo "\n"; $ct_hrs=1; $b=0; $hrs_SQL =''; if (strlen($ct_holidays)>2) { $holiday_rules = explode('|',$ct_holidays); $ct_hrs = ((count($holiday_rules)) - 1); } echo "\n"; echo "\n"; while($ct_hrs >= $b) { if (strlen($holiday_rules[$b])>0) { $stmt="SELECT holiday_date,holiday_name from vicidial_call_time_holidays where holiday_id='$holiday_rules[$b]';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); echo "\n"; $hrs_SQL .= "'$holiday_rules[$b]',"; $hrs_holiday_SQL .= "'$row[0]',"; } $b++; } if (strlen($hrs_SQL)>2) { $hrs_SQL = "$hrs_SQL''"; $hrs_holiday_SQL = "$hrs_holiday_SQL''"; $hrs_SQL = "where holiday_id NOT IN($hrs_SQL) and holiday_date NOT IN($hrs_holiday_SQL) $LOGadmin_viewable_groupsSQL"; } else {$hrs_SQL="$whereLOGadmin_viewable_groupsSQL";} $stmt="SELECT holiday_id,holiday_date from vicidial_call_time_holidays $hrs_SQL order by holiday_date;"; $rslt=mysql_to_mysqli($stmt, $link); $hct_to_print = mysqli_num_rows($rslt); $hct_list=''; $o=0; while ($hct_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $hct_list .= "\n"; $o++; } echo "\n"; echo "\n"; echo "
Call Time ID: $call_time_id$NWB#call_times-call_time_id$NWE
Call Time Name: (short description of the call time)$NWB#call_times-call_time_name$NWE
Call Time Comments: $NWB#call_times-call_time_comments$NWE
Admin User Group: $NWB#call_times-user_group$NWE
Default Start: Default Stop: $NWB#call_times-ct_default_start$NWE       AH Override: audio chooser $NWB#call_times-default_afterhours_filename_override$NWE
Sunday Start: Sunday Stop: $NWB#call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#call_times-default_afterhours_filename_override$NWE
Monday Start: Monday Stop: $NWB#call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#call_times-default_afterhours_filename_override$NWE
Tuesday Start: Tuesday Stop: $NWB#call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#call_times-default_afterhours_filename_override$NWE
Wednesday Start: Wednesday Stop: $NWB#call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#call_times-default_afterhours_filename_override$NWE
Thursday Start: Thursday Stop: $NWB#call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#call_times-default_afterhours_filename_override$NWE
Friday Start: Friday Stop: $NWB#call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#call_times-default_afterhours_filename_override$NWE
Saturday Start: Saturday Stop: $NWB#call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#call_times-default_afterhours_filename_override$NWE
Active State Call Time Definitions for this Record:  
$state_rules[$b] - REMOVE $row[0] - $row[1]
\n"; echo "\n"; echo "\n"; echo "\n"; echo "Add state call time rule:
Active Inbound Holiday Definitions for this Record:  
$holiday_rules[$b] - REMOVE $row[0] - $row[1]
\n"; echo "\n"; echo "\n"; echo "\n"; echo "Add inbound holiday rule:


\n"; echo "CAMPAIGNS USING THIS CALL TIME:
\n"; echo "\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $camps_to_print = mysqli_num_rows($rslt); $o=0; while ($camps_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[0] $row[1]
\n"; echo "INBOUND GROUPS USING THIS CALL TIME:
\n"; echo "\n"; $stmt="SELECT group_id,group_name from vicidial_inbound_groups where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $camps_to_print = mysqli_num_rows($rslt); $o=0; while ($camps_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[0] $row[1]
\n"; echo "


\n"; if ($LOGdelete_call_times > 0) { echo "

DELETE THIS CALL TIME DEFINITION\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this call time
\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 "
\n"; echo ""; $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,user_group,ct_holidays from vicidial_state_call_times where state_call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $user_group = $row[20]; $ct_holidays = $row[21]; echo ""; echo "
MODIFY A STATE CALL TIME
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $ct_hrs=1; $b=0; $hrs_SQL =''; if (strlen($ct_holidays)>2) { $holiday_rules = explode('|',$ct_holidays); $ct_hrs = ((count($holiday_rules)) - 1); } echo "\n"; echo "\n"; while($ct_hrs >= $b) { if (strlen($holiday_rules[$b])>0) { $stmt="SELECT holiday_date,holiday_name from vicidial_call_time_holidays where holiday_id='$holiday_rules[$b]';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); echo "\n"; $hrs_SQL .= "'$holiday_rules[$b]',"; $hrs_holiday_SQL .= "'$row[0]',"; } $b++; } if (strlen($hrs_SQL)>2) { $hrs_SQL = "$hrs_SQL''"; $hrs_holiday_SQL = "$hrs_holiday_SQL''"; $hrs_SQL = "where holiday_id NOT IN($hrs_SQL) and holiday_date NOT IN($hrs_holiday_SQL) $LOGadmin_viewable_groupsSQL"; } else {$hrs_SQL="$whereLOGadmin_viewable_groupsSQL";} $stmt="SELECT holiday_id,holiday_date from vicidial_call_time_holidays $hrs_SQL order by holiday_date;"; $rslt=mysql_to_mysqli($stmt, $link); $hct_to_print = mysqli_num_rows($rslt); $hct_list=''; $o=0; while ($hct_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $hct_list .= "\n"; $o++; } echo "\n"; echo "\n"; # echo "\n"; echo "
Call Time ID: $call_time_id$NWB#call_times-call_time_id$NWE
State Call Time State: $NWB#call_times-state_call_time_state$NWE
State Call Time Name: (short description of the call time)$NWB#call_times-call_time_name$NWE
State Call Time Comments: $NWB#call_times-call_time_comments$NWE
Admin User Group: $NWB#call_times-user_group$NWE
Default Start: Default Stop: $NWB#call_times-ct_default_start$NWE
Sunday Start: Sunday Stop: $NWB#call_times-ct_sunday_start$NWE
Monday Start: Monday Stop: $NWB#call_times-ct_sunday_start$NWE
Tuesday Start: Tuesday Stop: $NWB#call_times-ct_sunday_start$NWE
Wednesday Start: Wednesday Stop: $NWB#call_times-ct_sunday_start$NWE
Thursday Start: Thursday Stop: $NWB#call_times-ct_sunday_start$NWE
Friday Start: Friday Stop: $NWB#call_times-ct_sunday_start$NWE
Saturday Start: Saturday Stop: $NWB#call_times-ct_sunday_start$NWE
 
Active Outbound Holiday Definitions for this Record:  
$holiday_rules[$b] - REMOVE $row[0] - $row[1]
\n"; echo "\n"; echo "\n"; echo "\n"; echo "Add outbound holiday rule:


\n"; echo "CALL TIMES USING THIS STATE CALL TIME:
\n"; echo "\n"; $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" $whereLOGadmin_viewable_call_timesSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $camps_to_print = mysqli_num_rows($rslt); $o=0; while ($camps_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[0] $row[1]
\n"; echo "


\n"; if ($LOGdelete_call_times > 0) { echo "

DELETE THIS STATE CALL TIME DEFINITION\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this call time
\n"; } } else { echo "You are not authorized to view this page. Please go back."; } } ###################### # ADD=3211111111 modify holiday definition info in the system ###################### if ($ADD==3211111111) { if ($LOGmodify_call_times==1) { if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) ) { $modify_url = "$PHP_SELF?ADD=3211111111&holiday_id=$holiday_id"; $modify_footer_refresh=1; } echo "
\n"; echo ""; $stmt="SELECT holiday_id,holiday_date,holiday_name,holiday_comments,holiday_status,ct_default_start,ct_default_stop,user_group,default_afterhours_filename_override from vicidial_call_time_holidays where holiday_id='$holiday_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $holiday_date = $row[1]; $holiday_name = $row[2]; $holiday_comments = $row[3]; $holiday_status = $row[4]; $ct_default_start = $row[5]; $ct_default_stop = $row[6]; $user_group = $row[7]; $default_afterhours_filename_override = $row[8]; echo ""; echo "
MODIFY A HOLIDAY
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Holiday ID: $holiday_id$NWB#call_times-holiday_id$NWE
Holiday Name: (short description of the holiday)$NWB#call_times-holiday_name$NWE
Holiday Comments: $NWB#call_times-holiday_comments$NWE
Admin User Group: $NWB#call_times-user_group$NWE
Default Start: Default Stop: $NWB#call_times-ct_default_start$NWE
AH Override: audio chooser $NWB#call_times-default_afterhours_filename_override$NWE
Holiday Date: \n"; echo " $NWB#call_times-holiday_date$NWE
Holiday Status: $NWB#call_times-holiday_status$NWE


\n"; echo "CALL TIMES USING THIS HOLIDAY:
\n"; echo "\n"; $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_holidays LIKE \"%|$holiday_id|%\" $whereLOGadmin_viewable_call_timesSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $camps_to_print = mysqli_num_rows($rslt); $o=0; while ($camps_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[0] $row[1]


\n"; echo "STATE CALL TIMES USING THIS HOLIDAY:
\n"; echo "\n"; $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name from vicidial_state_call_times where ct_holidays LIKE \"%|$holiday_id|%\";"; $rslt=mysql_to_mysqli($stmt, $link); $camps_to_print = mysqli_num_rows($rslt); $o=0; while ($camps_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[0] $row[1] - $row[2]
\n"; echo "


\n"; if ($LOGdelete_call_times > 0) { echo "

DELETE THIS HOLIDAY DEFINITION\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this holiday
\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) or ($LOGmodify_shifts==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 "
\n"; echo ""; $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays,report_option,user_group,report_rank from vicidial_shifts where shift_id='$shift_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $shift_name = $row[1]; $shift_start_time = $row[2]; $shift_length = $row[3]; $shift_weekdays = $row[4]; $report_option = $row[5]; $user_group = $row[6]; $report_rank = $row[7]; $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 ""; echo "
MODIFY A SHIFT\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Shift ID: $shift_id
Shift Name: (short description of the shift)$NWB#shifts-shift_name$NWE
Admin User Group: $NWB#shifts-user_group$NWE
Shift Start Time: \n"; echo "   Shift End Time: \n"; echo " $NWB#shifts-shift_start_time$NWE
Shift Length: $NWB#shifts-shift_length$NWE
Shift Weekdays:
$NWB#shifts-shift_weekdays$NWE
\n"; echo "Sunday
\n"; echo "Monday
\n"; echo "Tuesday
\n"; echo "Wednesday
\n"; echo "Thursday
\n"; echo "Friday
\n"; echo "Saturday
\n"; echo "
Report Option: $NWB#shifts-report_option$NWE
Report Rank: $NWB#shifts-report_rank$NWE
\n"; echo "


\n"; echo "USER GROUPS USING THIS SHIFT:
\n"; echo "\n"; $stmt="SELECT user_group,group_name from vicidial_user_groups where group_shifts LIKE\"% $shift_id %\" $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $camps_to_print = mysqli_num_rows($rslt); $o=0; while ($camps_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[0] $row[1]
\n"; echo "

\n"; if ($LOGdelete_call_times > 0) { echo "

DELETE THIS SHIFT DEFINITION\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this shift
\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) or ($LOGmodify_phones==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 "
\n"; echo ""; $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,user_group,voicemail_greeting,voicemail_dump_exten_no_inst from phones where extension='$extension' and server_ip='$server_ip' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); echo "
MODIFY A PHONE RECORD: $row[1]\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSallow_voicemail_greeting > 0) { echo "\n"; } else {echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Phone Extension: $NWB#phones-extension$NWE
Dial Plan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Admin User Group: $NWB#phones-user_group$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Server IP: $NWB#phones-server_ip$NWE
Agent Screen Login: $NWB#phones-login$NWE
Login Password: $NWB#phones-pass$NWE
Registration Password: $NWB#phones-conf_secret$NWE     Strength:
Set As Webphone: $NWB#phones-is_webphone$NWE
Webphone Dialpad: $NWB#phones-webphone_dialpad$NWE
Webphone Auto-Answer: $NWB#phones-webphone_auto_answer$NWE
Use External Server IP: $NWB#phones-use_external_server_ip$NWE
Status: $NWB#phones-status$NWE
Active Account: $NWB#phones-active$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Email: $NWB#phones-email$NWE
Delete Voicemail After Email: $NWB#phones-delete_vm_after_email$NWE
Voicemail Zone: $NWB#phones-voicemail_timezone$NWE
Voicemail Options: $NWB#phones-voicemail_options$NWE
Voicemail Greeting: audio chooser $NWB#phones-voicemail_greeting$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
New Messages: $row[14]$NWB#phones-messages$NWE
Old Messages: $row[15]$NWB#phones-old_messages$NWE
Client Protocol: $NWB#phones-protocol$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
Phone Ring Timeout: $NWB#phones-phone_ring_timeout$NWE
On-Hook Agent: $NWB#phones-on_hook_agent$NWE
Manager Login: $NWB#phones-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#phones-ASTmgrSECRET$NWE
Agent Default User: $NWB#phones-login_user$NWE
Agent Default Pass: $NWB#phones-login_pass$NWE
Agent Default Campaign: $NWB#phones-login_campaign$NWE
Park Exten: $NWB#phones-park_on_extension$NWE
Conf Exten: $NWB#phones-conf_on_extension$NWE
Agent Park Exten: $NWB#phones-park_on_extension$NWE
Agent Park File: $NWB#phones-park_on_filename$NWE
Monitor Prefix: $NWB#phones-monitor_prefix$NWE
Recording Exten: $NWB#phones-recording_exten$NWE
VMailMain Exten: $NWB#phones-voicemail_exten$NWE
VMailDump Exten: $NWB#phones-voicemail_dump_exten$NWE
VMailDump Exten NI: $NWB#phones-voicemail_dump_exten_no_inst$NWE
Exten Context: $NWB#phones-ext_context$NWE
Phone Context: $NWB#phones-phone_context$NWE
Allowed Codecs: $NWB#phones-codecs_list$NWE
Allowed Codecs With Template: $NWB#phones-codecs_with_template$NWE
DTMFSend Channel: $NWB#phones-dtmf_send_extension$NWE
Outbound Call Group: $NWB#phones-call_out_number_group$NWE
CallerID URL: $NWB#phones-local_web_callerID_URL$NWE
Agent Default URL: $NWB#phones-agent_web_URL$NWE
Call Logging: $NWB#phones-AGI_call_logging_enabled$NWE
User Switching: $NWB#phones-user_switching_enabled$NWE
Conferencing: $NWB#phones-conferencing_enabled$NWE
Admin Hang Up: $NWB#phones-admin_hangup_enabled$NWE
Admin Hijack: $NWB#phones-admin_hijack_enabled$NWE
Admin Monitor: $NWB#phones-admin_monitor_enabled$NWE
Call Park: $NWB#phones-call_parking_enabled$NWE
Updater Check: $NWB#phones-updater_check_enabled$NWE
AF Logging: $NWB#phones-AFLogging_enabled$NWE
Queue Enabled: $NWB#phones-QUEUE_ACTION_enabled$NWE
CallerID Popup: $NWB#phones-CallerID_popup_enabled$NWE
VMail Button: $NWB#phones-voicemail_button_enabled$NWE
Fast Refresh: $NWB#phones-enable_fast_refresh$NWE
Fast Refresh Rate: (in ms)$NWB#phones-fast_refresh_rate$NWE
Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
Auto Dial Next Number: $NWB#phones-auto_dial_next_number$NWE
Stop Rec after each call: $NWB#phones-VDstop_rec_after_each_call$NWE
Enable SIPSAK Messages: $NWB#phones-enable_sipsak_messages$NWE
DBX Server: (Primary DB Server)$NWB#phones-DBX_server$NWE
DBX Database: (Primary Server Database)$NWB#phones-DBX_database$NWE
DBX User: (Primary DB Login)$NWB#phones-DBX_user$NWE
DBX Pass: (Primary DB Secret)$NWB#phones-DBX_pass$NWE
DBX Port: (Primary DB Port)$NWB#phones-DBX_port$NWE
DBY Server: (Secondary DB Server)$NWB#phones-DBY_server$NWE
DBY Database: (Secondary Server Database)$NWB#phones-DBY_database$NWE
DBY User: (Secondary DB Login)$NWB#phones-DBY_user$NWE
DBY Pass: (Secondary DB Secret)$NWB#phones-DBY_pass$NWE
DBY Port: (Secondary DB Port)$NWB#phones-DBY_port$NWE
Template ID: $NWB#phones-template_id$NWE
Conf Override: $NWB#phones-conf_override$NWE
\n"; echo "

Click here for phone stats\n"; echo "

Click here for phone call recordings\n"; if ($LOGast_delete_phones > 0) { echo "

DELETE THIS PHONE\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this phone
\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) or ($LOGmodify_phones==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 "
\n"; echo ""; $stmt="SELECT alias_id,alias_name,logins_list,user_group from phones_alias where alias_id='$alias_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); echo "
MODIFY A PHONE ALIAS RECORD: $row[0]\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Alias ID: $row[0] $NWB#phones-alias_id$NWE
Alias Name: $NWB#phones-alias_name$NWE
Admin User Group: $NWB#phones-user_group$NWE
Phones Logins List: (comma separated)$NWB#phones-logins_list$NWE
\n"; ### list of phones in this phones alias $phone_alias_SQL = preg_replace('/,/', "','",$row[2]); echo "
\n"; echo "
PHONES WITHIN THIS PHONES ALIAS:
\n"; echo "\n"; echo "\n"; $stmt="SELECT login,extension,server_ip,protocol,phone_ip from phones where login IN ('$phone_alias_SQL') $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "|$stmt|";} $rsltx=mysql_to_mysqli($stmt, $link); $lists_to_print = mysqli_num_rows($rsltx); $o=0; while ($lists_to_print > $o) { $rowx=mysqli_fetch_row($rsltx); $o++; if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; } echo "
LOGINEXTENSIONSERVERPROTOCOLIP
$rowx[0]$rowx[1]$rowx[2]$rowx[3]$rowx[4]

\n"; if ($LOGast_delete_phones > 0) { echo "

DELETE THIS PHONE ALIAS\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this phone alias
\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) or ($LOGmodify_phones==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 "
\n"; echo ""; $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active,user_group from groups_alias where group_alias_id='$group_alias_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); echo "
MODIFY A GROUP ALIAS RECORD: $row[0]\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Group Alias ID: $row[0] $NWB#phones-group_alias_id$NWE
Group Alias Name: $NWB#phones-group_alias_name$NWE
Admin User Group: $NWB#phones-user_group$NWE
CallerID Number: $NWB#phones-caller_id_number$NWE
CallerID Name: $NWB#phones-caller_id_name$NWE
Active:
\n"; if ($LOGast_delete_phones > 0) { echo "

DELETE THIS GROUP ALIAS\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this group alias
\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 "
\n"; echo ""; $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,user_group,system_uptime,auto_restart_asterisk,asterisk_temp_no_restart,voicemail_dump_exten_no_inst from servers where ( (server_id='$server_id') or (server_ip='$server_ip') ) $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $user_group = $row[42]; $system_uptime = $row[43]; $auto_restart_asterisk = $row[44]; $asterisk_temp_no_restart = $row[45]; $voicemail_dump_exten_no_inst = $row[46]; $cpu = (100 - $cpu_idle_percent); $disk_usage = preg_replace("/ /"," - ",$disk_usage); $disk_usage = preg_replace("/\|/","%     ",$disk_usage); echo "
MODIFY A SERVER RECORD: $row[0]\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSallow_custom_dialplan > 0) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "
Server ID: $NWB#servers-server_id$NWE
Server Description: $NWB#servers-server_description$NWE
Server IP Address: $NWB#servers-server_ip$NWE
Active: $NWB#servers-active$NWE
System Load: $sysload - $cpu%   $NWB#servers-sysload$NWE
Live Channels: $channels_total   $NWB#servers-channels_total$NWE
Disk Usage: $disk_usage   $NWB#servers-disk_usage$NWE
System Uptime: $system_uptime   $NWB#servers-system_uptime$NWE
Admin User Group: $NWB#servers-user_group$NWE
Asterisk Version: $NWB#servers-asterisk_version$NWE
Max Trunks: $NWB#servers-max_trunks$NWE
Max Calls per Second: $NWB#servers-outbound_calls_per_second$NWE
Balance Dialing: $NWB#servers-balance_active$NWE
Balance Rank: $NWB#servers-balance_rank$NWE
Balance Offlimits: $NWB#servers-balance_trunks_offlimits$NWE
Telnet Host: $NWB#servers-telnet_host$NWE
Telnet Port: $NWB#servers-telnet_port$NWE
Manager User: $NWB#servers-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#servers-ASTmgrSECRET$NWE
Manager Update User: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Manager Listen User: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Manager Send User: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Conf File Secret: $NWB#servers-conf_secret$NWE     Strength:
Local GMT: (Do NOT Adjust for DST)$NWB#servers-local_gmt$NWE
VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
VMail Dump Exten NI: $NWB#servers-voicemail_dump_exten_no_inst$NWE
auto dial extension: $NWB#servers-answer_transfer_agent$NWE
Default Context: $NWB#servers-ext_context$NWE
System Performance: $NWB#servers-sys_perf_log$NWE
Server Logs: $NWB#servers-vd_server_logs$NWE
AGI Output: $NWB#servers-agi_output$NWE
Carrier Logging Active: $NWB#servers-carrier_logging_active$NWE
Recording Web Link: $NWB#servers-recording_web_link$NWE
Alternate Recording Server IP: $NWB#servers-alt_server_ip$NWE
External Server IP: $NWB#servers-external_server_ip$NWE
Active Twin Server IP: $NWB#servers-active_twin_server_ip$NWE
Active Asterisk Server: $NWB#servers-active_asterisk_server$NWE
Auto-Restart Asterisk:     $NWB#servers-auto_restart_asterisk$NWE
Temp No-Restart Asterisk:     $NWB#servers-asterisk_temp_no_restart$NWE
Active Agent Server: $NWB#servers-active_agent_login_server$NWE
Generate conf files: $NWB#servers-generate_conf$NWE
Rebuild conf files: $NWB#servers-rebuild_conf_files$NWE
Rebuild Music On Hold: $NWB#servers-rebuild_music_on_hold$NWE
Sounds Update: $NWB#servers-sounds_update$NWE
Recording Limit: $NWB#servers-recording_limit$NWE
Custom Dialplan Entry: $NWB#servers-custom_dialplan_entry$NWE
Custom Dialplan Entry: Disabled $NWB#servers-custom_dialplan_entry$NWE
\n"; ### vicidial server trunk records for this server echo "

TRUNKS FOR THIS SERVER:   $NWB#server_trunks$NWE
\n"; echo "\n"; echo "\n"; $stmt="SELECT server_ip,campaign_id,dedicated_trunks,trunk_restriction from vicidial_server_trunks where server_ip='$server_ip' $LOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_to_mysqli($stmt, $link); $recycle_to_print = mysqli_num_rows($rslt); $o=0; while ($recycle_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $o++; if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "
CAMPAIGN TRUNKS RESTRICTION DELETE
$rowx[1]
\n"; echo "\n"; echo "\n"; echo "
DELETE
\n"; echo "
ADD NEW SERVER TRUNK RECORD
\n"; echo "\n"; echo "\n"; echo "TRUNKS:
\n"; echo "CAMPAIGN:
\n"; echo "RESTRICTION:
\n"; echo "
\n"; echo "

\n"; ### list of carriers on this server echo "
\n"; echo "
CARRIERS WITHIN THIS SERVER:
\n"; echo "\n"; echo "\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]' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_to_mysqli($stmt, $link); $carriers_to_print = mysqli_num_rows($rsltx); $camp_lists=''; $o=0; while ($carriers_to_print > $o) { $rowx=mysqli_fetch_row($rsltx); $o++; if (preg_match('/Y/', $rowx[3])) {$active_carriers++;} if (preg_match('/N/', $rowx[3])) {$inactive_carriers++;} if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; } echo "
CARRIER IDNAMEREGISTRATIONACTIVE
$rowx[0]$rowx[1]$rowx[2]$rowx[3]

\n"; ### list of phones on this server echo "
\n"; echo "
PHONES WITHIN THIS SERVER:
\n"; echo "\n"; echo "\n"; $active_phones = 0; $inactive_phones = 0; $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_to_mysqli($stmt, $link); $lists_to_print = mysqli_num_rows($rsltx); $camp_lists=''; $o=0; while ($lists_to_print > $o) { $rowx=mysqli_fetch_row($rsltx); $o++; if (preg_match('/Y/', $rowx[1])) {$active_phones++; $camp_lists .= "'$rowx[0]',";} if (preg_match('/N/', $rowx[1])) {$inactive_phones++;} if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; } echo "
EXTENSIONNAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; ### list of conferences on this server echo "
\n"; echo "
CONFERENCES WITHIN THIS SERVER:
\n"; echo "\n"; echo "\n"; $active_confs = 0; $stmt="SELECT conf_exten,extension from conferences where server_ip='$row[2]'"; $rsltx=mysql_to_mysqli($stmt, $link); $lists_to_print = mysqli_num_rows($rsltx); $camp_lists=''; $o=0; while ($lists_to_print > $o) { $rowx=mysqli_fetch_row($rsltx); $o++; $active_confs++; if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; } echo "
CONFERENCEEXTENSION
$rowx[0]$rowx[2]

\n"; ### list of vicidial conferences on this server echo "
\n"; echo "
AGENT CONFERENCES WITHIN THIS SERVER:
\n"; echo "\n"; echo "\n"; $active_vdconfs = 0; $stmt="SELECT conf_exten,extension from vicidial_conferences where server_ip='$row[2]'"; $rsltx=mysql_to_mysqli($stmt, $link); $lists_to_print = mysqli_num_rows($rsltx); $camp_lists=''; $o=0; while ($lists_to_print > $o) { $rowx=mysqli_fetch_row($rsltx); $o++; $active_vdconfs++; if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; } echo "
VD CONFERENCEEXTENSION
$rowx[0]$rowx[2]

\n"; echo "
\n"; $camp_lists = preg_replace('/.$/i','',$camp_lists);; echo "This server has $active_carriers active carriers and $inactive_carriers inactive carriers

\n"; echo "This server has $active_phones active phones and $inactive_phones inactive phones

\n"; echo "This server has $active_confs active conferences

\n"; echo "This server has $active_vdconfs active vicidial conferences

\n"; echo "
\n"; if ($LOGast_delete_phones > 0) { echo "

DELETE THIS SERVER\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this server
\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 "
\n"; echo ""; $stmt="SELECT template_id,template_name,template_contents,user_group from vicidial_conf_templates where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $template_id = $row[0]; $template_name = $row[1]; $template_contents = $row[2]; $user_group = $row[3]; echo "
MODIFY A CONF TEMPLATE RECORD: $row[0]
\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Template ID: $template_id
Template Name: $NWB#conf_templates-template_name$NWE
Admin User Group: $NWB#conf_templates-user_group$NWE
Template Contents: $NWB#conf_templates-template_contents$NWE
\n"; echo "
\n"; ### list of phones using this conf template echo "
\n"; echo "
PHONES USING THIS CONF TEMPLATE:
\n"; echo "\n"; echo "\n"; $active_phones = 0; $inactive_phones = 0; $stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_to_mysqli($stmt, $link); $lists_to_print = mysqli_num_rows($rsltx); $camp_lists=''; $o=0; while ($lists_to_print > $o) { $rowx=mysqli_fetch_row($rsltx); $o++; if (preg_match('/Y/', $rowx[1])) {$active_phones++; $camp_lists .= "'$rowx[0]',";} if (preg_match('/N/', $rowx[1])) {$inactive_phones++;} if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; } echo "
EXTENSIONNAMESERVERACTIVE
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

\n"; ### list of carriers using this conf template echo "
\n"; echo "
CARRIERS USING THIS CONF TEMPLATE:
\n"; echo "\n"; echo "\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' $LOGadmin_viewable_groupsSQL;"; $rsltx=mysql_to_mysqli($stmt, $link); $lists_to_print = mysqli_num_rows($rsltx); $camp_lists=''; $o=0; while ($lists_to_print > $o) { $rowx=mysqli_fetch_row($rsltx); $o++; if (preg_match('/Y/', $rowx[1])) {$active_phones++; $camp_lists .= "'$rowx[0]',";} if (preg_match('/N/', $rowx[1])) {$inactive_phones++;} if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; } echo "
CARRIERNAMESERVERACTIVE
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

\n"; if ($LOGast_delete_phones > 0) { echo "

DELETE THIS CONF TEMPLATE\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this conf template
\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) or ($LOGmodify_carriers==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 "
\n"; echo ""; $stmt="SELECT carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active,carrier_description,user_group from vicidial_server_carriers where carrier_id='$carrier_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $user_group = $row[11]; echo "
MODIFY A CARRIER RECORD: $row[0]\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Carrier ID: $carrier_id
Carrier Name: $NWB#server_carriers-carrier_name$NWE
Carrier Description: $NWB#server_carriers-carrier_description$NWE
Admin User Group: $NWB#server_carriers-user_group$NWE
Registration String: $NWB#server_carriers-registration_string$NWE
Template ID: $NWB#server_carriers-template_id$NWE
Account Entry: $NWB#server_carriers-account_entry$NWE
Protocol: $NWB#server_carriers-protocol$NWE
Globals String: $NWB#server_carriers-globals_string$NWE
Dialplan Entry: $NWB#server_carriers-dialplan_entry$NWE
Server IP: $NWB#server_carriers-server_ip$NWE
Active: $NWB#server_carriers-active$NWE
\n"; echo "
\n"; if ($LOGast_delete_phones > 0) { echo "

DELETE THIS CARRIER\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this carrier
\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) or ($LOGmodify_tts==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 "
\n"; echo ""; $stmt="SELECT tts_id,tts_name,active,tts_text,tts_voice,user_group from vicidial_tts_prompts where tts_id='$tts_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $tts_id = $row[0]; $tts_name = $row[1]; $active = $row[2]; $tts_text = $row[3]; $tts_voice = $row[4]; $user_group = $row[5]; echo "
MODIFY A TTS RECORD: $tts_id\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
TTS ID: $tts_id
TTS Name: $NWB#tts_prompts-tts_name$NWE
Active: $NWB#tts_prompts-active$NWE
Admin User Group: $NWB#tts_prompts-user_group$NWE
TTS Voice: $NWB#tts_prompts-tts_voice$NWE
TTS Text: $NWB#tts_prompts-tts_text$NWE
\n"; echo "
\n"; if ($LOGast_delete_phones > 0) { echo "

DELETE THIS TTS ENTRY\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this TTS entry
\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) or ($LOGmodify_moh==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 "
\n"; echo ""; $stmt="SELECT moh_id,moh_name,active,random,user_group from vicidial_music_on_hold where moh_id='$moh_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $moh_id = $row[0]; $moh_name = $row[1]; $active = $row[2]; $random = $row[3]; $user_group = $row[4]; echo "
MODIFY A MUSIC ON HOLD RECORD: $moh_id\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Music On Hold ID: $moh_id
Music On Hold Name: $NWB#music_on_hold-moh_name$NWE
Admin User Group: $NWB#music_on_hold-user_group$NWE
Active: $NWB#music_on_hold-active$NWE
Random Order: $NWB#music_on_hold-random$NWE
Audio Files: \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_to_mysqli($stmt, $link); $mohfiles_to_print = mysqli_num_rows($rsltx); $ranks = ($mohfiles_to_print + 2); $o=0; while ($mohfiles_to_print > $o) { $rowx=mysqli_fetch_row($rsltx); echo "Rank: \n"; echo "   $rowx[0] - DELETE
\n"; $o++; } echo "
Add An Audio File: audio chooser $NWB#music_on_hold-filename$NWE
\n"; echo "
\n"; if ($LOGast_delete_phones > 0) { echo "

DELETE MUSIC ON HOLD ENTRY\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this Music On Hold entry
\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) or ($LOGmodify_voicemail==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 "
\n"; echo ""; $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email,voicemail_timezone,voicemail_options,user_group,voicemail_greeting from vicidial_voicemail where voicemail_id='$voicemail_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $user_group = $row[10]; $voicemail_greeting = $row[11]; echo "
MODIFY A VOICEMAIL BOX: $tts_id\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSallow_voicemail_greeting > 0) { echo "\n"; } else {echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Voicemail ID: $voicemail_id
Password: $NWB#voicemail-pass$NWE
Name: $NWB#voicemail-fullname$NWE
Email: $NWB#voicemail-email$NWE
Active: $NWB#voicemail-active$NWE
Admin User Group: $NWB#voicemail-user_group$NWE
Delete Voicemail After Email: $NWB#voicemail-delete_vm_after_email$NWE
Voicemail Greeting: audio chooser $NWB#voicemail-voicemail_greeting$NWE
Voicemail Zone: $NWB#voicemail-voicemail_timezone$NWE
Voicemail Options: $NWB#voicemail-voicemail_options$NWE
New Messages: $messages
Old Messages: $old_messages
\n"; echo "
\n"; if ($LOGast_delete_phones > 0) { echo "

DELETE THIS VOICEMAIL BOX\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this voicemail box
\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) or ($LOGmodify_labels==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 "
\n"; echo ""; $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,user_group from vicidial_screen_labels where label_id='$label_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $user_group = $row[23]; echo "
MODIFY SCREEN LABEL: $tts_id\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Label ID: $label_id
Label Name: $NWB#screen_labels-label_name$NWE
Active: $NWB#screen_labels-active$NWE
Admin User Group: $NWB#screen_labels-user_group$NWE
Hide Label in Call Logs: $NWB#screen_labels-label_hide_field_logs$NWE
Label Title: $NWB#screen_labels-default_field_labels$NWE
Label First Name: $NWB#screen_labels-default_field_labels$NWE
Label Middle Initial: $NWB#screen_labels-default_field_labels$NWE
Label Last Name: $NWB#screen_labels-default_field_labels$NWE
Label Address1: $NWB#screen_labels-default_field_labels$NWE
Label Address2: $NWB#screen_labels-default_field_labels$NWE
Label Address3: $NWB#screen_labels-default_field_labels$NWE
Label City: $NWB#screen_labels-default_field_labels$NWE
Label State: $NWB#screen_labels-default_field_labels$NWE
Label Province: $NWB#screen_labels-default_field_labels$NWE
Label Postal Code: $NWB#screen_labels-default_field_labels$NWE
Label Vendor Lead Code: $NWB#screen_labels-default_field_labels$NWE
Label Gender: $NWB#screen_labels-default_field_labels$NWE
Label Phone Number: $NWB#screen_labels-default_field_labels$NWE
Label Phone Code: $NWB#screen_labels-default_field_labels$NWE
Label Alt Phone: $NWB#screen_labels-default_field_labels$NWE
Label Security Phrase: $NWB#screen_labels-default_field_labels$NWE
Label Email: $NWB#screen_labels-default_field_labels$NWE
Label Comments: $NWB#screen_labels-default_field_labels$NWE
\n"; echo "
\n"; echo "


\n"; echo " CAMPAIGNS USING THIS SCREEN LABEL:
\n"; echo "\n"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where screen_labels='$label_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $camps_to_print = mysqli_num_rows($rslt); $o=0; while ($camps_to_print > $o) { $row=mysqli_fetch_row($rslt); echo "\n"; $o++; } echo "
$row[0] $row[1]


\n"; if ($LOGast_delete_phones > 0) { echo "

DELETE THIS SCREEN LABEL\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this screen label\n"; } } else { echo "You do not have permission to view this page\n"; exit; } } ###################### # ADD=391111111111 modify contact in the system ###################### if ($ADD==391111111111) { if ( ($LOGast_admin_access==1) or ($LOGmodify_contacts==1) ) { if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) ) { $modify_url = "$PHP_SELF?ADD=391111111111&contact_id=$contact_id"; $modify_footer_refresh=1; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo ""; if ( (preg_match("/contact_information/",$SStables_use_alt_log_db)) and (strlen($SSalt_log_server_ip)>4) and (strlen($SSalt_log_dbname)>0) ) { $linkALT=mysql_connect("$SSalt_log_server_ip", "$SSalt_log_login", "$SSalt_log_pass"); mysql_select_db("$SSalt_log_dbname", $linkALT); } else {$linkALT = $link;} $stmt="SELECT first_name,last_name,office_num,cell_num,other_num1,other_num2,bu_name,department,group_name,job_title,location from contact_information where contact_id='$contact_id';"; $rslt=mysql_to_mysqli($stmt, $linkALT); $row=mysqli_fetch_row($rslt); $first_name = $row[0]; $last_name = $row[1]; $office_num = $row[2]; $cell_num = $row[3]; $other_num1 = $row[4]; $other_num2 = $row[5]; $bu_name = $row[6]; $department = $row[7]; $group_name = $row[8]; $job_title = $row[9]; $location = $row[10]; echo "
MODIFY CONTACT: $tts_id\n"; echo "\n"; echo "\n"; echo "
First Name: $NWB#contact_information$NWE
Last Name: $NWB#contact_information$NWE
Office Number: $NWB#contact_information$NWE
Cell Number: $NWB#contact_information$NWE
Other Number 1: $NWB#contact_information$NWE
Other Number 2: $NWB#contact_information$NWE
BU Name: $NWB#contact_information$NWE
Department: $NWB#contact_information$NWE
Group: $NWB#contact_information$NWE
Job Title: $NWB#contact_information$NWE
Location: $NWB#contact_information$NWE
\n"; echo "
\n"; if ($LOGast_delete_phones > 0) { echo "

DELETE THIS CONTACT\n"; } if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to this contact\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 "
\n"; echo ""; $stmt="SELECT conf_exten,server_ip,extension from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $conf_exten = $row[0]; $server_ip = $row[1]; echo "
MODIFY A CONFERENCE RECORD: $row[0]\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Conference: $NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
Current Extension:
\n"; echo "
\n"; if ($LOGast_delete_phones > 0) { echo "

DELETE THIS CONFERENCE\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 "
\n"; echo ""; $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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $conf_exten = $row[0]; $server_ip = $row[1]; echo "
MODIFY AN AGENT CONFERENCE RECORD: $row[0]\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Conference: $NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
Current Extension:
\n"; echo "
\n"; if ($LOGast_delete_phones > 0) { echo "

DELETE THIS AGENT CONFERENCE\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 "
\n"; echo ""; $stmt="SELECT count(*) from vicidial_phone_codes;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $vicidial_phone_codes_count = $row[0]; $stmt="SELECT count(*) from vicidial_postal_codes;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $vicidial_postal_codes_count = $row[0]; $stmt="SELECT count(*) from vicidial_nanpa_prefix_codes;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $vicidial_nanpa_prefix_codes_count = $row[0]; $stmt="SELECT count(*) from nanpa_prefix_exchanges_master;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $nanpa_prefix_exchanges_master_count = $row[0]; $stmt="SELECT count(*) from nanpa_prefix_exchanges_fast;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $nanpa_prefix_exchanges_fast_count = $row[0]; $stmt="SELECT count(*) from nanpa_wired_to_wireless;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $nanpa_wired_to_wireless_count = $row[0]; $stmt="SELECT count(*) from nanpa_wireless_to_wired;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $nanpa_wireless_to_wired_count = $row[0]; $stmt="SELECT sum(total_calls) from vicidial_daily_max_stats where stats_flag='OPEN' and stats_type!='TOTAL';"; $rslt=mysql_to_mysqli($stmt, $link); $stats_to_print = mysqli_num_rows($rslt); if ($stats_to_print > 0) { $rowx=mysqli_fetch_row($rslt); $ALLtotal_calls = $rowx[0]; } $stmt="SELECT max(max_inbound) from vicidial_daily_max_stats where stats_flag='OPEN' and stats_type='INGROUP';"; $rslt=mysql_to_mysqli($stmt, $link); $stats_to_print = mysqli_num_rows($rslt); if ($stats_to_print > 0) { $rowx=mysqli_fetch_row($rslt); $ALLmax_inbound = $rowx[0]; } $stmt="SELECT max(max_outbound) from vicidial_daily_max_stats where stats_flag='OPEN' and stats_type='CAMPAIGN';"; $rslt=mysql_to_mysqli($stmt, $link); $stats_to_print = mysqli_num_rows($rslt); if ($stats_to_print > 0) { $rowx=mysqli_fetch_row($rslt); $ALLmax_outbound = $rowx[0]; } $stmt="SELECT max_channels,max_calls,max_agents from vicidial_daily_max_stats where stats_flag='OPEN' and stats_type='TOTAL';"; $rslt=mysql_to_mysqli($stmt, $link); $stats_to_print = mysqli_num_rows($rslt); if ($stats_to_print > 0) { $rowx=mysqli_fetch_row($rslt); $ALLchannels_count = $rowx[0]; $ALLcalls_count = $rowx[1]; $ALLagent_count = $rowx[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,noanswer_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,did_agent_log,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,queuemetrics_socket,queuemetrics_socket_url,enhanced_disconnect_logging,allow_emails,level_8_disable_add,pass_hash_enabled,pass_key,pass_cost,disable_auto_dial,queuemetrics_record_hold,country_code_list_stats from system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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]; $noanswer_log = $row[93]; $alt_log_server_ip = $row[94]; $alt_log_dbname = $row[95]; $alt_log_login = $row[96]; $alt_log_pass = $row[97]; $tables_use_alt_log_db = $row[98]; $did_agent_log = $row[99]; $campaign_cid_areacodes_enabled = $row[100]; $pllb_grouping_limit = $row[101]; $did_ra_extensions_enabled = $row[102]; $expanded_list_stats = $row[103]; $contacts_enabled = $row[104]; $call_menu_qualify_enabled = $row[105]; $admin_list_counts = $row[106]; $allow_voicemail_greeting = $row[107]; $svn_revision = $row[108]; $queuemetrics_socket = $row[109]; $queuemetrics_socket_url = $row[110]; $enhanced_disconnect_logging = $row[111]; $allow_emails = $row[112]; $level_8_disable_add = $row[113]; $pass_hash_enabled = $row[114]; $pass_key = $row[115]; $pass_cost = $row[116]; $disable_auto_dial = $row[117]; $queuemetrics_record_hold = $row[118]; $country_code_list_stats = $row[119]; if ($pass_hash_enabled > 0) {$pass_hash_enabled = 'ENABLED';} else {$pass_hash_enabled = 'DISABLED';} if (strlen($pass_key) > 12) {$pass_key = 'S1';} else {$pass_key = 'S0';} if ($pass_cost > 0) {$pass_cost = 'C1';} else {$pass_cost = 'C0';} echo "
MODIFY SYSTEM SETTINGS\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $pcblinkB=''; $pcblinkE=''; if ($vicidial_phone_codes_count < 1000) {$pcblinkB=''; $pcblinkE='';} echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $admin_web_dir=''; if (preg_match("/\//",$admin_web_directory)) {$admin_web_dir = dirname("$admin_web_directory"); $admin_web_dir .= "/";} echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($SSallow_custom_dialplan > 0) { echo "\n"; echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Version: $version
SVN Version: $svn_revision
DB Schema Version: $db_schema_version
DB Schema Update Date: $db_schema_update_date
Password Encryption: $pass_hash_enabled - $pass_key - $pass_cost
Auto User-add Value: $auto_user_add_value
Install Date: $install_date
Phone Codes: $pcblinkB$vicidial_phone_codes_count - $vicidial_postal_codes_count - $vicidial_nanpa_prefix_codes_count$pcblinkE - $nanpa_prefix_exchanges_master_count - $nanpa_prefix_exchanges_fast_count - $nanpa_wired_to_wireless_count - $nanpa_wireless_to_wired_count
Today System Stats: $ALLtotal_calls - $ALLmax_inbound - $ALLmax_outbound - $ALLchannels_count - $ALLcalls_count - $ALLagent_count
Use Non-Latin: $NWB#settings-use_non_latin$NWE
Webroot Writable: $NWB#settings-webroot_writable$NWE
Agent Disable Display: $NWB#settings-agent_disable$NWE
Allow SIPSAK Messages: $NWB#settings-allow_sipsak_messages$NWE
Admin Home URL: $NWB#settings-admin_home_url$NWE
Admin Modify Auto-Refresh: $NWB#settings-admin_modify_refresh$NWE
Admin No-Cache: $NWB#settings-nocache_admin$NWE
Enable Agent Transfer Logfile: $NWB#settings-enable_agc_xfer_log$NWE
Enable Agent Disposition Logfile: $NWB#settings-enable_agc_dispo_log$NWE
Timeclock End Of Day: $NWB#settings-timeclock_end_of_day$NWE
Default Local GMT: (Do NOT Adjust for DST)$NWB#settings-default_local_gmt$NWE
Default Voicemail Zone: $NWB#settings-default_voicemail_timezone$NWE
Agents Calls Reset: $NWB#settings-agents_calls_reset$NWE
Timeclock Last Auto Logout: $timeclock_last_reset_date
Agent Screen Header Date Format: $NWB#settings-vdc_header_date_format$NWE
Agent Screen Customer Date Format: $NWB#settings-vdc_customer_date_format$NWE
Agent Screen Customer Phone Format: $NWB#settings-vdc_header_phone_format$NWE
Agent API Active: $NWB#settings-vdc_agent_api_active$NWE
Agent Only Callback Campaign Lock: $NWB#settings-agentonly_callback_campaign_lock$NWE
Central Sound Control Active: $NWB#settings-sounds_central_control_active$NWE
Sounds Web Server: $NWB#settings-sounds_web_server$NWE
Sounds Web Directory: $sounds_web_directory $NWB#settings-sounds_web_directory$NWE
Admin Web Directory: $NWB#settings-admin_web_directory$NWE
Active Voicemail Server: $NWB#settings-active_voicemail_server$NWE
Allow Voicemail Greeting Chooser: $NWB#settings-allow_voicemail_greeting$NWE
Auto Dial Limit: $NWB#settings-auto_dial_limit$NWE
Outbound Auto-Dial Active: $NWB#settings-outbound_autodial_active$NWE
Disable Auto-Dial: $disable_auto_dial   $NWB#settings-disable_auto_dial$NWE
Max FILL Calls per Second: $NWB#settings-outbound_calls_per_second$NWE
Allow Custom Dialplan Entries: $NWB#settings-allow_custom_dialplan$NWE
PLLB Grouping Limit: $NWB#settings-pllb_grouping_limit$NWE
Generate Cross-Server Phone Extensions: $NWB#settings-generate_cross_server_exten$NWE
User Territories Active: $NWB#settings-user_territories_active$NWE
Enable Second Webform: $NWB#settings-enable_second_webform$NWE
Enable TTS Integration: $NWB#settings-enable_tts_integration$NWE
Enable CallCard: $NWB#settings-callcard_enabled$NWE
Enable Custom List Fields: $NWB#settings-custom_fields_enabled$NWE
Enable Campaign Test Calls: $NWB#settings-test_campaign_calls$NWE
Enable Expanded List Stats: $NWB#settings-expanded_list_stats$NWE
Country Code List Stats: $NWB#settings-country_code_list_stats$NWE
Enhanced Disconnect Logging: $NWB#settings-enhanced_disconnect_logging$NWE
Enable Campaign Areacode CID: $NWB#settings-campaign_cid_areacodes_enabled$NWE
Enable Remote Agent Extension Overrides: $NWB#settings-did_ra_extensions_enabled$NWE
Enable Contacts: $NWB#settings-contacts_enabled$NWE
Call Menu Qualify Enabled: $NWB#settings-call_menu_qualify_enabled$NWE
Level 8 Disable Add: $NWB#settings-level_8_disable_add$NWE
Admin List Counts: $NWB#settings-admin_list_counts$NWE
Allow Emails: $NWB#settings-allow_emails$NWE
First Login Trigger: $first_login_trigger   $NWB#settings-first_login_trigger$NWE
Default Phone Registration Password: $NWB#settings-default_phone_registration_password$NWE     Strength:
Default Phone Login Password: $NWB#settings-default_phone_login_password$NWE     Strength:
Default Server Password: $NWB#settings-default_server_password$NWE     Strength:
Slave Database Server: $NWB#settings-slave_db_server$NWE
Reports to use Slave DB: $NWB#settings-reports_use_slave_db$NWE
Custom Dialplan Entry: $NWB#settings-custom_dialplan_entry$NWE
Reload Dialplan On Servers: $NWB#settings-reload_dialplan_on_servers$NWE
Custom Dialplan Entry: Disabled $NWB#settings-custom_dialplan_entry$NWE
Hide Label in Call Logs: $NWB#settings-label_hide_field_logs$NWE
Label Title: $NWB#settings-default_field_labels$NWE
Label First Name: $NWB#settings-default_field_labels$NWE
Label Middle Initial: $NWB#settings-default_field_labels$NWE
Label Last Name: $NWB#settings-default_field_labels$NWE
Label Address1: $NWB#settings-default_field_labels$NWE
Label Address2: $NWB#settings-default_field_labels$NWE
Label Address3: $NWB#settings-default_field_labels$NWE
Label City: $NWB#settings-default_field_labels$NWE
Label State: $NWB#settings-default_field_labels$NWE
Label Province: $NWB#settings-default_field_labels$NWE
Label Postal Code: $NWB#settings-default_field_labels$NWE
Label Vendor Lead Code: $NWB#settings-default_field_labels$NWE
Label Gender: $NWB#settings-default_field_labels$NWE
Label Phone Number: $NWB#settings-default_field_labels$NWE
Label Phone Code: $NWB#settings-default_field_labels$NWE
Label Alt Phone: $NWB#settings-default_field_labels$NWE
Label Security Phrase: $NWB#settings-default_field_labels$NWE
Label Email: $NWB#settings-default_field_labels$NWE
Label Comments: $NWB#settings-default_field_labels$NWE
QC Features Active: $NWB#settings-qc_features_active$NWE
QC Last Pull Time: $qc_last_pull_time
Default Codecs: $NWB#settings-default_codecs$NWE
Default Webphone: $NWB#settings-default_webphone$NWE
Default External Server IP: $NWB#settings-default_external_server_ip$NWE
Webphone URL: $NWB#settings-webphone_url$NWE
Webphone System Key: $NWB#settings-webphone_systemkey$NWE
No-Answer Log: $NWB#settings-noanswer_log$NWE
DID Agent Log: $NWB#settings-did_agent_log$NWE
Alt-Log DB Server: $NWB#settings-alt_log_server_ip$NWE
Alt-Log DB Name: $NWB#settings-alt_log_server_ip$NWE
Alt-Log DB Login: $NWB#settings-alt_log_server_ip$NWE
Alt-Log DB Password: $NWB#settings-alt_log_server_ip$NWE
Alt-Log Tables: $NWB#settings-tables_use_alt_log_db$NWE
Enable QueueMetrics Logging: $NWB#settings-enable_queuemetrics_logging$NWE
QueueMetrics Server IP: $NWB#settings-queuemetrics_server_ip$NWE
QueueMetrics DB Name: $NWB#settings-queuemetrics_dbname$NWE
QueueMetrics DB Login: $NWB#settings-queuemetrics_login$NWE
QueueMetrics DB Password: $NWB#settings-queuemetrics_pass$NWE
QueueMetrics URL: $NWB#settings-queuemetrics_url$NWE
QueueMetrics Log ID: $NWB#settings-queuemetrics_log_id$NWE
QueueMetrics EnterQueue Prepend: $NWB#settings-queuemetrics_eq_prepend$NWE
QueueMetrics Login-Out: $NWB#settings-queuemetrics_loginout$NWE
QueueMetrics CallStatus: $NWB#settings-queuemetrics_callstatus$NWE
QueueMetrics Addmember Enabled: $NWB#settings-queuemetrics_addmember_enabled$NWE
QueueMetrics Dispo Pause Code: $NWB#settings-queuemetrics_dispo_pause$NWE
QueueMetrics Phone Environment Phone Append: $NWB#settings-queuemetrics_pe_phone_append$NWE
QueueMetrics Hold Call Log: $NWB#settings-queuemetrics_record_hold$NWE
QueueMetrics Socket Send: $NWB#settings-queuemetrics_socket$NWE
QueueMetrics Socket Send URL: $NWB#settings-queuemetrics_socket_url$NWE
Enable Vtiger Integration: $NWB#settings-enable_vtiger_integration$NWE\n"; echo "   Click here to Synchronize users with Vtiger\n"; echo "
Vtiger DB Server IP: $NWB#settings-vtiger_server_ip$NWE
Vtiger DB Name: $NWB#settings-vtiger_dbname$NWE
Vtiger DB Login: $NWB#settings-vtiger_login$NWE
Vtiger DB Password: $NWB#settings-vtiger_pass$NWE
Vtiger URL: $NWB#settings-vtiger_url$NWE
\n"; echo "\n"; if ($LOGuser_level >= 9) { echo "

Click here to see Admin changes to the system settings
\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) or ($LOGmodify_statuses==1) ) { if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) ) { $modify_url = "$PHP_SELF?ADD=321111111111111"; $modify_footer_refresh=1; } echo "
\n"; echo ""; echo "
\n"; echo "STATUSES WITHIN THIS SYSTEM:   $NWB#system_statuses$NWE
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\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_to_mysqli($stmt, $link); $cats_to_print = mysqli_num_rows($rslt); $cats_list=""; $o=0; while ($cats_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $cats_list .= "\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,completed from vicidial_statuses order by status;"; $rslt=mysql_to_mysqli($stmt, $link); $statuses_to_print = mysqli_num_rows($rslt); $o=0; while ($statuses_to_print > $o) { $rowx=mysqli_fetch_row($rslt); $AScategory = $rowx[4]; $o++; if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo "\n"; echo "\n"; echo "\n"; } echo "
S
T
A
T
U
S
DESCRIPTIONCATEGORY
A
G
E
N
T
 
S
E
L
E
C
T
A
B
L
E
H
U
M
A
N
 
A
N
S
W
E
R
S
A
L
E
D
N
C
C
U
S
T
O
M
E
R
 
C
O
N
T
A
C
T
N
O
T
 
I
N
T
E
R
E
S
T
E
D
U
N
W
O
R
K
A
B
L
E
S
C
H
E
D
U
L
E
D
 
C
A
L
L
B
A
C
K
C
O
M
P
L
E
T
E
D
MODIFY/DELETE
\n"; echo "\n"; echo "\n"; echo "\n"; echo "$rowx[0]
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "         \n"; echo "   \n"; if (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$rowx[0])) { echo "DELETE\n"; } else { echo "DELETE\n"; } echo "
\n"; echo "
ADD NEW SYSTEM STATUS
\n"; echo "\n"; echo "Status:   \n"; echo "Description:   \n"; echo "Selectable:   \n"; echo "Human Answer:
\n"; echo "Sale:   \n"; echo "DNC:   \n"; echo "Customer Contact:   \n"; echo "Not Interested:  
\n"; echo "Unworkable:   \n"; echo "Callback:   \n"; echo "Completed:   \n"; echo "Category: \n"; echo "  
\n"; echo "
\n"; echo "

\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) or ($LOGmodify_statuses==1) ) { if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) ) { $modify_url = "$PHP_SELF?ADD=331111111111111"; $modify_footer_refresh=1; } echo "
\n"; echo ""; echo "
\n"; echo "STATUS CATEGORIES:   $NWB#status_categories$NWE
\n"; echo "\n"; echo "\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_to_mysqli($stmt, $link); $statuses_to_print = mysqli_num_rows($rslt); $o=0; while ($statuses_to_print > $o) { $rowx=mysqli_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 (preg_match("/1$|3$|5$|7$|9$/i", $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_to_mysqli($stmt, $link); $statuses_to_print = mysqli_num_rows($rslt); $q=0; while ($statuses_to_print > $q) { $rowx=mysqli_fetch_row($rslt); $CATstatuses.=" $rowx[0]"; $q++; } $stmt="SELECT status from vicidial_campaign_statuses where category='$Avsc_id[$p]' $LOGadmin_viewable_groupsSQL order by status;"; $rslt=mysql_to_mysqli($stmt, $link); $statuses_to_print = mysqli_num_rows($rslt); $q=0; while ($statuses_to_print > $q) { $rowx=mysqli_fetch_row($rslt); $CATstatuses.=" $rowx[0]"; $q++; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $p++; } echo "
CATEGORYNAMESTATUSES IN THIS CATEGORY
\n"; echo "\n"; echo "\n"; echo "\n"; echo "$Avsc_id[$p]
\n"; echo "$CATstatuses"; echo "
TO VDAD Display:     Sale Category:     Dead Lead Category:  
Description:
        \n"; echo "   DELETE
 
\n"; echo "
ADD NEW STATUS CATEGORY
\n"; echo "\n"; echo "Category ID:   \n"; echo "Name:  
\n"; echo "TimeOnVDAD Display:   \n"; echo "Sale Category:   \n"; echo "Dead Lead Category:  
\n"; echo "Description:   \n"; echo "
\n"; echo "

\n"; } else { echo "You do not have permission to view this page\n"; exit; } } ##QC require_once('qc/QC_status_codes_include.php'); ###################### # ADD=341111111111111 modify vicidial QC status code ###################### //This section moved to include file as part of QC ###################### # ADD=550 user search form ###################### if ($ADD==550) { echo "
\n"; echo ""; echo "
SEARCH FOR A USER
\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
User Number:
Full Name:
User Level:
User Group:
\n"; } ###################### # ADD=660 user search results ###################### if ($ADD==660) { echo "
\n"; echo ""; $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 = preg_replace('/\sand$/i', '', $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 $LOGadmin_viewable_groupsSQL $SQL order by full_name desc;"; # echo "\n|$stmt|\n"; $rslt=mysql_to_mysqli($stmt, $link); $people_to_print = mysqli_num_rows($rslt); echo "
SEARCH RESULTS:\n"; echo "
\n"; $o=0; while ($people_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo "\n"; $o++; } echo "
$row[1]$row[3]$row[4]$row[5]MODIFY | STATS | STATUS | TIME
\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_to_mysqli($stmt, $link); echo "
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_to_mysqli($stmt, $link); echo "
User($user) callback listings LIVE for more than one week have been made INACTIVE\n"; } } $CBinactiveLINK = "
Remove LIVE Callbacks older than one month for this user
Remove LIVE Callbacks older than one week for this user
"; echo ""; $CBquerySQLwhere = "and user='$user'"; echo "
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_to_mysqli($stmt, $link); echo "
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_to_mysqli($stmt, $link); echo "
campaign($campaign_id) callback listings LIVE for more than one week have been made INACTIVE\n"; } } $CBinactiveLINK = "
Remove LIVE Callbacks older than one month for this campaign
Remove LIVE Callbacks older than one week for this campaign
"; echo ""; $CBquerySQLwhere = "and campaign_id='$campaign_id'"; echo "
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_to_mysqli($stmt, $link); echo "
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_to_mysqli($stmt, $link); echo "
list($list_id) callback listings LIVE for more than one week have been made INACTIVE\n"; } } $CBinactiveLINK = "
Remove LIVE Callbacks older than one month for this list
Remove LIVE Callbacks older than one week for this list
"; echo ""; $CBquerySQLwhere = "and list_id='$list_id'"; echo "
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_to_mysqli($stmt, $link); echo "
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_to_mysqli($stmt, $link); echo "
user group($user_group) callback listings LIVE for more than one week have been made INACTIVE\n"; } } $CBinactiveLINK = "
Remove LIVE Callbacks older than one month for this user group
Remove LIVE Callbacks older than one week for this user group
"; echo ""; $CBquerySQLwhere = "and user_group='$user_group'"; echo "
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 (preg_match("/USERIDDOWN/i",$stage)) {$SQLorder='order by user desc,'; $USERlink='stage=USERIDUP';} if (preg_match("/GROUPDOWN/i",$stage)) {$SQLorder='order by user_group desc,'; $NAMElink='stage=NAMEUP';} if (preg_match("/ENDATEDOWN/i",$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_to_mysqli($stmt, $link); $cb_to_print = mysqli_num_rows($rslt); echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $o=0; while ($cb_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
LEADLIST CAMPAIGNENTRY DATECALLBACK DATEUSERRECIPIENTSTATUSGROUP
$row[1]$row[2]$row[3]$row[5]$row[6]$row[8]$row[9]$row[4]$row[11]
\n"; echo "$CBinactiveLINK"; } ###################################################################################################### ###################################################################################################### ####### 0 series, displays and searches ###################################################################################################### ###################################################################################################### ###################### # ADD=0A display all active users ###################### if ($ADD=="0A") { echo "
\n"; echo ""; echo "
USER LISTINGS: "; if (preg_match('/display_all/',$status)) { $SQLstatus = ''; echo "   show only active users\n"; } else { $SQLstatus = "and active='Y'"; echo "   show all users\n"; } $USERlink='stage=USERIDDOWN'; $NAMElink='stage=NAMEDOWN'; $LEVELlink='stage=LEVELDOWN'; $GROUPlink='stage=GROUPDOWN'; $SQLorder='order by full_name'; if (preg_match("/USERIDUP/i",$stage)) {$SQLorder='order by user asc'; $USERlink='stage=USERIDDOWN';} if (preg_match("/USERIDDOWN/i",$stage)) {$SQLorder='order by user desc'; $USERlink='stage=USERIDUP';} if (preg_match("/NAMEUP/i",$stage)) {$SQLorder='order by full_name asc'; $NAMElink='stage=NAMEDOWN';} if (preg_match("/NAMEDOWN/i",$stage)) {$SQLorder='order by full_name desc'; $NAMElink='stage=NAMEUP';} if (preg_match("/LEVELUP/i",$stage)) {$SQLorder='order by user_level asc'; $LEVELlink='stage=LEVELDOWN';} if (preg_match("/LEVELDOWN/i",$stage)) {$SQLorder='order by user_level desc'; $LEVELlink='stage=LEVELUP';} if (preg_match("/GROUPUP/i",$stage)) {$SQLorder='order by user_group asc'; $GROUPlink='stage=GROUPDOWN';} if (preg_match("/GROUPDOWN/i",$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 $LOGadmin_viewable_groupsSQL $SQLstatus $SQLorder"; $rslt=mysql_to_mysqli($stmt, $link); $people_to_print = mysqli_num_rows($rslt); echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($people_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
USER IDFULL NAMELEVELGROUPACTIVELINKS
$row[0]$row[1]$row[2]$row[3]$row[4]
MODIFY | STATS | STATUS | TIME
\n"; } ###################### # ADD=10 display all campaigns ###################### if ($ADD==10) { echo "
\n"; echo ""; $camp_group_SQL = $LOGadmin_viewable_groupsSQL; if (strlen($whereLOGallowed_campaignsSQL) < 6) {$camp_group_SQL = $whereLOGadmin_viewable_groupsSQL;} $stmt="SELECT campaign_id,campaign_name,active,dial_method,auto_dial_level,lead_order,dial_statuses,user_group from vicidial_campaigns $whereLOGallowed_campaignsSQL $camp_group_SQL order by campaign_id;"; $rslt=mysql_to_mysqli($stmt, $link); $campaigns_to_print = mysqli_num_rows($rslt); echo "
CAMPAIGN LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; echo ""; echo ""; echo ""; } echo "\n"; $o=0; while ($campaigns_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; if ($SSoutbound_autodial_active > 0) { echo ""; echo ""; echo ""; echo ""; } echo "\n"; $o++; } echo "
CAMPAIGN ID
NAME
ACTIVE   GROUP   DIAL METHOD   LEVEL   LEAD ORDER   DIAL STATUSES   MODIFY
$row[0]   $row[1]   $row[2]   $row[7]   $row[3]   $row[4]   $row[5]   $row[6]MODIFY
\n"; } ###################### # ADD=100 display all lists ###################### if ($ADD==100) { echo "
\n"; echo ""; $LISTlink='stage=LISTIDDOWN'; $NAMElink='stage=LISTNAMEDOWN'; $TALLYlink='stage=TALLYDOWN'; $ACTIVElink='stage=ACTIVEDOWN'; $CAMPAIGNlink='stage=CAMPAIGNDOWN'; $CALLDATElink='stage=CALLDATEDOWN'; $SQLorder='order by list_id'; if (preg_match('/LISTIDUP/i', $stage)) {$SQLorder='order by list_id asc'; $LISTlink='stage=LISTIDDOWN';} if (preg_match('/LISTIDDOWN/i', $stage)) {$SQLorder='order by list_id desc'; $LISTlink='stage=LISTIDUP';} if (preg_match('/LISTNAMEUP/i', $stage)) {$SQLorder='order by list_name asc'; $NAMElink='stage=LISTNAMEDOWN';} if (preg_match('/LISTNAMEDOWN/i', $stage)) {$SQLorder='order by list_name desc'; $NAMElink='stage=LISTNAMEUP';} if (preg_match('/TALLYUP/i', $stage)) {$SQLorder='order by tally asc'; $TALLYlink='stage=TALLYDOWN';} if (preg_match('/TALLYDOWN/i', $stage)) {$SQLorder='order by tally desc'; $TALLYlink='stage=TALLYUP';} if (preg_match('/ACTIVEUP/i', $stage)) {$SQLorder='order by active asc'; $ACTIVElink='stage=ACTIVEDOWN';} if (preg_match('/ACTIVEDOWN/i', $stage)) {$SQLorder='order by active desc'; $ACTIVElink='stage=ACTIVEUP';} if (preg_match('/CAMPAIGNUP/i',$stage)) {$SQLorder='order by campaign_id asc'; $CAMPAIGNlink='stage=CAMPAIGNDOWN';} if (preg_match('/CAMPAIGNUP/i', $stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} if (preg_match('/CALLDATEUP/i', $stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (preg_match('/CALLDATEDOWN/i', $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,DATE_FORMAT(expiration_date,'%Y%m%d') from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id $LOGallowed_campaignsSQL group by list_id $SQLorder"; if ($SSadmin_list_counts < 1) {$stmt="SELECT list_id,list_name,list_description,'X' as tally,active,list_lastcalldate,campaign_id,reset_time,DATE_FORMAT(expiration_date,'%Y%m%d') from vicidial_lists $whereLOGallowed_campaignsSQL $SQLorder";} $rslt=mysql_to_mysqli($stmt, $link); $lists_to_print = mysqli_num_rows($rslt); echo "
LIST LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; $lists_printed = ''; $o=0; while ($lists_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $lists_printed .= "'$row[0]',"; $o++; } $stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time,DATE_FORMAT(expiration_date,'%Y%m%d') from vicidial_lists where list_id NOT IN($lists_printed'') $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $lists_to_print = mysqli_num_rows($rslt); $o=0; while ($lists_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
LIST IDLIST NAMEDESCRIPTIONRTIMELEADS COUNTACTIVELAST CALL DATECAMPAIGNMODIFY
$row[0] $row[1] $row[2] $row[7] $row[3] $row[4]"; if ($row[8] < $EXPtestdate) {echo " EXP";} echo " $row[5] $row[6]MODIFY
$row[0] $row[1] $row[2] $row[7] $row[3] $row[4]"; if ($row[8] < $EXPtestdate) {echo " EXP";} echo " $row[5] $row[6]MODIFY
\n"; } ###################### # ADD=1000 display all inbound groups ###################### if ($ADD==1000) { echo "
\n"; echo ""; $stmt="SELECT group_id,group_name,queue_priority,active,call_time_id,group_color,user_group from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_to_mysqli($stmt, $link); $ingroups_to_print = mysqli_num_rows($rslt); echo "
INBOUND GROUP LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; $o=0; while ($ingroups_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
IN-GROUPNAMEPRIORITYACTIVEADMIN GROUPTIMECOLORMODIFY
$row[0] $row[1] $row[2] $row[3] $row[6] $row[4]  MODIFY
\n"; } ###################### # ADD=1800 display all email groups ###################### if ( ($ADD==1800) and ($SSallow_emails>0) ) { echo "
\n"; echo ""; $stmt="SELECT group_id,group_name,queue_priority,active,call_time_id,group_color,user_group from vicidial_inbound_groups where group_handling='EMAIL' $LOGadmin_viewable_groupsSQL order by group_id;"; $rslt=mysql_to_mysqli($stmt, $link); $ingroups_to_print = mysqli_num_rows($rslt); echo "
EMAIL GROUP LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; $o=0; while ($ingroups_to_print > $o) { $row=mysqli_fetch_row($rslt); ## Get unhandled count $ct_stmt="select count(*) From vicidial_email_list where status='NEW' and group_id='$row[0]'"; $ct_rslt=mysql_to_mysqli($ct_stmt, $link); $ct_row=mysqli_fetch_row($ct_rslt); $unhandled_emails=$ct_row[0]; if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
IN-GROUPNAMEPRIORITYACTIVEUNREAD EMAILSADMIN GROUPTIMECOLORMODIFY
$row[0] $row[1] $row[2] $row[3] $unhandled_emails $row[6] $row[4]  MODIFY
\n"; } ###################### # ADD=1300 display all inbound dids ###################### if ($ADD==1300) { echo "
\n"; echo ""; $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route,record_call,user_group from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_pattern;"; $rslt=mysql_to_mysqli($stmt, $link); $dids_to_print = mysqli_num_rows($rslt); echo "
INBOUND DID LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; $o=0; while ($dids_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
#DIDDESCRIPTIONACTIVEADMIN GROUPROUTERECMODIFY
$row[0] $row[1] $row[2] $row[3] $row[6] $row[4] $row[5]MODIFY
\n"; } ###################### # ADD=1500 display all call menus ###################### if ($ADD==1500) { echo "
\n"; echo ""; $stmt="SELECT menu_id,menu_name,menu_prompt,menu_timeout,user_group from vicidial_call_menu $whereLOGadmin_viewable_groupsSQL order by menu_id;"; $rslt=mysql_to_mysqli($stmt, $link); $menus_to_print = mysqli_num_rows($rslt); echo "
CALL MENU LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo "\n"; $o=0; $menu_id = $MT; while ($menus_to_print > $o) { $row=mysqli_fetch_row($rslt); $menu_id[$o] = $row[0]; $menu_name[$o] = $row[1]; $menu_prompt[$o] = $row[2]; $menu_timeout[$o] = $row[3]; $menu_group[$o] = $row[4]; $o++; } $o=0; while ($menus_to_print > $o) { $stmt="SELECT count(*) from vicidial_call_menu_options where menu_id=\"$menu_id[$o]\";"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
MENU IDNAMEGROUPPROMPTTIMEOUTOPTIONSMODIFY
$menu_id[$o] $menu_name[$o] $menu_group[$o] $menu_prompt[$o] $menu_timeout[$o] $row[0]MODIFY
\n"; } ###################### # ADD=1700 display all filter phone groups ###################### if ($ADD==1700) { echo "
\n"; echo ""; $stmt="SELECT vfpg.filter_phone_group_id,filter_phone_group_name,filter_phone_group_description,count(*) as tally,user_group from vicidial_filter_phone_groups vfpg,vicidial_filter_phone_numbers vfpn where vfpg.filter_phone_group_id=vfpn.filter_phone_group_id $LOGadmin_viewable_groupsSQL group by filter_phone_group_id order by filter_phone_group_id;"; $rslt=mysql_to_mysqli($stmt, $link); $lists_to_print = mysqli_num_rows($rslt); echo "
FILTER PHONE GROUP LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $lists_printed = ''; $o=0; while ($lists_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $groups_printed .= "'$row[0]',"; $o++; } $stmt="SELECT filter_phone_group_id,filter_phone_group_name,filter_phone_group_description,0,user_group from vicidial_filter_phone_groups where filter_phone_group_id NOT IN($groups_printed'') $LOGadmin_viewable_groupsSQL order by filter_phone_group_id;"; $rslt=mysql_to_mysqli($stmt, $link); $lists_to_print = mysqli_num_rows($rslt); $o=0; while ($lists_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
FPG IDFPG NAMEDESCRIPTIONADMIN GROUPPHONES COUNTMODIFY
$row[0] $row[1] $row[2] $row[4] $row[3]MODIFY
$row[0] $row[1] $row[2] $row[4] $row[3]MODIFY
\n"; } ###################### # ADD=10000 display all remote agents ###################### if ($ADD==10000) { echo "
\n"; echo ""; # gather list of allowed users $stmt="SELECT user from vicidial_users $whereLOGadmin_viewable_groupsSQL order by user;"; $rslt=mysql_to_mysqli($stmt, $link); $users_to_print = mysqli_num_rows($rslt); $o=0; $user_start_SQL=''; while ($users_to_print > $o) { $row=mysqli_fetch_row($rslt); $user_start_SQL .= "'$row[0]',"; $o++; } $user_start_SQL = preg_replace("/,$/","",$user_start_SQL); if (strlen($user_start_SQL) > 2) {$user_start_SQL = "user_start IN($user_start_SQL)";} $ra_user_SQL = "and $user_start_SQL"; if (strlen($whereLOGallowed_campaignsSQL) < 6) {$ra_user_SQL = "where $user_start_SQL";} $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 $ra_user_SQL order by server_ip,campaign_id,user_start;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $remoteagents_to_print = mysqli_num_rows($rslt); echo "
REMOTE AGENTS LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($remoteagents_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
USERLINESSERVER   CONF-EXTEN   GROUP   STATUS   CAMPAIGN   MODIFY
$row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7]MODIFY
\n"; } ###################### # ADD=12000 display all extension group entries ###################### if ($ADD==12000) { echo "
\n"; echo ""; $stmt="SELECT extension_id,extension_group_id,extension,rank,campaign_groups,call_count_today,last_call_time,last_callerid from vicidial_extension_groups $whereLOGadmin_viewable_groupsSQL order by extension_group_id,rank,extension;"; $rslt=mysql_to_mysqli($stmt, $link); $extensiongroups_to_print = mysqli_num_rows($rslt); echo "
EXTENSION GROUP LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($extensiongroups_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
GROUPEXTENSIONRANK   RESTRICT   COUNT   LAST CALL   LAST ID   MODIFY
$row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7]MODIFY
\n"; } ###################### # ADD=100000 display all user groups ###################### if ($ADD==100000) { echo "
\n"; echo ""; $stmt="SELECT user_group,group_name,forced_timeclock_login from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_to_mysqli($stmt, $link); $usergroups_to_print = mysqli_num_rows($rslt); echo "
USER GROUPS LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($usergroups_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
USER GROUPGROUP NAMEFORCE TIMECLOCK   MODIFY
$row[0] $row[1] $row[2]MODIFY
\n"; } ###################### # ADD=1000000 display all scripts ###################### if ($ADD==1000000) { echo "
\n"; echo ""; $stmt="SELECT script_id,script_name,active,user_group from vicidial_scripts $whereLOGadmin_viewable_groupsSQL order by script_id;"; $rslt=mysql_to_mysqli($stmt, $link); $scripts_to_print = mysqli_num_rows($rslt); echo "
SCRIPTS LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($scripts_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
SCRIPT IDSCRIPT NAMEACTIVE   ADMIN GROUP   MODIFY
$row[0] $row[1] $row[2] $row[3]MODIFY
\n"; } ###################### # ADD=10000000 display all filters ###################### if ($ADD==10000000) { echo "
\n"; echo ""; $stmt="SELECT lead_filter_id,lead_filter_name,user_group from vicidial_lead_filters $whereLOGadmin_viewable_groupsSQL order by lead_filter_id;"; $rslt=mysql_to_mysqli($stmt, $link); $filters_to_print = mysqli_num_rows($rslt); echo "
LEAD FILTER LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($filters_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
FILTER IDFILTER NAMEADMIN GROUPMODIFY
$row[0] $row[1] $row[2]MODIFY
\n"; } ###################### # ADD=100000000 display all call times ###################### if ($ADD==100000000) { echo "
\n"; echo ""; if (strlen($whereLOGadmin_viewable_groupsSQL) > 0) {$tempLOGadmin_viewable_call_timesSQL = $LOGadmin_viewable_call_timesSQL;} else {$tempLOGadmin_viewable_call_timesSQL = $whereLOGadmin_viewable_call_timesSQL;} $stmt="SELECT call_time_id,call_time_name,ct_default_start,ct_default_stop,user_group from vicidial_call_times $whereLOGadmin_viewable_groupsSQL $tempLOGadmin_viewable_call_timesSQL order by call_time_id;"; $rslt=mysql_to_mysqli($stmt, $link); $calltimes_to_print = mysqli_num_rows($rslt); echo "
CALL TIME LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($calltimes_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
CALLTIME IDCALLTIME NAMEDEFAULT STARTDEFAULT STOPADMIN GROUPMODIFY
$row[0] $row[1] $row[2] $row[3] $row[4] MODIFY
\n"; } ###################### # ADD=1000000000 display all state call times ###################### if ($ADD==1000000000) { echo "
\n"; echo ""; $stmt="SELECT state_call_time_id,state_call_time_state,state_call_time_name,sct_default_start,sct_default_stop,user_group from vicidial_state_call_times $whereLOGadmin_viewable_groupsSQL order by state_call_time_id;"; $rslt=mysql_to_mysqli($stmt, $link); $statecalltimes_to_print = mysqli_num_rows($rslt); echo "
STATE CALL TIME LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($statecalltimes_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
CALLTIME IDCALLTIME STATECALLTIME NAMEDEFAULT STARTDEFAULT STOPADMIN GROUPMODIFY
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] MODIFY
\n"; } ###################### # ADD=1200000000 display all holidays ###################### if ($ADD==1200000000) { echo "
\n"; echo ""; $stmt="SELECT holiday_id,holiday_date,holiday_name,holiday_status,ct_default_start,ct_default_stop,user_group from vicidial_call_time_holidays $whereLOGadmin_viewable_groupsSQL order by holiday_date,holiday_id;"; $rslt=mysql_to_mysqli($stmt, $link); $holidays_to_print = mysqli_num_rows($rslt); echo "
HOLIDAY LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($holidays_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
HOLIDAY IDDATENAMESTATUSSTARTSTOPADMIN GROUPMODIFY
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] MODIFY
\n"; } ###################### # ADD=130000000 display all shifts ###################### if ($ADD==130000000) { echo "
\n"; echo ""; $stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays,user_group from vicidial_shifts $whereLOGadmin_viewable_groupsSQL order by shift_id;"; $rslt=mysql_to_mysqli($stmt, $link); $shifts_to_print = mysqli_num_rows($rslt); echo "
SHIFT LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($shifts_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
SHIFT IDSHIFT NAMESHIFT STARTSHIFT LENGTHWEEKDAYSADMIN GROUPMODIFY
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] MODIFY
\n"; } ###################### # ADD=10000000000 display all phones ###################### if ($ADD==10000000000) { echo "
\n"; echo ""; $EXTENlink='stage=EXTENDOWN'; $PROTOlink='stage=PROTODOWN'; $SERVERlink='stage=SERVERDOWN'; $STATUSlink='stage=STATUSDOWN'; $SQLorder='order by extension,server_ip'; if (preg_match("/EXTENUP/i",$stage)) {$SQLorder='order by extension asc'; $EXTENlink='stage=EXTENDOWN';} if (preg_match("/EXTENDOWN/i",$stage)) {$SQLorder='order by extension desc'; $EXTENlink='stage=EXTENUP';} if (preg_match("/PROTOUP/i",$stage)) {$SQLorder='order by protocol asc'; $PROTOlink='stage=PROTODOWN';} if (preg_match("/PROTODOWN/i",$stage)) {$SQLorder='order by protocol desc'; $PROTOlink='stage=PROTOUP';} if (preg_match("/SERVERUP/i",$stage)) {$SQLorder='order by server_ip asc'; $SERVERlink='stage=SERVERDOWN';} if (preg_match("/SERVERDOWN/i",$stage)) {$SQLorder='order by server_ip desc'; $SERVERlink='stage=SERVERUP';} if (preg_match("/STATUSUP/i",$stage)) {$SQLorder='order by status asc'; $STATUSlink='stage=STATUSDOWN';} if (preg_match("/STATUSDOWN/i",$stage)) {$SQLorder='order by status desc'; $STATUSlink='stage=STATUSUP';} $stmt="SELECT extension,protocol,server_ip,dialplan_number,voicemail_id,status,fullname,messages,old_messages,user_group from phones $whereLOGadmin_viewable_groupsSQL $SQLorder"; $rslt=mysql_to_mysqli($stmt, $link); $phones_to_print = mysqli_num_rows($rslt); echo "
PHONE LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($phones_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo "\n"; $o++; } echo "
EXTENPROTOSERVERDIAL PLANSTATUSNAMEVMAILGROUPLINKS
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] $row[8] $row[9]MODIFY | STATS
\n"; } ###################### # ADD=12000000000 display all phones alias ###################### if ($ADD==12000000000) { echo "
\n"; echo ""; $stmt="SELECT alias_id,alias_name,logins_list,user_group from phones_alias $whereLOGadmin_viewable_groupsSQL order by alias_id;"; $rslt=mysql_to_mysqli($stmt, $link); $phonealias_to_print = mysqli_num_rows($rslt); echo "
PHONE ALIAS LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($phonealias_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
ALIAS IDALIAS NAMEPHONE LOGINS LISTGROUPMODIFY
$row[0]$row[1]$row[2]$row[3]MODIFY
\n"; } ###################### # ADD=13000000000 display all group alias ###################### if ($ADD==13000000000) { echo "
\n"; echo ""; $stmt="SELECT group_alias_id,group_alias_name,caller_id_number,caller_id_name,active,user_group from groups_alias $whereLOGadmin_viewable_groupsSQL order by group_alias_id;"; $rslt=mysql_to_mysqli($stmt, $link); $phonealias_to_print = mysqli_num_rows($rslt); echo "
GROUP ALIAS LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($phonealias_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
GROUP ALIAS IDGROUP ALIAS NAMECID NUMBERCID NAMEACTIVEADMIN GROUPMODIFY
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]MODIFY
\n"; } ###################### # ADD=100000000000 display all servers ###################### if ($ADD==100000000000) { echo "
\n"; echo ""; $stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,local_gmt from servers $whereLOGadmin_viewable_groupsSQL order by server_id"; $rslt=mysql_to_mysqli($stmt, $link); $servers_to_print = mysqli_num_rows($rslt); echo "
SERVER LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($servers_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
SERVER IDNAMESERVER IPACTIVEASTERISKTRUNKSGMTMODIFY
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]MODIFY
\n"; } ###################### # ADD=130000000000 display all conf templates ###################### if ($ADD==130000000000) { echo "
\n"; echo ""; $stmt="SELECT template_id,template_name,user_group from vicidial_conf_templates $whereLOGadmin_viewable_groupsSQL order by template_id"; $rslt=mysql_to_mysqli($stmt, $link); $templates_to_print = mysqli_num_rows($rslt); echo "
CONF TEMPLATE LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($templates_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
Template IDTemplate NameADMIN GROUPMODIFY
$row[0]$row[1]$row[2]MODIFY
\n"; } ###################### # ADD=140000000000 display all carriers ###################### if ($ADD==140000000000) { echo "
\n"; echo ""; $stmt="SELECT carrier_id,carrier_name,server_ip,protocol,registration_string,active,user_group from vicidial_server_carriers $whereLOGadmin_viewable_groupsSQL order by carrier_id"; $rslt=mysql_to_mysqli($stmt, $link); $carriers_to_print = mysqli_num_rows($rslt); echo "
CARRIER LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($carriers_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
Carrier IDCarrier NameServer IPProtocolRegistrationActiveADMIN GROUPMODIFY
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]MODIFY
\n"; } ###################### # ADD=150000000000 display all tts entries ###################### if ($ADD==150000000000) { echo "
\n"; echo ""; $stmt="SELECT tts_id,tts_name,active,tts_text,tts_voice,user_group from vicidial_tts_prompts $whereLOGadmin_viewable_groupsSQL order by tts_id"; $rslt=mysql_to_mysqli($stmt, $link); $tts_to_print = mysqli_num_rows($rslt); echo "
TEXT-TO-SPEECH(TTS) LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($tts_to_print > $o) { $row=mysqli_fetch_row($rslt); $row[3]=preg_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 (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
TTS IDTTS NameActiveTTS VoiceTTS TextADMIN GROUPMODIFY
$row[0]$row[1]$row[2]$row[4]$row[3]$row[5]MODIFY
\n"; } ###################### # ADD=160000000000 display all music on hold entries ###################### if ($ADD==160000000000) { echo "
\n"; echo ""; $stmt="SELECT moh_id,moh_name,active,random,user_group from vicidial_music_on_hold where remove='N' $LOGadmin_viewable_groupsSQL order by moh_id"; $rslt=mysql_to_mysqli($stmt, $link); $moh_to_print = mysqli_num_rows($rslt); echo "
MUSIC-ON-HOLD(MOH) LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($moh_to_print > $o) { $row=mysqli_fetch_row($rslt); $row[3]=preg_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 (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
MOH IDMOH NameActiveRandom OrderADMIN GROUPMODIFY
$row[0]$row[1]$row[2]$row[3]$row[4]MODIFY
\n"; } ###################### # ADD=170000000000 display all voicemail entries ###################### if ($ADD==170000000000) { echo "
\n"; echo ""; $stmt="SELECT voicemail_id,fullname,active,messages,old_messages,delete_vm_after_email,user_group from vicidial_voicemail $whereLOGadmin_viewable_groupsSQL order by voicemail_id"; $rslt=mysql_to_mysqli($stmt, $link); $vm_to_print = mysqli_num_rows($rslt); echo "
VOICEMAIL BOXES:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($vm_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
VOICEMAIL IDNameActiveNew MessagesOld MessagesDeleteADMIN GROUPMODIFY
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]MODIFY
\n"; } ###################### # ADD=180000000000 display all screen label entries ###################### if ($ADD==180000000000) { echo "
\n"; echo ""; $stmt="SELECT label_id,label_name,active,user_group from vicidial_screen_labels $whereLOGadmin_viewable_groupsSQL order by label_id"; $rslt=mysql_to_mysqli($stmt, $link); $lb_to_print = mysqli_num_rows($rslt); echo "
Agent Screen Labels:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($lb_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
LABEL IDNameActiveADMIN GROUPMODIFY
$row[0]$row[1]$row[2]$row[3]MODIFY
\n"; } ###################### # ADD=190000000000 display all contacts entries ###################### if ($ADD==190000000000) { echo "
\n"; echo ""; if ( (preg_match("/contact_information/",$SStables_use_alt_log_db)) and (strlen($SSalt_log_server_ip)>4) and (strlen($SSalt_log_dbname)>0) ) { $linkALT=mysql_connect("$SSalt_log_server_ip", "$SSalt_log_login", "$SSalt_log_pass"); mysql_select_db("$SSalt_log_dbname", $linkALT); } else {$linkALT = $link;} $stmt="SELECT contact_id,first_name,last_name,office_num,bu_name,department,group_name,job_title,location from contact_information order by first_name,last_name,office_num limit 20000;"; $rslt=mysql_to_mysqli($stmt, $linkALT); $lb_to_print = mysqli_num_rows($rslt); echo "
Contacts:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($lb_to_print > $o) { $row=mysqli_fetch_row($rslt); while (strlen($row[4])>20) {$row[4] = preg_replace("/.$/","",$row[4]);} while (strlen($row[5])>20) {$row[5] = preg_replace("/.$/","",$row[5]);} while (strlen($row[6])>20) {$row[6] = preg_replace("/.$/","",$row[6]);} while (strlen($row[7])>20) {$row[7] = preg_replace("/.$/","",$row[7]);} while (strlen($row[8])>20) {$row[8] = preg_replace("/.$/","",$row[8]);} if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
NAMEOffice NumberBU NameDepartmentGroupJob TitleLocationMODIFY
$row[1] $row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]MODIFY
\n"; } ###################### # ADD=1000000000000 display all conferences ###################### if ($ADD==1000000000000) { echo "
\n"; echo ""; $stmt="SELECT conf_exten,server_ip,extension from conferences order by conf_exten"; $rslt=mysql_to_mysqli($stmt, $link); $conferences_to_print = mysqli_num_rows($rslt); echo "
CONFERENCE LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($conferences_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
CONFERENCESERVER IPEXTENSIONMODIFY
$row[0]$row[1]$row[2]MODIFY
\n"; } ###################### # ADD=10000000000000 display all vicidial conferences ###################### if ($ADD==10000000000000) { echo "
\n"; echo ""; $stmt="SELECT conf_exten,server_ip,extension from vicidial_conferences order by conf_exten"; $rslt=mysql_to_mysqli($stmt, $link); $vicidialconf_to_print = mysqli_num_rows($rslt); echo "
AGENT CONFERENCE LISTINGS:\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; $o=0; while ($vicidialconf_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo "\n"; $o++; } echo "
CONFERENCESERVER IPEXTENSIONMODIFY
$row[0] $row[1] $row[2]MODIFY
\n"; } ###################### # ADD=100000000000000 display all qc campaigns ###################### require_once('qc/QC_admin_include01.php'); ###################### # ADD=700000000000000 view all activity in the admin log ###################### if ($ADD==700000000000000) { echo "
\n"; echo ""; if ($stage > 4999) { $next_limit = ($stage + 5000); $limitSQL = "5000 offset $stage"; } else { $next_limit = "5000"; $limitSQL = "5000"; } $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code,user_group from vicidial_admin_log $whereLOGadmin_viewable_groupsSQL order by event_date desc limit $limitSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $logs_to_print = mysqli_num_rows($rslt); echo "
ADMIN CHANGE LOG: (Last 5000 records)\n"; echo "
\n"; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $logs_printed = ''; $o=0; while ($logs_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/USER|AGENT/i', $row[4])) {$record_link = "ADD=3&user=$row[6]";} if (preg_match('/CAMPAIGN/i', $row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} if (preg_match('/LIST/i', $row[4])) {$record_link = "ADD=311&list_id=$row[6]";} if (preg_match('/SCRIPT/i', $row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} if (preg_match('/FILTER/i', $row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} if (preg_match('/INGROUP/i', $row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} if (preg_match('/DID/i', $row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} if (preg_match('/USERGROUP/i', $row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} if (preg_match('/REMOTEAGENT/i', $row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} if (preg_match('/PHONE/i', $row[4])) {$record_link = "ADD=10000000000";} if (preg_match('/CALLTIME/i', $row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} if (preg_match('/SHIFT/i', $row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} if (preg_match('/CONFTEMPLATE/i', $row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} if (preg_match('/CARRIER/i', $row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} if (preg_match('/SERVER/i', $row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} if (preg_match('/CONFERENCE/i', $row[4])) {$record_link = "ADD=1000000000000";} if (preg_match('/SYSTEM/i', $row[4])) {$record_link = "ADD=311111111111111";} if (preg_match('/CATEGOR/i', $row[4])) {$record_link = "ADD=331111111111111";} if (preg_match('/GROUPALIAS/i', $row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $logs_printed .= "'$row[0]',"; $o++; } echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDGROUPDESCRIPTIONGOTO
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[8] $row[7] GOTO


\n"; echo "NEXT\n"; echo "
\n"; } ###################### # ADD=710000000000000 view all activity in the admin log made by one user ###################### if ($ADD==710000000000000) { echo "
\n"; echo ""; $stmt="SELECT full_name from vicidial_users where user='$stage' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $names_to_print = mysqli_num_rows($rslt); if ($names_to_print > 0) { $row=mysqli_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,user_group from vicidial_admin_log where user='$stage' $LOGadmin_viewable_groupsSQL order by event_date desc limit 5000;"; $rslt=mysql_to_mysqli($stmt, $link); $logs_to_print = mysqli_num_rows($rslt); echo "
ADMIN CHANGE LOG: Changes made by $stage - $user_name\n"; echo "
\n"; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $logs_printed = ''; $o=0; while ($logs_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/USER|AGENT/i', $row[4])) {$record_link = "ADD=3&user=$row[6]";} if (preg_match('/CAMPAIGN/i', $row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} if (preg_match('/LIST/i', $row[4])) {$record_link = "ADD=311&list_id=$row[6]";} if (preg_match('/SCRIPT/i', $row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} if (preg_match('/FILTER/i', $row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} if (preg_match('/INGROUP/i', $row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} if (preg_match('/DID/i', $row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} if (preg_match('/USERGROUP/i', $row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} if (preg_match('/REMOTEAGENT/i', $row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} if (preg_match('/PHONE/i', $row[4])) {$record_link = "ADD=10000000000";} if (preg_match('/CALLTIME/i', $row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} if (preg_match('/SHIFT/i', $row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} if (preg_match('/CONFTEMPLATE/i', $row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} if (preg_match('/CARRIER/i', $row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} if (preg_match('/SERVER/i', $row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} if (preg_match('/CONFERENCE/i', $row[4])) {$record_link = "ADD=1000000000000";} if (preg_match('/SYSTEM/i', $row[4])) {$record_link = "ADD=311111111111111";} if (preg_match('/CATEGOR/i', $row[4])) {$record_link = "ADD=331111111111111";} if (preg_match('/GROUPALIAS/i', $row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $logs_printed .= "'$row[0]',"; $o++; } echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDGROUPDESCRIPTIONGOTO
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[8] $row[7] GOTO


\n"; echo "\n"; echo "
\n"; } ###################### # ADD=720000000000000 view all activity in the admin log made to one section/value ###################### if ($ADD==720000000000000) { if ($LOGuser_level >= 9) { echo "
\n"; echo ""; $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','CAMPAIGN_DIALSTATUSES','CAMPAIGN_DIALSTATUS','CAMPAIGN_AC-CID')";} if (preg_match("/DIDS/",$category)) {$sectionSQL = "event_section IN('DIDS','DID_RA-EXTEN')";} $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code,user_group from vicidial_admin_log where $sectionSQL and record_id='$stage' $LOGadmin_viewable_groupsSQL order by event_date desc limit 5000;"; $rslt=mysql_to_mysqli($stmt, $link); $logs_to_print = mysqli_num_rows($rslt); echo "
ADMIN CHANGE LOG: Section Records - $category - $stage\n"; echo "
\n"; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $logs_printed = ''; $o=0; while ($logs_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/USER|AGENT/i', $row[4])) {$record_link = "$PHP_SELF?ADD=3&user=$row[6]";} if (preg_match('/CAMPAIGN/i', $row[4])) {$record_link = "$PHP_SELF?ADD=31&campaign_id=$row[6]";} if (preg_match('/LIST/i', $row[4])) {$record_link = "$PHP_SELF?ADD=311&list_id=$row[6]";} if (preg_match('/SCRIPT/i', $row[4])) {$record_link = "$PHP_SELF?ADD=3111111&script_id=$row[6]";} if (preg_match('/FILTER/i', $row[4])) {$record_link = "$PHP_SELF?ADD=31111111&lead_filter_id=$row[6]";} if (preg_match('/INGROUP/i', $row[4])) {$record_link = "$PHP_SELF?ADD=3111&group_id=$row[6]";} if (preg_match('/DID/i', $row[4])) {$record_link = "$PHP_SELF?ADD=3311&did_id=$row[6]";} if (preg_match('/USERGROUP/i', $row[4])) {$record_link = "$PHP_SELF?ADD=311111&user_group=$row[6]";} if (preg_match('/REMOTEAGENT/i', $row[4])) {$record_link = "$PHP_SELF?ADD=31111&remote_agent_id=$row[6]";} if (preg_match('/PHONE/i', $row[4])) {$record_link = "$PHP_SELF?ADD=10000000000";} if (preg_match('/CALLTIME/i', $row[4])) {$record_link = "$PHP_SELF?ADD=311111111&call_time_id=$row[6]";} if (preg_match('/CALLTIMES_STATE/i',$row[4])) {$record_link = "$PHP_SELF?ADD=3111111111&call_time_id=$row[6]";} if (preg_match('/HOLIDAY/i',$row[4])) {$record_link = "$PHP_SELF?ADD=3211111111&holiday_id=$row[6]";} if (preg_match('/SHIFT/i', $row[4])) {$record_link = "$PHP_SELF?ADD=331111111&shift_id=$row[6]";} if (preg_match('/CONFTEMPLATE/i', $row[4])) {$record_link = "$PHP_SELF?ADD=331111111111&template_id=$row[6]";} if (preg_match('/CARRIER/i', $row[4])) {$record_link = "$PHP_SELF?ADD=341111111111&carrier_id=$row[6]";} if (preg_match('/SERVER/i', $row[4])) {$record_link = "$PHP_SELF?ADD=311111111111&server_id=$row[6]";} if (preg_match('/CONFERENCE/i', $row[4])) {$record_link = "$PHP_SELF?ADD=1000000000000";} if (preg_match('/SYSTEM/i', $row[4])) {$record_link = "$PHP_SELF?ADD=311111111111111";} if (preg_match('/CATEGOR/i', $row[4])) {$record_link = "$PHP_SELF?ADD=331111111111111";} if (preg_match('/GROUPALIAS/i', $row[4])) {$record_link = "$PHP_SELF?ADD=33111111111&group_alias_id=$row[6]";} if (preg_match('/LEADS/i',$row[4])) {$record_link = "./admin_modify_lead.php?lead_id=$row[6]";} if (preg_match('/EMAIL/i',$row[4])) {$record_link = "./admin_email_accounts.php?eact=UPDATE&email_account_id=$row[6]";} if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $logs_printed .= "'$row[0]',"; $o++; } echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDGROUPDESCRIPTIONGOTO
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[8] $row[7] GOTO


\n"; echo "\n"; echo "
\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 "
\n"; echo ""; $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,val.user_group from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user $valLOGadmin_viewable_groupsSQL;"; if ($DB > 0) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $logs_to_print = mysqli_num_rows($rslt); if ($logs_to_print > 0) { $row=mysqli_fetch_row($rslt); echo "
ADMIN CHANGE LOG: Record Detail - $stage

\n"; echo "
\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; $row[9] = preg_replace('/\',/i', '\' ,',$row[9]); $row[9] = preg_replace("/\|/","
",$row[9]); echo ""; echo ""; echo "\n"; echo "
ID: $row[0]
DATE TIME: $row[1]
USER: $row[2] - $row[10]
IP: $row[3]
SECTION: $row[4]
TYPE: $row[5]
RECORD ID: $row[6]
DESCRIPTION: $row[7]
ADMIN GROUP: $row[11]
NOTES: $row[8]
SQL:

$row[9]



\n"; echo "\n"; echo "
\n"; } } else { echo "You do not have permission to view this page\n"; exit; } } ###################### # ADD=800000000000000 view all activity in the admin report log ###################### if ($ADD==800000000000000) { echo "
\n"; echo ""; if ($stage > 4999) { $next_limit = ($stage + 5000); $limitSQL = "5000 offset $stage"; } else { $next_limit = "5000"; $limitSQL = "5000"; } $stmt="SELECT report_log_id,event_date,user,ip_address,report_name,browser,referer,notes,url,run_time from vicidial_report_log order by event_date desc limit $limitSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $logs_to_print = mysqli_num_rows($rslt); echo "
ADMIN REPORT LOG: (Last 5000 records)\n"; echo "
\n"; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $logs_printed = ''; $o=0; while ($logs_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} $run_color='color=blue'; if ($row[9] > 5) {$run_color='color=black';} if ($row[9] > 10) {$run_color='color=purple';} if ($row[9] > 30) {$run_color='color=red';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $logs_printed .= "'$row[0]',"; $o++; } echo "
IDDATE TIMEUSERIPREPORTRUN TIMEGOTO
$row[0] $row[1] $row[2] $row[3] $row[4] $row[9] GOTO


\n"; echo "NEXT\n"; echo "
\n"; } ###################### # ADD=810000000000000 view all activity in the report log made by one user ###################### if ($ADD==810000000000000) { echo "
\n"; echo ""; $stmt="SELECT full_name from vicidial_users where user='$stage' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $names_to_print = mysqli_num_rows($rslt); if ($names_to_print > 0) { $row=mysqli_fetch_row($rslt); $user_name = $row[0]; } $stmt="SELECT report_log_id,event_date,user,ip_address,report_name,browser,referer,notes,url,run_time from vicidial_report_log where user='$stage' order by event_date desc limit 5000;"; $rslt=mysql_to_mysqli($stmt, $link); $logs_to_print = mysqli_num_rows($rslt); echo "
ADMIN REPORT LOG: Changes made by $stage - $user_name\n"; echo "
\n"; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $logs_printed = ''; $o=0; while ($logs_to_print > $o) { $row=mysqli_fetch_row($rslt); if (preg_match('/1$|3$|5$|7$|9$/i', $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} $run_color='color=blue'; if ($row[9] > 5) {$run_color='color=black';} if ($row[9] > 10) {$run_color='color=purple';} if ($row[9] > 30) {$run_color='color=red';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $logs_printed .= "'$row[0]',"; $o++; } echo "
IDDATE TIMEUSERIPREPORTRUN TIMEGOTO
$row[0] $row[1] $row[2] $row[3] $row[4] $row[9] GOTO


\n"; echo "\n"; echo "
\n"; } ###################### # ADD=830000000000000 detail view of one report log entry ###################### if ($ADD==830000000000000) { if ($LOGuser_level >= 9) { echo "
\n"; echo ""; $stmt="SELECT report_log_id,event_date,vrl.user,ip_address,report_name,browser,referer,notes,url,full_name,val.user_group,run_time from vicidial_report_log vrl, vicidial_users val where report_log_id='$stage' and val.user=vrl.user $valLOGadmin_viewable_groupsSQL;"; if ($DB > 0) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $logs_to_print = mysqli_num_rows($rslt); if ($logs_to_print > 0) { $row=mysqli_fetch_row($rslt); $run_color='color=blue'; if ($row[11] > 5) {$run_color='color=black';} if ($row[11] > 10) {$run_color='color=purple';} if ($row[11] > 30) {$run_color='color=red';} echo "
ADMIN REPORT LOG: Record Detail - $stage

\n"; echo "
\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo "
ID: $row[0]
DATE TIME: $row[1]
RUN TIME: $row[11] seconds
USER: $row[2] - $row[9]
IP: $row[3]
REPORT: $row[4]
BROWSER: $row[5]
NOTES: $row[7]
REFERER:

$row[6]

URL:

$row[8]



\n"; echo "\n"; echo "
\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 "
\n"; echo ""; $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_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $servers_to_print = mysqli_num_rows($rslt); $i=0; while ($i < $servers_to_print) { $row=mysqli_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_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $queuemetrics_url_LU = $row[0]; $vtiger_url_LU = $row[1]; $stmt="SELECT count(*) from vicidial_list_update_log;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $list_update_count = $row[0]; $stmt="SELECT count(*) from dialable_inventory_snapshots;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $inventory_report_count = $row[0]; ?> Server Stats and Reports Server Stats and Reports

      Real-Time Reports
\n"; echo "
    \n"; if ( (preg_match("/Real-Time Main Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Real-Time Main Report\n";} # echo "
      Real-Time SIP: Listen - Barge\n"; # echo "
      Real-Time IAX: Listen - Barge

    \n"; if ( (preg_match("/Real-Time Campaign Summary/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Real-Time Campaign Summary\n";} echo "

\n"; echo "Inbound and Outbound Calling Reports
\n"; echo "
    \n"; if ( (preg_match("/Inbound Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Inbound Report\n";} if ( ( (preg_match("/Inbound Report/",$LOGallowed_reports)) and (preg_match("/Inbound DID Report/",$LOGallowed_reports)) ) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Inbound Report by DID\n";} if ( (preg_match("/Inbound Service Level Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Inbound Service Level Report\n";} if ( (preg_match("/Inbound Summary Hourly Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Inbound Summary Hourly Report\n";} if ( (preg_match("/Inbound Daily Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Inbound Daily Report\n";} if ( (preg_match("/Inbound DID Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Inbound DID Report\n";} if ( (preg_match("/Inbound IVR Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Inbound IVR Report\n";} if ( (preg_match("/Outbound Calling Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Outbound Calling Report\n";} if ( (preg_match("/Outbound Summary Interval Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Outbound Summary Interval Report\n";} if ( (preg_match("/Outbound IVR Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) { echo "
  • Outbound IVR Report"; if ($LOGexport_reports >= 1) { if ( (preg_match("/Export Calls Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo " - Export";} } echo "\n"; } if ( (preg_match("/Fronter - Closer Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Fronter - Closer Report\n";} if ( (preg_match("/Lists Pass Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Lists Pass Report\n";} if ( (preg_match("/Lists Campaign Statuses Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Lists Campaign Statuses Report\n";} if ( (preg_match("/Campaign Status List Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Campaign Status List Report\n";} # echo "
  • AGENT SPREADSHEET PERFORMANCE\n"; if ( ( (preg_match("/Dialer Inventory Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) and ($inventory_report_count > 0) ) {echo "
  • Dialer Inventory Report\n";} if ($SSemail_enabled > 0) { if ( ( (preg_match("/Inbound Report/",$LOGallowed_reports)) and (preg_match("/Inbound Email Report/",$LOGallowed_reports)) ) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Inbound Email Report\n";} if ( (preg_match("/Email Log Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Email Log Report\n";} } if ($LOGexport_reports >= 1) { if ( (preg_match("/Export Calls Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Export Calls Report\n";} if ( (preg_match("/Export Leads Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Export Leads Report\n";} } echo "
\n"; echo "
\n"; echo "      \n"; echo "\n"; echo "Agent Reports
\n"; echo "
    \n"; if ( (preg_match("/Agent Time Detail/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Agent Time Detail\n";} if ( (preg_match("/Agent Status Detail/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Agent Status Detail\n";} if ( (preg_match("/Agent Performance Detail/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Agent Performance Detail\n";} if ( (preg_match("/Team Performance Detail/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Team Performance Detail\n";} if ( (preg_match("/Single Agent Daily/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Single Agent Daily\n";} if ( (preg_match("/User Group Login Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • User Group Login Report\n";} if ( (preg_match("/User Stats/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • User Stats\n";} if ( (preg_match("/User Time Sheet/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • User Time Sheet\n";} echo "

\n"; echo "Time Clock Reports
\n"; echo "
    \n"; if ( (preg_match("/User Timeclock Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • User Timeclock Report\n";} if ( (preg_match("/User Group Timeclock Status Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • User Group Timeclock Status Report\n";} if ( (preg_match("/User Timeclock Detail Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • User Timeclock Detail Report\n";} echo "

\n"; echo "Other Reports and Links
\n"; echo "
    \n"; if ( (preg_match("/Server Performance Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Server Performance Report\n";} if ( (preg_match("/Maximum System Stats/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Maximum System Stats\n";} if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) ) { echo "
  • Administration Change Log\n"; } if ($SSenable_queuemetrics_logging > 0) { echo "
  • QueueMetrics Reports\n"; } if ($SSenable_vtiger_integration > 0) { echo "
  • VtigerCRM Home\n"; } if ( ($list_update_count > 0) and ( (preg_match("/List Update Stats/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) ) { echo "
  • List Update Stats\n"; } if ($SScallcard_enabled > 0) { if ( (preg_match("/CallCard Search/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • CallCard Search\n";} } echo "
\n"; echo "
\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 "
\n";

			if ($stage == 'TIME')
				{
				echo "";
				echo "\n";
				}
			else
				{
				echo "";
				echo "\n";
				}

			$o=0;
			$web_u_time = date('U');
			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%";
				$s_time=' ';
				$s_ver=' ';
				$u_time=$web_u_time;
				$stmt="SELECT last_update,UNIX_TIMESTAMP(last_update) from server_updater where server_ip='$server_ip[$o]';";
				$rslt=mysql_to_mysqli($stmt, $link);
				if ($DB) {echo "$stmt\n";}
				$servertime_to_print = mysqli_num_rows($rslt);
				if ($servertime_to_print)
					{
					$row=mysqli_fetch_row($rslt);
					$s_time = $row[0];
					$u_time = ($row[1] + 10);
					}
				$server_bgcolor='';
				if ($web_u_time > $u_time)
					{$server_bgcolor=' bgcolor=red';}
				echo "\n";
				echo "\n";
				echo "\n";
				echo "\n";
				echo "\n";
				echo "\n";
				echo "\n";
				echo "\n";
				if ($stage == 'TIME')
					{
					$stmt="SELECT svn_revision from servers where server_ip='$server_ip[$o]';";
					$rslt=mysql_to_mysqli($stmt, $link);
					if ($DB) {echo "$stmt\n";}
					$serverver_to_print = mysqli_num_rows($rslt);
					if ($serverver_to_print)
						{
						$row=mysqli_fetch_row($rslt);
						$s_ver = $row[0];
						}
					echo "";
					}
				else
					{
					if ( (preg_match("/Real-Time Main Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
						{
						echo "\n";
						echo "\n";
						}
					else
						{
						echo "\n";
						echo "\n";
						}
					}
				echo "\n";
				$o++;
				}

			if ($stage == 'TIME')
				{
				echo "";

				$stmt="SELECT NOW();";
				$rslt=mysql_to_mysqli($stmt, $link);
				if ($DB) {echo "$stmt\n";}
				$dbtime_to_print = mysqli_num_rows($rslt);
				if ($dbtime_to_print)
					{
					$row=mysqli_fetch_row($rslt);
					echo "";
					}
				}
			echo "
SERVER -DESCRIPTIONIPACTLOADCHANDISKTIMEVER
SERVER +DESCRIPTIONIPACTLOADCHANDISKOUTBOUNDINBOUND
$server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$disk$s_time$s_verLINKLINK    
  PHP Time   " . date("Y-m-d H:i:s") . "  
  DB Time   $row[0]  
\n"; if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) ) { echo "

  Admin Utilities\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) { ?> Administration: Admin Administration

\n"; echo "   \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 { $pass_hash=''; $pass_checkSQL="pass='$pass'"; if ( ($SSpass_hash_enabled > 0) and (strlen($pass) > 1) ) { $pass = preg_replace("/\'|\"|\\\\|;| /","",$pass); $pass_hash = exec("../agc/bp.pl --pass=$pass"); $pass_hash = preg_replace("/PHASH: |\n|\r|\t| /",'',$pass_hash); $pass_checkSQL="pass_hash='$pass_hash'"; $pass=''; } $stmt="SELECT count(*) from vicidial_users where user='$user' and active='Y' and user_level > 1;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $userpass_to_print = mysqli_num_rows($rslt); if ($userpass_to_print < 1) {echo "Password has not been changed, please try again |2|$userpass_to_print";} else { $row=mysqli_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',pass_hash='$pass_hash',force_change_password='N',failed_login_count=0 where user='$user' and force_change_password='Y' and active='Y' and user_level > 6;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "Password has been updated, you may now continue\n"; } } } } if ($show_form > 0) { echo "
\n"; echo ""; echo "
CHANGE PASSWORD\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
New Password:     Strength:
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
\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 { $pass_hash=''; $pass_checkSQL="pass='$pass'"; if ( ($SSpass_hash_enabled > 0) and (strlen($pass) > 1) ) { $pass = preg_replace("/\'|\"|\\\\|;| /","",$pass); $pass_hash = exec("../agc/bp.pl --pass=$pass"); $pass_hash = preg_replace("/PHASH: |\n|\r|\t| /",'',$pass_hash); $pass_checkSQL="pass_hash='$pass_hash'"; $pass=''; } $stmt="SELECT count(*) from vicidial_users where user='$user' and active='Y' and user_level > 6;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $userpass_to_print = mysqli_num_rows($rslt); if ($userpass_to_print < 1) {echo "Password has not been changed, please try again |2|$userpass_to_print";} else { $row=mysqli_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',pass_hash='$pass_hash',force_change_password='N',failed_login_count=0 where user='$user' and active='Y' and user_level > 6;"; $rslt=mysql_to_mysqli($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_to_mysqli($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_to_mysqli($stmtB, $link); $stmtC="UPDATE servers SET conf_secret='$default_server_password',rebuild_conf_files='Y';"; $rslt=mysql_to_mysqli($stmtC, $link); ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtA|$stmtB|$stmtC|"; $SQL_log = preg_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_to_mysqli($stmt, $link); echo "Passwords have been updated, you may now continue on into Administration.

You may want to start by reading the ViciDial Manager Manual available at vicidial.org (there is a free version available)\n"; } } } } if ($show_form > 0) { echo "
\n"; echo ""; echo "
Welcome to ViciDial, initial setup screen

\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
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
New Password:     Strength:
 
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.
Default Phone Registration Password:     Strength:
Default Phone Login Password:     Strength:
Default Server Password:     Strength:
 
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.
Default Local GMT: (Do NOT Adjust for DST)$NWB#settings-default_local_gmt$NWE
Default Voicemail Zone: $NWB#settings-default_voicemail_timezone$NWE
 
\n"; } } } ##### END initial install welcome page ##### ###################### # ADD=999995 - copyright trademark license page ###################### if ($ADD==999995) { echo "
\n"; echo ""; echo "
Welcome to ViciDial: copyright, trademark and license page

\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Copyright:   The ViciDial Contact Center Suite is maintained by the ViciDial Group, © 2014
Trademark:   \"VICIDIAL\" is a registered trademark of the ViciDial Group. Here is our trademark use policy
License:   The ViciDial Contact Center Suite is released under the AGPLv2 open source license
Source Code:   The ViciDial Call Center Suite software is available for download, and for use, free of cost. You can download the easy to install ViciBox CD ISO version, or only the source code
\n"; if ($first_login_link > 0) { echo "

"; echo "
Continue on to the Initial Setup

  \n"; } } ##### END copyright trademark license page ##### ###################### # ADD=999994 - admin hidden utilities page ###################### if ($ADD==999994) { echo "
\n"; echo ""; echo "
Administration: hidden utilities page - If you do not know what these utilities do, you probably should not use them

\n"; echo "
\n"; if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) ) { echo "\n
 \n"; } echo "
\n"; } ##### END admin hidden utilities page ##### ###################### # ADD=999993 - max stats detail report ###################### if ($ADD==999993) { echo "\n"; echo "
\n"; echo ""; if ( (preg_match("/Maximum Stats Detail/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) { if ($stage == 'in-group') { $in_out = 'in-group'; $max_type = 'max_inbound'; $modify_link = ""; $stmt="SELECT group_name from vicidial_inbound_groups where group_id='$campaign_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $rows_to_print = mysqli_num_rows($rslt); if ($rows_to_print > 0) { $rowx=mysqli_fetch_row($rslt); $campaign_name = $rowx[0]; } else {echo "Not found"; exit;} } elseif ($stage == 'remote-agent') { $remote_agent_id=''; $stmt="SELECT remote_agent_id from vicidial_remote_agents where user_start='$campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); $rows_to_print = mysqli_num_rows($rslt); if ($rows_to_print > 0) { $rowx=mysqli_fetch_row($rslt); $remote_agent_id = $rowx[0]; } else {echo "Not found"; exit;} $modify_link = ""; $campaign_name=$campaign_id; } else { $in_out = 'campaign'; $max_type = 'max_outbound'; $modify_link = ""; $stmt="SELECT campaign_name from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $rows_to_print = mysqli_num_rows($rslt); if ($rows_to_print > 0) { $rowx=mysqli_fetch_row($rslt); $campaign_name = $rowx[0]; } else {echo "Not found"; exit;} } echo "
Administration: Maximum Stats Detail for $stage $modify_link$campaign_id
- $campaign_name   $NWB#max_stats$NWE

\n"; echo "
\n"; if ($stage == 'remote-agent') { echo "\n"; echo "\n"; } else { echo "\n"; echo "\n"; echo "\n"; } } else {echo "You do not have permission to view this page";} echo "
\n"; horizontal_bar_chart($campaign_id,'30',$stage,$link,'ra_total_calls','call count',0,'',''); echo "
\n"; horizontal_bar_chart($campaign_id,'30',$stage,$link,'ra_concurrent_calls','most concurrent calls',0,'',''); echo "
\n"; horizontal_bar_chart($campaign_id,'30',$in_out,$link,'total_calls','call count',0,'',''); echo "
\n"; horizontal_bar_chart($campaign_id,'30',$in_out,$link,$max_type,'most concurrent calls',0,'',''); echo "
\n"; horizontal_bar_chart($campaign_id,'30',$in_out,$link,'max_agents','most concurrent agents',0,'',''); echo "
\n"; } ##### END max stats detail report ##### ###################### # ADD=999992 - max system stats report ###################### if ($ADD==999992) { if (!$query_date) {$query_date=date("Y-m-d", time()-(29*86400));} if (!$end_date) { $end_date=date("Y-m-d", time()); } else if (strtotime($end_date)>strtotime(date("Y-m-d"))) { $end_date=date("Y-m-d"); } if ($query_date>$end_date) {$query_date=$end_date;} $num_graph_days = ceil(abs(strtotime($end_date) - strtotime($query_date)) / 86400)+1; echo "
\n"; echo ""; echo "
Administration: Maximum System Stats   $NWB#max_stats$NWE

\n"; echo "
"; echo "\n"; echo " to "; echo "    

\n"; echo "
[DOWNLOAD ALL]\n"; if ( (preg_match("/Maximum System Stats/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) { $stmt="SELECT sum(total_calls) from vicidial_daily_max_stats where campaign_id!='' and stats_flag='OPEN';"; $rslt=mysql_to_mysqli($stmt, $link); $rows_to_print = mysqli_num_rows($rslt); if ($rows_to_print > 0) { $rowx=mysqli_fetch_row($rslt); $ALLtotal_calls = $rowx[0]; $stmt="UPDATE vicidial_daily_max_stats SET total_calls='$ALLtotal_calls' where campaign_id='' and stats_flag='OPEN' and stats_type='TOTAL';"; $rslt=mysql_to_mysqli($stmt, $link); } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } else {echo "You do not have permission to view this page";} echo "
\n"; $download_link="[DOWNLOAD]"; horizontal_bar_chart($campaign_id,$num_graph_days,'system',$link,'total_calls','total call count in and out',0,$end_date,$download_link); echo "
\n"; $download_link="[DOWNLOAD]"; horizontal_bar_chart($campaign_id,$num_graph_days,'system',$link,'total_calls_inbound_all','total inbound call count',0,$end_date,$download_link); echo "
\n"; $download_link="[DOWNLOAD]"; horizontal_bar_chart($campaign_id,$num_graph_days,'system',$link,'total_calls_outbound_all','total outbound call count',0,$end_date,$download_link); echo "
\n"; $download_link="[DOWNLOAD]"; horizontal_bar_chart($campaign_id,$num_graph_days,'system',$link,'(max_inbound + max_outbound)','most concurrent calls in and out',0,$end_date,$download_link); echo "
\n"; $download_link="[DOWNLOAD]"; horizontal_bar_chart($campaign_id,$num_graph_days,'system',$link,'max_inbound','most concurrent calls inbound total',0,$end_date,$download_link); echo "
\n"; $download_link="[DOWNLOAD]"; horizontal_bar_chart($campaign_id,$num_graph_days,'system',$link,'max_outbound','most concurrent calls outbound total',0,$end_date,$download_link); echo "
\n"; $download_link="[DOWNLOAD]"; horizontal_bar_chart($campaign_id,$num_graph_days,'system',$link,'max_agents','most concurrent agents',0,$end_date,$download_link); echo "
\n"; } ##### END max system stats report ##### ###################### # ADD=999990 - new main landing page with system stats ###################### if ($ADD==999990) { $section_width=640; echo "
"; echo "
\n"; echo ""; echo ""; echo ""; $stmt="select closer_campaigns from vicidial_campaigns;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $closer_campaigns = preg_replace("/^ | -$/","",$row[0]); $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); $closer_campaigns = "'$closer_campaigns'"; $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaigns)) or (call_type='OUT') );"; $rslt=mysql_to_mysqli($stmt, $link); $active_calls=mysqli_num_rows($rslt); $ringing_calls=0; if ($active_calls>0) { while ($row=mysqli_fetch_row($rslt)) { if (!preg_match("/LIVE|CLOSER/i",$row[0])) {$ringing_calls++;} } } $active_stmt="select active from vicidial_users"; $active_rslt=mysql_to_mysqli($active_stmt, $link); while ($active_row=mysqli_fetch_array($active_rslt)) { $users[$active_row["active"]]++; } $active_stmt="select active from vicidial_campaigns"; $active_rslt=mysql_to_mysqli($active_stmt, $link); while ($active_row=mysqli_fetch_array($active_rslt)) { $campaigns[$active_row["active"]]++; } $active_stmt="select active from vicidial_lists"; $active_rslt=mysql_to_mysqli($active_stmt, $link); while ($active_row=mysqli_fetch_array($active_rslt)) { $lists[$active_row["active"]]++; } $active_stmt="select did_active from vicidial_inbound_dids"; $active_rslt=mysql_to_mysqli($active_stmt, $link); while ($active_row=mysqli_fetch_array($active_rslt)) { $dids[$active_row["did_active"]]++; } $active_stmt="select active from vicidial_inbound_groups"; $active_rslt=mysql_to_mysqli($active_stmt, $link); while ($active_row=mysqli_fetch_array($active_rslt)) { $ingroups[$active_row["active"]]++; } $stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents"; $rslt=mysql_to_mysqli($stmt, $link); $agent_incall=0; $agent_total=0; while($row=mysqli_fetch_array($rslt)) { $status=$row[3]; $agent_total++; if ( (preg_match("/INCALL/i",$status)) or (preg_match("/QUEUE/i",$status)) ) {$agent_incall++; } } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; # Padding echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
System Summary:
  Agents Logged In    Agents In Calls    Active Calls    Calls Ringing  
  $agent_total    $agent_incall    $active_calls    $ringing_calls  
 
    Records    Active    Inactive    Total  
Users: ".($users["Y"]+0)."".($users["N"]+0)."".($users["Y"]+$users["N"]+0)."
Campaigns: ".($campaigns["Y"]+0)."".($campaigns["N"]+0)."".($campaigns["Y"]+$campaigns["N"]+0)."
Lists: ".($lists["Y"]+0)."".($lists["N"]+0)."".($lists["Y"]+$lists["N"]+0)."
In-Groups: ".($ingroups["Y"]+0)."".($ingroups["N"]+0)."".($ingroups["Y"]+$ingroups["N"]+0)."
DIDs: ".($dids["Y"]+0)."".($dids["N"]+0)."".($dids["Y"]+$dids["N"]+0)."
\n"; echo "
\n"; $today=date("Y-m-d"); $yesterday=date("Y-m-d", mktime(0,0,0,date("m"),date("d")-1,date("Y"))); $thirtydays=date("Y-m-d", mktime(0,0,0,date("m"),date("d")-29,date("Y"))); $total_calls=0; $total_inbound=0; $total_outbound=0; $stmt="SELECT stats_type,sum(total_calls) from vicidial_daily_max_stats where campaign_id!='' and stats_flag='OPEN' and stats_date='$today' group by stats_type;"; $rslt=mysql_to_mysqli($stmt, $link); $rows_to_print = mysqli_num_rows($rslt); if ($rows_to_print > 0) { while ($rowx=mysqli_fetch_row($rslt)) { $total_calls += $rowx[1]; if (preg_match('/INGROUP/', $rowx[0])) {$total_inbound+=$rowx[1];} if (preg_match('/CAMPAIGN/', $rowx[0])) {$total_outbound+=$rowx[1];} } } $stmt="select * from vicidial_daily_max_stats where stats_date='$today' and stats_flag='OPEN' and stats_type='TOTAL' order by stats_date, campaign_id asc"; $rslt=mysql_to_mysqli($stmt, $link); echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; # echo ""; echo ""; echo ""; echo ""; echo ""; if (mysqli_num_rows($rslt)>0) { while ($row=mysqli_fetch_array($rslt)) { echo ""; # echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } else { echo ""; echo ""; echo ""; } echo "
Total Stats for Today:[view max stats]
CAMPAIGN ID  Total Calls    Total Inbound Calls    Total Outbound Calls    Maximum Agents  
".$row["campaign_id"]."".($total_calls+0)."".($total_inbound+0)."".($total_outbound+0)."".($row["max_agents"]+0)."
*** NO ACTIVITY FOR $today ***
\n"; $stmt="select * from vicidial_daily_max_stats where stats_date='$yesterday' and stats_type='TOTAL' order by stats_date, campaign_id asc"; $rslt=mysql_to_mysqli($stmt, $link); echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo ""; # echo ""; echo ""; echo ""; echo ""; echo ""; if (mysqli_num_rows($rslt)>0) { while ($row=mysqli_fetch_array($rslt)) { echo ""; #echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } else { echo ""; echo ""; echo ""; } echo "

"; } ##### If report run, update the time in the vicidial_report_log table ##### if ( ($ADD==999993) or ($ADD==999992) or ($ADD==730000000000000) or ($ADD==830000000000000) ) { $endMS = microtime(); $startMSary = explode(" ",$startMS); $endMSary = explode(" ",$endMS); $runS = ($endMSary[0] - $startMSary[0]); $runM = ($endMSary[1] - $startMSary[1]); $TOTALrun = ($runS + $runM); $stmt="UPDATE vicidial_report_log set run_time='$TOTALrun' where report_log_id='$report_log_id';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); } ###################### # ADD=999991 display server version info ###################### if ($ADD==999991) { echo "
Total Stats for Yesterday:[view max stats]
CAMPAIGN ID  Total Calls    Total Inbound Calls    Total Outbound Calls    Maximum Agents  
".$row["campaign_id"]."".($row["total_calls"]+0)."".($row["max_inbound"]+0)."".($row["max_outbound"]+0)."".($row["max_agents"]+0)."
*** NO ACTIVITY FOR $today ***
\n"; echo ""; echo "
Administration: Server Version Information

\n"; if ($LOGview_reports==1) { if ($reports_only_user < 1) { echo "
\n";

			echo "";
			echo "\n";

			$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_to_mysqli($stmt, $link);
			if ($DB) {echo "$stmt\n";}
			$servers_to_print = mysqli_num_rows($rslt);
			$i=0;
			while ($i < $servers_to_print)
				{
				$row=mysqli_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++;
				}

			$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 "\n";
				echo "\n";
				echo "\n";
				echo "\n";
				echo "\n";
				echo "\n";
				echo "\n";
				echo "\n";

				$s_time=' ';
				$s_ver=' ';
				$s_info_print='no svn information';
				$stmt="SELECT last_update from server_updater where server_ip='$server_ip[$o]';";
				$rslt=mysql_to_mysqli($stmt, $link);
				if ($DB) {echo "$stmt\n";}
				$servertime_to_print = mysqli_num_rows($rslt);
				if ($servertime_to_print)
					{
					$row=mysqli_fetch_row($rslt);
					$s_time = $row[0];
					}
				$stmt="SELECT svn_revision,svn_info from servers where server_ip='$server_ip[$o]';";
				$rslt=mysql_to_mysqli($stmt, $link);
				if ($DB) {echo "$stmt\n";}
				$serverver_to_print = mysqli_num_rows($rslt);
				if ($serverver_to_print)
					{
					$row=mysqli_fetch_row($rslt);
					$s_ver = $row[0];
					$s_info = $row[1];
					$s_info_print = preg_replace("/\n/",'
',$s_info); } if (strlen($s_info_print) < 1) {$s_info_print='no svn information';} echo ""; echo ""; echo "\n"; $o++; } echo "
SERVERDESCRIPTIONIPACTLOADCHANDISKTIMEVER
$server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$disk$s_time$s_ver
 $s_info_print
\n"; } } else { echo "You do not have permission to view this page\n"; exit; } } ##### END server version info ##### echo "
\n"; echo "
\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); echo "
\n"; echo "

"; echo "VERSION: $admin_version
"; echo "BUILD: $build\n"; if (!preg_match("/_BUILD_/",$SShosted_settings)) {echo "
© 2014 ViciDial Group
";} echo "
\n"; ?>
1) and ($modify_footer_refresh > 0) and (strlen($modify_url)>10) ) ) { echo "\n"; if ($SSnocache_admin=='1') { echo "\n"; echo "\n"; echo "\n"; } if ( ($SSadmin_modify_refresh > 1) and ($modify_footer_refresh > 0) and (strlen($modify_url)>10) ) { echo "\n"; } echo "\n"; } echo "\n"; exit; ##### CALCULATE COMPLETE LEADS ##### function complete_leads($DB,$link,$dial_statuses,$camp_lists,$call_count_limit,$single_status,$campaign_id) { if (isset($camp_lists)) { if (strlen($camp_lists)>1) { if (strlen($dial_statuses)>2) { $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 = "''";} $CCLsql = "(called_count < 0) or"; if ($call_count_limit > 0) {$CCLsql = "(called_count >= $call_count_limit) or";} $complete_statuses=''; $stmt="SELECT status from vicidial_statuses where completed='Y';"; $rslt=mysql_to_mysqli($stmt, $link); $statuses_to_print = mysqli_num_rows($rslt); $q=0; while ($statuses_to_print > $q) { $rowx=mysqli_fetch_row($rslt); $complete_statuses.="'$rowx[0]',"; $q++; } $stmt="SELECT status from vicidial_campaign_statuses where completed='Y' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $statuses_to_print = mysqli_num_rows($rslt); $q=0; while ($statuses_to_print > $q) { $rowx=mysqli_fetch_row($rslt); $complete_statuses.="'$rowx[0]',"; $q++; } $complete_statuses = preg_replace("/,$/","",$complete_statuses); if (strlen($complete_statuses) < 2) {$complete_statuses = "''";} $CSsql = "status IN($complete_statuses)"; $stmt="SELECT count(*) FROM vicidial_list where ( (status IN($Dsql)) and (list_id IN($camp_lists)) and ( $CCLsql ($CSsql) ) );"; #$DB=1; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $rslt_rows = mysqli_num_rows($rslt); if ($rslt_rows) { $rowx=mysqli_fetch_row($rslt); $complete_leads = $rowx[0]; } else {$complete_leads = '0';} if ($DB > 0) {echo "|$DB|\n";} if ($single_status > 0) {return $complete_leads;} else {echo "There are $complete_leads completed leads 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"; } } ##### CALCULATE DIALABLE LEADS ##### function dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$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_to_mysqli($stmt, $link); $rowx=mysqli_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_to_mysqli($stmt, $link); $row=mysqli_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 = preg_replace('/,$/i', '',$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')) )"; } $CCLsql=''; if ($call_count_limit > 0) { $CCLsql = "and (called_count < $call_count_limit)"; } $EXPsql=''; $expired_lists=''; $REPORTdate = date("Y-m-d"); $stmt="SELECT list_id FROM vicidial_lists where list_id IN($camp_lists) and (active='Y') and (expiration_date < \"$REPORTdate\");"; #$DB=1; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $rslt_rows = mysqli_num_rows($rslt); $f=0; while ($rslt_rows > $f) { $rowx=mysqli_fetch_row($rslt); $expired_lists .= "'$rowx[0]',"; $f++; } $expired_lists = preg_replace("/,$/",'',$expired_lists); if (strlen($expired_lists) < 2) {$expired_lists = "''";} $EXPsql = "and list_id NOT IN($expired_lists)"; $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) $CCLsql $DLTsql $fSQL $EXPsql"; #$DB=1; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $rslt_rows = mysqli_num_rows($rslt); if ($rslt_rows) { $rowx=mysqli_fetch_row($rslt); $active_leads = "$rowx[0]"; } else {$active_leads = '0';} if ($DB > 0) {echo "|$DB|\n";} if ($single_status > 0) {return $active_leads;} else {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 ### } ?>